Basic Ocelot API Authentication Flow
This guide describes how to set up authentication for the Ocelot API.
The endpoints use Basic Authentication meaning you need an Authorization
header with your credentials.
Authorization: Basic [credentials]
where [credentials]
is the Base64
encoding of ID (chatbot's UUID) and password (API Key) joined by a single colon :
Authorization: Basic Base64(CHATBOT_UUID:API_Key)
Please refer to the Acquiring credentials section below on how to acquire them.
Prerequisites
This guide assumes that your account has the necessary permissions to access Admin Portal / Integrations / Ocelot API page.
Acquiring credentials
Open the Admin Portal / Integrations / Ocelot API page.
Note: If you don't see "Ocelot API" page in the "Integrations" menu, it's likely that you don't have the necessary permissions. Please contact product support.
The Ocelot API page's Authentication details section displays details required for authentication.
Chabot UUID and API Key will be effectively used as credentials (user and passphrase respectively) to access Ocelot API.
Important: Always keep API Key secure and be careful to not expose it anywhere where it can be visible by other people. In case of accidental leak, contact product support immediately to revoke and re-generate your API Key.
Code example
Use CURL to check the credentials validity.
# The api host.
# Per environment host must be build with pattern
# "https://ai.{the_primary_domain_from_where_you_took_credentials}"
OCELOT_API_HOST=https://ai.ocelotbot.com
CHATBOT_UUID="Your Chabot UUID"
API_KEY="Your API Key"
curl -X POST $OCELOT_API_HOST/api/v1/contact-list \
--data-raw '{"name":"API Test","tags":[]}' \
-H 'Content-Type: application/json' \
-u $CHATBOT_UUID:$API_KEY | jq
The credentials are considered valid if you receive response other than
{
"statusCode": 401,
"message": "Invalid id or api key",
"error": "Unauthorized"
}