An API key is used to authenticate access when making API calls to the Cordial system. The IP address from where you access the API will need to be whitelisted when you create the API key.
Create an API key
1. To create a new API key, navigate to Settings > API Keys.
2. Click New to add an API key.
3. Give the API key a unique name and add the IP address from where you will be accessing the IP.
- To find your IP address, click here.
4. You can add multiple IP addresses for each API key and you can also use CIDR notation (Ex: 0.0.0.0/0).
You can calculate CIDR values for a given IP range (between two IP addresses) using the CIDR to IPv4 Conversion tool and then whitelist those values to account for the entire range.
5. Under API logging, choose whether to Enable or Disable displaying API errors on the Account Monitor page for a specified amount of time.
6. In the Permissions pane, select the API calls the key can access.
7. At the bottom of the page, click Generate Key and the new API key will be created.
Access API keys
1. Once the key is created, you will see it in the API keys list. The list contains censored API keys generated by other account users but you can only view and access API keys generated by your own user account.
As a security recommendation, you will be prompted to generate a new API key for legacy keys that are not owner tracked. Legacy API keys will continue work.
2. To access the API key, click the copy to clipboard icon and copy the key.
3. For API testing, use the API key to access the Cordial API test platform (powered by Swagger). Learn more about using Swagger to access and test the API.
API key rotation
Cordial recommends that you regularly rotate API keys—and structure your tech stack in a way that allows for regular rotation. The general process for rotating an API key is to create a new key, start using the new key, confirm that the old key isn't in use, and then remove the old key.
In the next article, you can learn about account settings.