You are not logged in.   Log in | Register

Response object

From $1

The 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

Field
Type Description
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Error Codes table.
errorMessage string A short textual description of an error, associated with the errorCode, for logging purposes.
operation string The name of the API method that generated this response.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.
status string Deprecated. Please use errorCode instead. 
statusMessage string Deprecated. Please use errorMessage instead.

  

Error Codes

Following is the full list of possible error codes. All values except "0" indicate an error:

errorCode errorMessage
0  
200001 Operation canceled
400001 Invalid request format
400002 Missing required parameter
400004 Invalid parameter format
400006 Invalid parameter value
400050 Invalid userObject Format
400060 Missing required provider parameter
400070 Missing required recipients parameter
400080 Missing required body parameter
400090 Missing required subject parameter
400092 Missing required ApiKey parameter
400093 Invalid ApiKey parameter
400094 Missing required uid parameter
400095 Invalid uid parameter
400096 Not supported
400097 Missing required timestamp parameter
400098 Invalid timestamp parameter
400099 Invalid provider
400100 No providers
400101 Popup blocked
400102 Invalid event handler
400103 Invalid containerID
401002 Permission not requested
401003 No user permission
403001 Invalid session token
403002 Request has expired
403003 Invalid request signature
403004 Duplicate nonce
403005 Unauthorized user
403006 Secret Sent Over Http
403007 Invalid SecretKey parameter
403008 Invalid OpenID Url
403009 Provider session expired
404001 Friend not found
404002 Network not found
500001 General Server Error
500020 Invalid site ID
500021 Data pending
500023 Provider error
500024 No valid session
500025 Identity exists
500026 Network error
500027 Provider limit reached
500028 Database error
500030 Invalid site domain
500031 No provider application
500032 Load failed
501001 Invalid API method


 

Usage Example

function 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:
Files (0)