Skip to main content

Prompter API

JAICP provides a REST API for integrating prompters into third-party applications — the Prompter API. You can implement prompters into any external platform where your agents take customer requests.

Before using the Prompter API, connect the Prompter API channel to your project.

tip
For more information about the method, request parameters, response formats, returned errors, see the Prompter API specification.

API access token

An access token is configured when creating a channel. It is required for the method provided by the Prompter API.

To obtain an access token, switch to the edit window of the newly created Prompter API channel:

  1. In the toolbar, click Channels.
  2. Select   in the Prompter API channel bar, then Edit channel.
  3. Copy the token.

API method

Send request answers to the agent

The POST /chatapi/webhook/prompter_api/{token} method allows you to send agents the most appropriate answers to customer questions.

The path parameter:

  • token — Prompter API channel token.

Request body parameters:

  • clientInfo is an object with customer information.
    • id is a customer ID.
    • firstName and lastName are a customer’s first and last name. Optional parameters.
  • chatId is a session ID. It is specified on the third-party service side.
  • text is a customer question.

A JSON object will be sent to the webhook:

{
"clientInfo": {
"id": "testClientId"
},
"chatId": "testChatId",
"questionId": "questionId",
"answerOptions": [ // The most appropriate answers. These options are extracted from the intents that passed the classifier threshold.
{
"messages": [
{
"type": "TEXT", // See the specification for other types of messages.
"text": "The answer to a customer question",
"markup": "plain" // Text markup type: plain, html, or markdown.
}
],
"intent": {
"id": 1234, // The ID of the intent where the answer to a customer question was found.
"confidence": 1.0, // The value of the classifier’s confidence in response correctness.
"name": "Intent name",
"path": "/Intent path"
}
}
]
}