Access the API
The API Base URL and an access token are required to access the API.Choose the API Base URL
The API Base URL is the endpoint for accessing the Cognigy Live Agent OpenAPI. The table outlines the base URLs for different environments.Environment | API Base URL |
---|---|
Trial | https://liveagent-trial.cognigy.ai |
App | https://liveagent-app.cognigy.ai |
App-US | https://liveagent-app-us.cognigy.ai |
Dedicated SaaS | Use the following pattern https://api-<company-name>.cognigy.cloud/openapi , where company-name is your company name. For example, if your company name is abc123 , the URL would be https://api-abc123.cognigy.cloud/openapi . |
On-premises installations | In your Live Agent values.yaml file, replace live-agent.example.com in host: "live-agent.example.com" with the API URL from your installation. |
Get an Access Token
To use the Live Agent API, you need to get an access token. The token must be passed for each method in the HTTP-Authorization header.- In the bottom-left corner of the Live Agent interface, click your profile icon and select Profile Settings.
- In the Access Token section, copy the token and save it for later use.
Make your First API Request
Create a request to get conversation metadata. Select one of the options to make the request:- cURL
- Postman
- Open your terminal to create a
GET
request: - Replace the following placeholders in request:
- Replace
{api_base_url}
with the base URL of your environment. For example, for the trial environment, useliveagent-trial.cognigy.ai
. - Replace
{account_id}
with your Live Agent account ID. Find the ID in the Live Agent URL. For example, inhttps://liveagent-trial.cognigy.ai/accounts/12345/conversations
, the account ID is12345
. - Replace
your_access_token
with the access token you saved.
- Replace
Troubleshooting
Error 401 (unauthorized)
Error 401 (unauthorized)