Send requests

This section covers how to use your API key to access Proteus Shield services.

Use Your API Key

There are several ways to include your API key in your requests:

  • Using the Authorization header: "Authorization: Bearer API_KEY"

curl https://api.node.glif.io/rpc/v1 \
  -X POST \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer API_KEY" \
  -d '{
        "jsonrpc": "2.0",
        "method": "Filecoin.EthChainId",
        "params": [],
        "id": 1
      }'
  • Using the token query parameter: ?token=API_KEY

curl https://api.node.glif.io/rpc/v1?token=API_KEY \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{
        "jsonrpc": "2.0",
        "method": "Filecoin.EthChainId",
        "params": [],
        "id": 1
      }'

Warning: The ways to include your API token described above apply to the Filecoin network but may not apply to other supported blockchains. Please refer to the specific documentation for the chain you are using.

Troubleshooting

There are a few things to keep in mind when sending requests to Proteus Shield:

  • If you are using the token query parameter, make sure to URL encode the API key.

  • If you are getting a 401 error, make sure you are using the correct API key.

  • If you are getting a 429 error, you've reached your rate limit. Wait for the next minute or hour and try again, or upgrade your subscription to increase your rate limit. Refer to the Subscriptions page for more information.

  • If you are getting a 500 error, it could be a server error. Please try again later or contact us for further assistance. In the meantime, you can try using a different API key.

Last updated