Web service responses

The response to a web service call is composed of two components: HTTP response code and JSON message.

The response to a successful web service request includes a 200 status code, and JSON data that contains context-specific information about the request processing. The response to an unsuccessful web service request includes an HTTP error response code, and JSON data that contains the error message.

HTTP response codes

Table 1. HTTP error response codes
Code Description
200 Success.
400 There is a problem with the request. The JSON message describes the problem.
404 The resource that is specified in the request does not exist. The JSON message indicates which resource.
500 An internal error was encountered while the request is processed. The JSON message indicates the problem.

JSON error response format

{"message":"The error message"}