-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Raml: more information on api errors
- Loading branch information
1 parent
1d6ec01
commit 8779251
Showing
3 changed files
with
29 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
title: API Errors | ||
content: | | ||
When a client or server error occurs, the API always sends a response in the same format: | ||
a JSON object with an `errors` array containing one or more elements. | ||
Each element of the array is an object describing a problem, for example: | ||
```json | ||
{ | ||
"errors": [ | ||
{ | ||
"code": "auth.forbidden", | ||
"message": "You are not authorized to access this resource." | ||
} | ||
] | ||
} | ||
``` | ||
Some of these errors are identified by a `code` property which you can use to identify the problem: | ||
| Code | Problem | | ||
| :--- | :--- | | ||
| `auth.invalidAuthorization` | The authentication failed because the bearer token sent in the `Authorization` header is invalid or has expired. | | ||
| `auth.forbidden` | You have been successfully authenticated, but are not authorized to access the requested resource. Authenticate with a user account that has more privileges. | | ||
| `auth.malformedAuthorization` | The authentication failed because the `Authorization` header does not have the correct format (`Bearer TOKEN`). | | ||
| `auth.missingAuthorization` | The authentication failed because no `Authorization` header was sent. | | ||
| `method.notAllowed` | The resource you tried to access does not support the request's HTTP method. | | ||
| `record.notFound` | The record you tried to retrieve does not exist or you don't have authorization to access it. | | ||
| `resource.notFound` | There is no resource available for this URL and HTTP method. | |