Error handling
Web Services API handles errors in two different ways, depending on the nature of the error and the type of API.
If a requested operation can't be processed and sent to T-Server, the HTTP request returns an error code with supporting error details. For example, you might see the following response when the T-Server connection is unavailable:
HTTP 503
{
"statusCode":4,
"statusMessage": "Voice service is not available at this time"
}
For reference, a successful response looks like this:
HTTP 200
{
"statusCode": 0
}
The other way the Web Services can handle errors is by delivering the error to the client asynchronously using a CometD notification. For example, the Voice API returns a separate message type called ErrorMessage, while the Twitter API returns the errorMessage property on its TweetOperationResponse message. Details about specific error notifications are available on the "CometD notifications" page in each Web Services API.