|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Gigya's Developer Documentation > API Reference > Client API (JavaScript & AS3) > Objects > Response object
Response objectFrom $1Table of contentsThe Response object is a standard object used by Gigya to pass return values of API methods. Gigya Socialize uses an asynchronous programming model in which API methods are triggered and then run in the background until they are completed. Upon successful or unsuccessful completion, the operation invokes a callback function - which is provided by the developer. Gigya Socialize expects the callback function to have the standard signature - mycallback(response). The one parameter which the callback function receives is the response object. The response object contains the values returned from the API method. The Response object has some common data members, which are values that are returned by all API methods. In addition to the common data members, each API method may define additional members in the response object. Method specific members are detailed in the reference section for each API call.
Common Data Members
Error CodesFollowing is the full list of possible error codes. All values except "0" indicate an error:
Usage Examplefunction myCallback(response)
{
if (response.errorCode==0)
{
// handle normal behavior (depends on the original API method call)
// ...
}
else
{
// handle errors
alert("An error has occurred!" + '\n' +
"Error details: " + response.errorMessage + '\n' +
"Error code: " + response.errorCode + '\n' +
"In method: " + response.operation;
}
}
Tags:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||