Authentication
The Botsi API uses apiKey Authentication to secure HTTP requests. You must include your secret key in the Authorization header of every request to identify your application and authorize the call.
The Authorization Header
All requests must include the following headers:
Authorization: {{secret_key}}
Content-Type: application/json
The secret_key can be obtained from the App configuration page in the Botsi dashboard.
Implementation Example
The following example demonstrates how to authenticate a request to the Send Profile Event endpoint using cURL.
Request
curl -X POST "https://app.botsi.com/api/v1/web-api/events" \
-H "Authorization: {{secret_key}}" \
-H "Content-Type: application/json" \
-d '[
{
"eventType": "paywall_shown",
"paywallId": 1,
"placementId": "ai-placement-id",
"isExperiment": true,
"aiPricingModelId": 32,
"profileId": "123-abc",
}
]'
Key Requirements
-
Secure the Key: Your
secret_keycan be found on the App configuration page on the Botsi dashboard. Treat it like a password. -
Content-Type: Ensure you set
-H "Content-Type: application/json", as the Botsi API only accepts JSON payloads. -
HTTPS: Always use
https://to ensure your secret key is encrypted during transit.
Troubleshooting Authentication
If you receive a 401 Unauthorized response, check if the secret_key exactly matches the value in your Botsi App Configuration.