Skip to content

Instantly share code, notes, and snippets.

@MarkVaughn
Created January 3, 2017 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkVaughn/6d6a86685e19a65edcdf1a689ccc000a to your computer and use it in GitHub Desktop.
Save MarkVaughn/6d6a86685e19a65edcdf1a689ccc000a to your computer and use it in GitHub Desktop.
General
# 2×× - Success
## 200 - OK
Hopefully most your responses
## 202 - Accepted
Used in [/post/api/v1/orders](API-Reference#post-apiv1orders) when the order needs to be confirmed via email verification.
[More](https://httpstatuses.com/202)
>The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place.
## 204 - No Content
Status returned in `DELETE` requests, no json object is returned.
[More](https://httpstatuses.com/204)
>The server has successfully fulfilled the request and that there is no additional content to send in the response payload body.
#4×× Client Error
## 401 - Unauthorized
The user is either logged out or their token has expired.
[More](https://httpstatuses.com/401)
> The request has not been applied because it lacks valid authentication credentials for the target resource.
### Action to take
* Claim a new token from [/post/api/v1/me](API-Reference#get-apiv1me)
* Rerun last command.
* If me does not return a token, delete local storage and direct user to splash page with prompt to log in again.
## 402 - Payment Required
The subscription of the user has either expired or been cancelled.
### Action to take
* Open prompt explaining the situation with link to slapp billing management.
## 403 - Forbidden
Usually caused when user tries to access a resource that does not belong to them.
[More](https://httpstatuses.com/403)
>The server understood the request but refuses to authorize it.
### Action to take
* Red warning, saying you don't have permissions to do this.
## 404 - Not Found
A resource is not there, a campaign page has been deactivated.
[More](https://httpstatuses.com/404)
>The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
### Action to take
* A custom page relevant to merchants if route is on promote.sellerlabs.com
* A custom page relevant to consumers if route is on the public page mydeals.com/mypromotion
* If a requested resource is 404 Stop actions open modal?
## 405 - Method Not Allowed
Meaning the route exists but the method logic for the method is not defined.
### Action to take
* Generic Something went wrong message.
* Double check with backend team you need this endpoint to work for this method.
## 422 - Unprocessable Entity
Always returned when validation fails.
### Action to take
- Render all field validation error messages.
## 429 - Too Many Requests
We have a rate limiter, kicks in if there are over 60 requests per second for a given user.
### Action to take
* Pop up with a warning and a countdown of 60 seconds
* When it reaches 0 re-run last request.
# 5×× Server Error
## 500 - Internal Server Error
Very bad, logged to bugsnag, needs backend attention.
### Action to take
* Alert backend team.
## 502 - Bad Gateway
### Action to take
* Alert systems team.
## 503 - Service Unavailable
### Action to take
* Alert systems team.
## 504 - Gateway Timeout
### Action to take
* Alert systems team.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment