API Definition Error Sets
- Specify different error formats, such as XML or JSON
- Add new error sets and configure them in the dashboard to handle exceptions
- Add the error code, error message, response header, and response body.
Error Set Settings
To add a new Error Set, click the
New Error Set button.
In the
Error Set window, input the following values for the error set.
Field | Description |
---|---|
Error Set Name |
The name of the error set. |
Error Format |
The error format to be returned in the content-type response header for this error set. For example, text/xml, application/JavaScript. |
Enable JSONP Callback Wrapper |
Enable the error return format as JSONP. |
Alternate JSONP Error Format |
The alternative error format for the Traffic Manager to use if the JSONP callback parameter is not configured for an endpoint, and the Return as JSONP option is enabled for the error set. For example, application/JavaScript. |
Error Messages
This page displays the error codes and the error status for the developers to identify why an error is displayed. You can also create new error sets and edit error code status messages.
Code | Description |
---|---|
400 | Bad Request |
403 | Forbidden: Not Authorized |
403 | Forbidden: Account Inactive |
403 | Forbidden: Account Over Queries Per Second Limit |
403 | Forbidden: Account Over Rate Limit |
403 | Forbidden: Invalid Referer |
403 | Forbidden: Rate Limit Exceeded |
403 | Forbidden: Service Requires SSL |
414 | Request-URI Too Long |
502 | Bad Gateway |
503 | Service Unavailable: Scheduled Maintenance |
504 | Gateway Timeout |
400 | Bad Request: Unsupported Parameter |
400 | Bad Request: Unsupported Signature Method |
400 | Bad Request: Missing Required Consumer Key |
400 | Bad Request: Missing Required Request Token |
400 | Bad Request: Missing Required Access Token |
504 | Bad Request: Duplicated OAuth Protocol Parameter |
401 | Unauthorized: Timestamp Is Invalid |
401 | Unauthorized: Invalid Signature |
401 | Unauthorized: Invalid Or Expired Token |
401 | Unauthorized: Invalid Consumer Key |
401 | Unauthorized: Invalid NONCE |
For a full list of generic HTTP error response codes, see Generic HTTP Error Response Codes.
Error Message Settings
Endpoint Error Setting
The Endpoint Error Settings page allows you to configure the endpoint to use one or more error sets for errors delivered from the Mashery platform. You can select the default error set for the endpoint, as configured in the API Definition Error Sets and set the conditions for which alternative error sets are delivered.
Field | Description |
---|---|
Error Set | Defines the default Error Set for the endpoint.
For multiple Error Sets, select the default Error Set list. |
User Controlled Error Format Selection | For multiple Error Sets defined for the API Definition, this option allows you to allow API users to specify alternative error formats.
Select where in the API request call the Traffic Manager should look for an alternative error format request. |
User Controlled Error Format Selection Source | Specify the actual identifier to look for in the API request call along with the name of the corresponding alternative error set to use when that identifier is received in the API request.
For example, in the above image, two Error Sets are defined for the API Definition. One Error Set is called "XML" and the other Error Set is called "JSON" If "XML" is set as the default error set and you would like to allow API users to optionally request the JSON error set by including an Accept header of application/json, you would set the User Controlled Error Format Selection to "Request Header" and include "application/json=JSON" as the User Controlled Error Format Selection Source. |