Setting up an integration is the first step that is required to deploy an Airnode. Here you will capture the required details for your existing API, which will be used to populate the files for deploying an Airnode. See Deployment Files in the Airnode document set for more information.
Select the Integrate menu in the navigation bar on the left side of the page. Then select the Integrate API button. ChainAPI will step-you-through the integration creation.
This section captures high-level details around your API. These details should be helpful to anyone viewing your API and will play a role in the future discovery of your API on ChainAPI. After completing this section click on the Next button.
This field can’t be changed after completing the integration. The reason for this is around backwards compatibility; if you were to update your integration and redeploy your Airnode we don’t want any smart contracts to break.
This is to help developers find your API in future features.
What does your API do?
API Documentation URL
If you have an existing and public documentation, you can enter that link here and this’ll be helpful to developers when they try to connect to your API.
Enter your API Specifications
The base URL to your API operations and the necessary security that Airnode must use when calling the any API operations.
This is the first part of the URL to which all requests are made. The full request URL is made up of two parts: the Base URL and the path. The path is captured as part of each endpoint you add, we will expand on this under New API Endpoint.
Typically, APIs are secured in one way or another. They can be secured by API keys, cookies, and OAuth. After choosing the type of security scheme, you can specify where it will be set, we’ll say in the header, and will give the key a name.
We will never ask for your API key due to security and because ChainAPI never wants to handle your sensitive data. You will be asked to enter your API key when you deploy your Airnode, but that's just between you and your cloud provider. ChainAPI will never see that key.
New API Endpoint
Choose a name for the endpoint. This is how requestors on chain will identify this endpoint. To ensure backwards compatibility on chain, endpoint names can't be edited but the path and method they map to on your API can.
Endpoint names need to be unique within an integration.
Path and Method
Specify the path and method on your API that the endpoint should map to. For method,
POST are supported.
Optionally capture some documentation for this endpoint - summary, description, and an existing external URL.
Airnode works by using a scheme that allows access to your parameters. When a developer tries to access your API, they can only submit parameters that have been allowed by you. So, we need to set those parameters here. You are free to capture as many parameters as the endpoint requires.
The name of the parameter as it is accepted by the API operation request.
Choose where that parameter will be set in the request.
This can be either User Defined, which means that the caller can specify whatever value they would like, or it can be Fixed. For Fixed parameters, we hardcode a value that can't be overwritten by the user.
Similar to the high level details, we can also capture documentation around the parameter. For example, is it required, the description, and the example value.
These are used by Airnode before submitting values back to the blockchain. There are several restrictions around what can be handled on the blockchain and these are configured with the reserved parameters. Read more about reserved parameters.
||Yes||Maps the value in the response to a Solidity data type|
||No||Defines the selection criteria for which values in the response should be sent back to the blockchain|
||No||Multiplies the value from the response by the number specified|
In most cases, you'll want to leave the reserved parameter's value source as User Defined to allow the callers of your Airnode to decide how to store the data on chain.
Use the Fixed value source if you need to control the data that is returned.
Use the None value source if you need an optional reserved parameter to be excluded entirely.
Multiple Reserved Parameters
When using a Fixed value source, you can capture multiple reserved parameters by using comma notation.
For example, you could capture multiple
_type parameters as
You need to provide the same number of values for all reserved parameters that use a Fixed value source.
Read more about multiple reserved parameters on the Airnode documentation.
Advanced features have security implications. Ensure you are familiar with these features and their risks before using them.
Snippets will be run sequentially in the order you capture them in.
There are three settings per snippet:
- Environment - either
Node 14 Async
- Value - the snippet to process
- Timeout - the duration in milliseconds your snippet is allowed to run in
Read more about Pre/Post Processing on the Airnode documentation.
If enabled, responses on the Airnode will be cached and the cached response will be returned for the same request.
Complete the integration by selecting the Finish button.