Feedback

  • Contents
 

REST API and HTTP Status Codes

The REST API returns one of the following HTTP status codes for any received request:

Status code

Disposition

Description

200 OK

Success

The REST API response message contains a body.

201 Created

Success

The REST API created the requested POST action. The response message may include a Location header.

204 No Content

Success

The REST API completed the request but the response message does not contain a body. This status code is common for POST, PUT, and DELETE actions.

400 Bad Request

Failure

The REST API could not process the content in the body of the request message. An example of this error is an invalid parameter value.

401 Unauthorized

Failure

The REST API could not authenticate the supplied credentials.

404 Not Found

Failure

The resource specified in the REST API request does not exist. An example of this error is an invalid command server ID.

405 Method Not Allowed

Failure

The HTTP method (REST API commands), such as POST, PUT, and DELETE, is not valid for the specified resource.

409 Conflict

Failure

The REST API could not complete the DELETE request of a command server.

500 Internal Server Error

Failure

There is a significant problem on the host computer that prevents the REST API from executing the request.


Note:

Error messages for the 400 and 404 status codes return in the body of the response.

Example:

404 Not Found
{
"status": 404,
"message": "No Command Server with 
 
the ID '8' exists",
"messageWithParams": "No Command 
 
Server with the ID '{@segment}' exists",
"messageParams": {
"segment": "8"
},
"code": "error.restresourcelib.resource.invalid"
}