Authenticating on API
1. Get your credentials
The first step to authenticate on the API is to register on the Orbit Codes dashboard.
Navigate to the API page, and click on key rotation to generate a new key.
You will now be able to copy the content of the fields and extract the API Client Key
and the API Client Secret
.
Make sure to keep them safe, as they will be used to authenticate on the API. Client secret won’t be displayed again, and is stored encrypted on the server.
2. Authenticate on the API
Authentication in the API is done by using the API Client Key
and the API Client Secret
in the X-Client-Key
and X-Client-Secret
headers.
Here is an example of how to authenticate on the API using curl
:
If you use the Apollo Client on React, you can authenticate on the API by passing the headers in the HttpLink
:
3. Chose your dataset
The dataset
parameter is used to specify the dataset you want to query. It is a required parameter for all queries.
It represents the chain you want to query, and can be one of the following values:
nim
for the NIM Network chain
Note: we only index the main networks for now, test nets are done on demand.
4. Enjoy the data
You are now authenticated on the API and can start querying the data you need. You can find the available queries and mutations in the API IDE.