LiveWork API Errors

<< Back to FrontPage

 


 

LiveWork API Errors

 

The LiveWork API attempts to return as much useful information as possible whenever an error occurs in reponse to an API request.

 

Anatomy of a LiveWork API Error

 

A LiveWork API error response includes a lot of information. Though all LiveWork API responses--including errors--are returned in the desired response format (see Overview), all of the examples here use XML.

 

The entire LiveWork API error response consists of one <api> element. The <api> element contains two other elements: the <request> element and the <response> element.

 

The <request> Element

 

The <request> element contains all of the information about the API request that was received. This includes:

 

          <method> - The HTTP method used to make the API request (e.g. POST, GET, PUT, or DELETE)

          <protocol> - The protocol used to make the API request (e.g. http or https)

          <domain> - The domain used to make the API request (e.g. www.livework.com)

          <port> - The port used to make the API request (e.g. 3000)

          <path> - The path used to make the API request (e.g. /api/v1/projects)

          <format> - The format used to make the API request (e.g. xml, json, rss, atom, or none)

          <parameters> - The parameters used to make the API request (e.g. )

          <url> - The full url used to make the API request (e.g. http://www.livework.com/api/v1/projects?...)

 

The <response> Element

 

The <response> element contains one <error> element which contains all of the information about the API error that was returned. This includes:

 

          <type> - The type of error resulting from the API request (e.g. Api::V1::Exception::RecordNotFound)

          <message> - A message with more information about the error resulting from the API request (e.g. Project not found.)

          Other error type-specific information (see below).

 

A Complete Example

 

<?xml version="1.0" encoding="UTF-8"?>

<api>

     <request>

          <method>GET</method>

          <protocol>http</protocol>

          <domain>www.livework.com</domain>

          <path>/api/v1/projects/1</path>

          <format>none</format>

          <parameters>

               <oauth-nonce>12345</oauth-nonce>

               <oauth-timestamp>67890</oauth-timestamp>

               <oauth-signature-method>HMAC-SHA1</oauth-signature-method>

               <oauth-token>abc</oauth-token>

               <oauth-consumer-key>def</oauth-consumer-key>

               <oauth-signature>ghi</oauth-signature>

          </parameters>

          <url>http://www.livework.com/api/v1/projects/1?...</url>

     </request>

     <response>

          <error>

               <type>Api::V1::Exception::RecordNotFound</type>

               <message>Project not found.</message>

          </error>

     </response>

</api>

 

LiveWork API Error Types

 

          Api::V1::Exception::Base - A general, nondescript error shown when no more specific error information was available.

          Api::V1::Exception::RecordNotFound - An error indicating that a record could not be found using the supplied ID.

          Api::V1::Exception::RecordNotSaved - An error indicating that a record could not be created or updated due to failing validations. The specific validation failures are listed.

 


 

<< Back to FrontPage

Comments (0)

You don't have permission to comment on this page.