My favorites | Sign in
Project Logo
                
Search
for
Updated May 07, 2008 by kenn.ejima
ErrorCodes  

Error Codes

Sample responses

XML

A successful method call returns a document like this:

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</stat>
  [method-specific-payload]
</response>

If an error occurs, a document like the following is returned:

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>fail</status>
  <error>
    <code>[error-code]</code>
    <message>[error-message]</message>
    <detail>[detail-if-any]</detail>
  </error>
</response>

The values for the method-specific-payload item is defined on each method’s reference page.

JSON

A successful method call returns a JSON data structure like this:

{
  "status": "ok", 
  [method-specific-payload] 
}

If, for example, the parameter “callback” was passed with the value “myFunction”, the following would be returned:

myFunction({ 
  "status": "ok", 
  [method-specific-payload] 
});

If an error occurs, a JSON data structure like the following is returned:

{
  "status": "fail",
  "error": {
    "code": [error-code],
    "message": [error-message],
    "detail": [detail-if-any]
   }
}

Likewise, if the parameter “callback” was passed with the value “whizBang”, the following would be returned:

whizBang({
  "status": "fail",
  "error": {
    "code": [error-code],
    "message": [error-message],
    "detail": [detail-if-any]
   }
});

The values for the method-specific-payload item is defined on each method’s reference page.

Hosted by Google Code