Learn about the standard JSON-RPC error codes
HTTP Status Codes
In addition to the standard The Open Network JSON-RPC error codes, TONX API will return the following status codes for HTTP requests:
| Code | Description |
|---|---|
| 200 | OK -- the request is successfully |
| 400 | Bad Request -- Your request is invalid. Double-check your JSON-RPC body. |
| 401 | Unauthorized -- You must authenticate your request with an API key. |
| 403 | Forbidden -- You've use wrong key to query specific network(using testent key to query mainnet data) |
| 429 | Too Many Requests -- You've exceeded your concurrent requests capacity. |
| 500 | internal Server Error -- We're unable to process your request right now. Get in touch with us if you see this. |
| 503 | Service unavailable -- unable to complete the request due to server issues |
JSON-RPC Error Codes
| Code | Possible Return Message | Description |
|---|---|---|
| -32000 | Server error | Reserved for implementation-defined server errors. See note below. |
| -32001 | Data Expired | Data not found. TONX API can query data for limited duration. |
| -32002 | The bag of cells format is incorrect or corrupted. | The bag of cells format is incorrect or corrupted. |
| -32003 | Transaction not found. | Please verify that the request parameters are correct and try again. |
| -32005 | Limit Exceeded | Request limit exceeded. |
| -32007 | Invitation code expired | Invitation code expired |
| -32008 | Invalid Opcode | Opcode is invalid |
| -32600 | Unauthorized Token, etc. | Using unauthorized API keys and other cases. See note below. |
| -32601 | Method not found | The method does not exist/is not available. |
| -32602 | Invalid parameter | Invalid method parameter(s). |
| -32603 | Internal error | Internal JSON-RPC error. |
| -32700 | Parse error | Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text. |
| -40011 | Too Many Requests | You've exceeded your concurrent requests capacity. |
| -50001 | Hex string odd length. Parsing Failed | (TONX Lab) Parsing of the hex string failed due to odd length. |
| -50002 | Invalid boc | (TONX Lab) Boc is invalid |
| -50003 | No matching boc encoding format | (TONX Lab) Boc encoding format does not match |
| -50004 | Hex invalid boc magic header | (TONX Lab) Boc magic header hex is invalid |
| -50005 | Hex checksum not match | (TONX Lab) Hex checksum does not match |
NOTE:
-32000 is used for general server errors
"resource not found case"-32600 is used for many errors about the authentication failed
"Forbidden Access"
"Invalid Request"
"Unauthoized Token"-32603 is used for several errors
"fallback"
"internal error case"
Example Response
{
"jsonrpc":"2.0",
"error":{
"code":-32000,
"message": "Interal Error"
},
"id":1
}
