What's new? | Help | Directory | Sign in
Google
                
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>
  </error>
</response>

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

JSON

To request an API method response in JSON format, simply pass the parameter “format” with the value “json”. If the parameter “callback” is also present, the JSON data structure will be wrapped inside a call to a function named by the value of “callback”.

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": {
    "message": [error-message],
    "code": [error-code] 
   }
}

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

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

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