Responses
Response Codes
WorkBright uses conventional HTTP status codes to indicate the success or failure of an API request. Additional responses for specific endpoints are noted on their pages.
Code | Status | Description |
---|---|---|
200 | OK | Successful request - everything worked as expected. |
201 | Created | Resource successfully created. |
204 | No Content | Everything worked as expected, and there is no data to return. (This is typically used for DELETE requests or actions which don't require a JSON response.) |
400 | Bad Request | The request was unacceptable, often due to either invalid parameters being provided or a parsing error. |
401 | Unauthorized | Invalid API key. |
404 | Not Found | The requested resource does not exist. |
420 | Request Failed | The parameters were valid, but the request failed. This is typically because some data you provided did not pass validation. Validation error messages are returned via the response body (JSON). |
5xx | Server Errors | Something went wrong on our end. |
Links
JSON objects often include a _links
section, such as the following:
"_links": {
"self": {
"href": "/api/employees/225/employments/225"
},
"employee": {
"href": "/api/employees/225"
}
},
Although we don't follow all of the various HAL conventions, this _links
pattern is loosely based on the HAL JSON API specification. The URI's listed here help clients navigate to various related resources.
Self
The self
link will always indicate the URL for the specific resource itself.
Related Resources
Other than the self
link, related resources may also be listed in the _links
section, such as associations or parent entities.
Updated 4 months ago