API
You can send messages to your chatbot widget. To do this, you need to perform a POST request to the address: https://api.cavuer.com/messages/generateResponse.
You must add a key to the request Headers: x-cavuer-api-key. As the key value, you must use the API key, which can be created in your personal account in the Profile section (more details in the Getting Started section).
Request parameters:
Parameter | Type | Required | Description |
---|---|---|---|
chatId | string | Yes | Unique chat identifier. For subsequent requests using this identifier messages will be sent to the previously created chat |
text | string | Yes | Message text |
uniqueIdentifier | string | Yes | Chatbot unique identifier. Chatbot widget ID from your personal account |
chatType | string | No | Chat definition. Possible values: "user", "group". Defaults to “user” if parameter is not specified |
participantId | string | if chatType: group | Group member ID |
chatName | string | No | Chat name |
Example request body:
{
"chatId": "1234567890",
"content": {
"text": "Hello. You are use Cavuer AI-bot"
},
"uniqueIdentifier": "CAV36pzjv4qwwlq",
"chatType": "user",
"chatName": "Widget"
}
If the request is successfully completed, you will receive a server response of 200.
Possible errors:
- 400 - the request data is not valid. Correct the error in the request parameters;
- 401 - an incorrect api key is specified in the header, or the key is not specified at all.