API Error Messages
When an API request fails due to request errors or server errors, an error response message is returned in JSON format.
An error response message is returned in JSON format even for endpoints that support other MIME types. The error response message includes error message itself, a description of the error, a unique error code for the endpoint, an HTTP response message, and an HTTP response code.
The error response includes following fields:
message: the error message
details: a field for additional information, which may or may not be populated
description: description of the specific error
code: Unique error response code
http_response:
message: HTTP response message
code: HTTP response status code
For example, the following API request attempts to get information about a non-existent reference set that is called “test-set”
https://<host_ip>/api/reference_data/sets/test_set
An HTTP 404
response code and
the following JSON error response message are returned:
{ "message": "test_set does not exist", "details": {}, "description": "The reference set does not exist.", "code": 1002, "http_response": { "message": "We could not find the resource you requested.", "code": 404 } }
The following table provides more information about the HTTP response error categories returned by the JSA REST API:
HTTP error category |
HTTP response Code |
HTTP response message |
---|---|---|
MULTIPLE CHOICES |
300 |
|
MOVED PERMANENTLY |
301 |
|
FOUND |
302 |
|
SEE OTHER |
303 |
|
NOT MODIFIED |
304 |
|
USE PROXY |
305 |
|
TEMPORARY REDIRECT |
307 |
|
BAD REQUEST |
400 |
|
UNAUTHORIZED |
401 |
|
FORBIDDEN |
403 |
|
NOT FOUND |
404 |
|
METHOD NOT ALLOWED |
405 |
|
NOT ACCEPTABLE |
406 |
|
PROXY AUTHENTICATION REQUIRED |
407 |
|
REQUEST TIMEOUT |
408 |
|
CONFLICT |
409 |
|
GONE |
410 |
|
LENGTH REQUIRED |
411 |
|
PRECONDITION FAILED |
412 |
|
REQUEST ENTITY TOO LARGE |
413 |
|
REQUEST-URI TOO LONG |
414 |
|
UNSUPPORTED MEDIA TYPE |
415 |
|
REQUESTED RANGE NOT SATISFIABLE |
416 |
|
EXPECTATION FAILED |
417 |
|
MISSING ARGUMENTS |
419 |
|
INVALID ARGUMENTS |
420 |
|
UNPROCESSABLE ENTITY |
422 |
|
INTERNAL SERVER ERROR |
500 |
|
NOT IMPLEMENTED |
501 |
|
BAD GATEWAY |
502 |
|
SERVICE UNAVAILABLE |
503 |
|
GATEWAY TIMEOUT |
504 |
|
HTTP VERSION NOT SUPPORTED |
505 |
|
INITIALIZATION FAILURE |
550 |
|