Initiate a chat

Initiate a new chat between your chatbot and your webhook integration. This endpoint returns an identifier for the chat called a conversation ID, which you'll include with all other webhook requests in the same chat. You can also use this conversation ID later to pick up a chat where you left off.

Conversation ID

Each webhook chat has a unique identifier so you can maintain multiple chats from the same integration or pick up where a previous chat left off. For compatibility with other platforms such as Sunshine Conversations, this identifier is called the conversation ID. When working with the webhook API, the conversation ID identifies a specific chat between your chatbot and the webhook integration, not a conversation in the inGenious AI platform.

Request

The webhook integration page contains the base URL to use for all webhook endpoints and the access token to include as a Bearer token in all requests.

Endpoint POST {baseURL}/conversations
Headers Content-Type application/json
Authorization Bearer {AccessToken}
Body
{
  "dispalyName": "New chat",
  "description": "Webhook channel",
  "metadata": {}
}
Optional JSON object defining a display name, description, and additional metadata for the chat.
curl --location 'https://au.api.ingenious.ai/messaging/webhook/v1/{teamId}/{botId}/conversations' \ 
--header 'Content-Type: application/json' \ 
--header 'Authorization: Bearer {accessToken}' \ 
--data '{ 
  "displayName": "New chat", 
  "description": "Webhook chat", 
  "metadata": {}
}'

Response

Response code Description Payload
201 Success

A JSON object with the identifier of the new chat:

{
  "conversation" : {
    "id": "{conversationID}"
  }
}
400 Error. Common causes of errors include an incomplete webhook integration, incorrect or missing authorization headers, or invalid chatbot or team ID in the base URL.
Was this article helpful?
0 out of 0 found this helpful