API Reference

Error codes

This section presents JSON-RPC standard error codes and custom error codes that you will encounter when using ZAN node services.

HTTP Status Codes

Status Codes

In addition to the standard Ethereum JSON-RPC error codes, ZAN will return the following status codes for HTTP requests:

codeMeaningCorresponding error codesolution
400Bad Request-32700
-32600
-32601
-32602
Your request is invalid. Double-check your JSON-RPC body.
401Unauthorized-32000You must authenticate your request with an API key. If you do not have one,see Creating your API key on the ZAN platform to create,or requiring a secret key for additional security.
403Forbidden-32002
-32004
-32005
-32006
-32007
You've hit your capacity limit, or your request was rejected by your app's whitelist settings.
429Too Many Requests-32003You've exceeded your concurrent request capacity or Credits per second capacity, see Use limits of credits.
500Internal Server Error-32603
-32008
We're unable to process your request right now. Get in touch with us if you see this.

Example Response

// Example 401 Https Status Error
{
    "error": {
        "code": -32000,
        "message": "apikey check; apikey not exist"
    },
    "id": 1,
    "jsonrpc": "2.0"
}

Standard JSON-RPC Errors

Error Codes

Error CodesMessageMeaning
-32700Parse errorInvalid JSON
-32600Invalid RequestJSON is not a valid request object
-32601Method not foundMethod does not exist
-32602Invalid paramsInvalid method parameters
-32603Internal errorInternal JSON-RPC error

Example Response

{
    "error": {
        "code": -32602,
        "message": "too many arguments, want at most 0"
    },
    "id": 1,
    "jsonrpc": "2.0"
}

Custom JSON-RPC Errors

Error Codes

Error CodesMessageMeaning
-32000UnauthorizedRequest unauthorized
-32001Resource not foundRequested resource not found
-32002Whitelist limitedWhitelist limited
-32003Cu limitedCu limited per second
-32004Rate limitedService rate limited
-32005Limit exceededLimit exceeded credit plan
-32006Malicious requestToo many malicious request
-32007Method limitedMethod request limited
-32008Invalid errorInvalid error

Example Response

// Example 403 Https Status Error
{
    "error": {
        "code": -32005,
        "message": "user credit plan check; credit request service not available, msg:credit consumption has reached the maximum of the package"
    },
    "id": 1,
    "jsonrpc": "2.0"
}