To ensure the security and privacy of your data, our API requires authentication for every request. Authentication is performed in two possible ways, one by including an API key in the header of your request and the other requires 3 headers and it will be used if you are trying to integrate a new APP to Darwin.
API Key method
Obtaining Your API Key
Your unique API key is provided directly by the Darwin team. This key acts as a secure access token for your account and should be kept confidential. Do not share your API key publicly or with unauthorized individuals.
If you have not received your API key or have lost it, please contact our support team at [email protected] for assistance.
Using Your API Key
To authenticate your API requests, include your API key in the header of each request using the X-API-KEY field. Here is an example of how to include your API key in a request using cURL:
curl -X GET 'https://api.getdarwin.ai/endpoint' \ -H 'X-API-KEY: YourApiKeyHere'
Replace YourApiKeyHere with your actual API key provided by the Darwin team.
APP Key Method
Obtaining Your APP Key and APP Secret
If you are trying to integrate a new APP to Darwin, you will need to obtain an APP Key and APP Secret. These keys are provided directly by the Darwin team. These keys act as a secure access token for your APP and should be kept confidential. Do not share your APP Key and APP Secret publicly or with unauthorized individuals.
If you have not received your APP Key and APP Secret or have lost them, please contact our support team at [email protected] for assistance.
Using Your APP Key and APP Secret
You will need to send three headers in your request to authenticate your APP requests. These headers are X-APP-KEY, X-SIGNATURE, and X-AGENT-ID. To generate the X-SIGNATURE you will need to use the APP Key, APP Secret, and the payload of the request. Here is an example of how to do that:
const crypto = require('crypto'); const payload = JSON.stringify(request.body); const signature = crypto.createHmac('sha256', 'your_app_secret') .update('your_app_key' + payload) .digest