You may encounter error messages when interacting with Moment's RESTful API. These errors are returned in JSON format inside an error object.
The error
field contains a human-readable description of the error and is subject to change. The error_type
field contains a high-level classification of the error and the optional error_details
field holds an array of human readable errors. The error_details
should not be programmatically processed since its structure and content may change arbitrarily. Use error_type
or the response's status code for programmatic handling.
For example, an error response to GET /v1/data/instrument/
could look like:
{
"error": "Validation Error.",
"error_details": [{
"field": "status",
"message": "This field is required and cannot be empty."
}],
"error_type": "invalid_request"
}
There are currently four API error types:
Error Type | Description |
---|---|
invalid_request | A request was invalid due to incorrect parameters or an authentication issue. |
server_error | An error occurred due to a problem on Moment's servers. |
not_found | The requested resource was not found. |
closed | The requested resource can only be called during a specific time interval. |
In the future, additional error types will be introduced and documented above.