7shifts uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an error with 7shifts' servers.
Code / status | Description |
---|---|
200 OK | Everything worked |
400 Bad Request | Often missing a required parameter. |
401 Unauthorized | No valid API key provided. |
402 Request failed | Parameters were valid but request failed. |
404 Not found | Often missing a required parameter. |
429 Too Many Requests | You have exceeded the rate limit of 600 requests per minute. If the limit is exceeded you will be blocked for 1 minute. |
500, 502, 503, 504 Server errors | Something went wrong on 7shifts' end. |
The error object
Parameter | Type | Description |
---|---|---|
status | String | Always returns 'error' when an error occurs. |
message | String | A human-friendly message about what type of error occurred. |
error | String | The type of error that occurred. One of the following: missing_parameter unauthorized invalid_id invalid_json save_error delete_error access_denied validation_error missing_header unknown |
Example response
{
"status": "error",
"message": "location_id is required",
"error": "missing_parameter"
}