Response Codes & Error Codes
A quick reference for the standard HTTP response status codes and JSON-RPC error codes which you may encounter during the development process.
HTTP Response Status Codes
HTTP status codes are three-digit responses from a server to a client request.
These status codes are grouped into 5 different categories:
1xx - Informational Responses
2xx - Successful Responses
3xx - Redirection Messages
4xx - Client Error Responses
5xx - Server Error Responses
Common HTTP Status Codes
Code | Message | Meaning |
---|---|---|
200 | OK | The request succeeded. |
400 | Bad Request | The server cannot or will not process the request due to some client error like incorrect request syntax. |
401 | Unauthorized | The client must authenticate itself to get the request response, this can occur due to an incorrect API Key or Auth token. |
403 | Forbidden | The client doesn't have access rights to the content/service. |
404 | Not Found | The server can not find the requested resource. Coming from an API, it can also mean that the endpoint is correct but the requested resource doesn't exist. |
405 | Method Not Allowed | The request method is known by the server but is not supported by the target resource. |
408 | Request Timeout | A timeout means the server shut down the connection. |
429 | Too Many Requests | The user has sent too many requests in a given amount of time ("rate limiting"). Read more about it in the Quotas and Rate Limits section. |
500 | Internal Server Error | The server has encountered a situation it does not know how to handle. |
501 | Not Implemented | The request method is not supported by the server and cannot be handled. |
502 | Bad Gateway | This error response means that the server, while acting as a gateway, tried to handle the request and got an invalid response. |
503 | Service Unavailable | The server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded. |
504 | Gateway Timeout | This error response is given when the server is acting as a gateway and cannot get a response in time. |
JSON-RPC Error Codes
When you make a request to a server like DataHub, the server will process your request to send back the expected response/result but in case the request does not succeed, the server will send back a response with error result fields.
Error result fields will contain the following information:
code
- A Number that indicates the error type that occurred, (ex.-32600
).message
- A String providing a short description of the error.data
- A Primitive or Structured value that contains additional information about the error. This may be omitted.
Common JSON-RPC Error Codes
For more details about the JSON-RPC error codes and full reference, please see the official JSON-RPC docs
Code | Message | Meaning |
---|---|---|
-32700 | Parse error | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |
-32600 | Invalid Request | The JSON sent is not a valid Request object. |
-32601 | Method not found | The method does not exist / is not available. |
-32602 | Invalid params | Invalid method parameter(s). |
-32603 | Internal error | Internal JSON-RPC error. |
-32000 to -32099 | Server error | Reserved for implementation-defined server-errors. |
Quotas and Rate Limits
Quotas
- A Quota measures how many total requests you can make across all your services in one day.
- If you go over your Quota for the day, you'll need to upgrade your plan.
- The goal of a Quota is to allow customers to pay for what they use, similar to a cell phone plan.
Rate Limits
- A Rate Limit measures how many requests you can make against a specific endpoint in 1 second.
- If you hit a Rate Limit for an endpoint, you'll need to retry your requests.
- The goal of a Rate Limit is to ensure quality of service, and most users will never come close to hitting a Rate Limit.
How Do I Know If I've Hit My Quota?
DataHub will return status code HTTP 429 "Too Many Requests" when you exceed your Quota. To confirm this, you can view your current Quota usage on your DataHub Dashboard.
You can upgrade your plan to increase your Quota.
How Do I Know If I'm Being Rate Limited?
DataHub will return status code HTTP 429 "Too Many Requests" when you are getting rate limited for a specific endpoint.
If this happens, you can confirm on your DataHub Dashboard that you are not over your Quota and that you are instead getting rate limited.
If you are getting rate limited, you will need to retry your requests in your application. Since Rate Limits are measured per second, you could simply wait a few seconds and try again.