Status Codes
When you call any of the Service Catalog and Design REST specifications, the response header returns one of these standard HTTP status codes:
HTTP Status Code | Description |
---|---|
200 OK |
The request was successfully completed. For GET requests, the requested information was found and returned in the response. The updates were successfully completed patch. |
201 Created |
The POST request was successfully completed and the newly-created service specification is returned in the response. |
204 Deleted |
The DELETE request was successfully completed and the service specification was deleted. |
206 Partial Content |
The request was successfully completed and response contains partial data. For GET requests, the requested information was found and returned only paginated data. |
400 Bad Request |
The request couldn't be processed because it includes missing or invalid information, such as an invalid parameter or a missing required value. |
401 Unauthorized |
You aren't authorized to make the request. Your authentication credentials are missing or invalid. |
403 Forbidden |
You aren't authorized to make a request. Check if the user has a role and a Bearer Token. |
404 Not Found |
A requested specification doesn't exist. This code usually appears for GET requests, but it can also appear for DELETE requests. |
500 Internal Server Error |
An internal server occurred. Problem in processing the request in API Layer. |
501 Not Implemented |
The Endpoint is not yet implemented and planned for future release. |
In addition to the standard HTTP codes, the Service Catalog and Design REST API returns detailed error messages for error scenarios.
Error Messages
When a REST request fails, you get an HTTP error response. The response includes a 400-level HTTP status code, an application error code, and an error message that describes the problem.
Each error message includes an application error code and a reason for the error, and may contain the resolution where the error occurred.
For example, you submit a GET request to retrieve a service specification with an ID filter that has missing input value. Because the input value is missing, the request is not valid and the service specification retrieval fails.
In response, you receive an HTTP 400 status error with the following error message, which includes a reason for the failure and more error details.
{ "code": "application error code", "reason": "reason for error", "message": "detailed message for the error with corrective actions", "status": "http error code extension", "referenceError": "url pointing to documentation describing the error", "@type": "type of resource" }
In another example, you submit a POST request to create a service specification in which the server encountered something unexpected that prevented it from completing the request. The service specification creation fails with a generic error message.
In response, you get an HTTP 500 status error with the following error message, which includes a reason for the failure and more error details.
{ "code": "application error code", "reason": "reason for error", "message": "detailed message for the error with corrective actions", "status": "http error code extension", "referenceError": "url pointing to documentation describing the error", "@type": "type of resource" }
All requests to the Service Catalog and Design REST API are treated as atomic transactions. This means that if any action taken as part of a request fails, the whole request fails, any changes already made are rolled back, and an error message is returned in the response body in JSON format.
Resolving Common Errors
The most common types of error are:
Type of Error | Description | Resolution |
---|---|---|
Validation errors | A required parameter is missing, a value isn't supported, a value is in an invalid format, or an unexpected parameter was provided. | Fix the invalid data and resubmit the request. The method descriptions in this document or the Swagger indicate which parameters are required for each method, and the error message guides you to the parameter where the error occurred. |
Specification not found errors | A resource or service specification ID you provided doesn't match anything in the database. | Confirm your resource or service specification IDs and resubmit the request. |
Authentication errors | Your user name or password is incorrect. | Confirm your authentication details and resubmit the request. |
Authorization errors | You aren't authorized to make a request. | Ask your user administrator to grant the missing permissions to your client. |
Internal Server Errors | After input request validation checks are performed in the REST adapter, the API layer processes the request. Errors occurring in the API layer are considered internal server errors.
|
Resubmit the request with the appropriate corrections. |