Debugging

If you're getting errors, you can include errors codes in the responses. To do this, add the flag SUPPRESS_RESPONSE_CODES in your calls. Responses will then include 200 OK responses with the actual error code. For example, define the call as follows:

POST /auths?SUPPRESS_RESPONSE_CODES=TRUE HTTP/1.1 ...

The body of the response will then contain a JSON string with the following attributes:

successful:boolean Will be false if there was an error and true if there was none.
status_code:number The numeric HTTP status code that would have been returned without the SUPPRESS_RESPONSE_CODES flag.
message_code:number The message code for the response.
message:string The message text associated with message_code
response:object The response that would have been received in the response body as JSON without suppressing response codes.

Response Example with Error

HTTP/1.1 200 OK
Server:  nginx
Date: Sun, 10 Nov 2013 03:57:20 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 139
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubdomains

{"successful": false, "status_code": 400, "message": "Credentials incorrect for app and app secret", "message_code": 40422, "response": ""}

Response Example with No Error

HTTP/1.1 200 OK
Server:  nginx
Date: Sun, 10 Nov 2013 03:57:20 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 165
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubdomains

{"successful": false, "status_code": 200, "message": "Pushed notification", "message_code": 40220, "response": {"auth_request" : "dopkpq2oqhf9ej8uuud21geh6bwi9394"}}

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at https://launchkey.com./support. ×