Skip to main content

Prompter API

The Prompter API allows you to connect prompters to Aimychat or integrate them into third-party applications.

tip
prompter is a bot that joins conversations between customers and agents. It prompts agents with answers to questions, but it does not communicate with customers directly.

To use prompters in Aimychat:

  1. Add the $prompter.pushReply method to the bot script.
  2. Connect the Prompter API channel.
  3. Copy the webhook address and paste it into the Aimychat settings.
tip
To enable Prompter API, contact your account manager or send us a message at client@just-ai.com.

Add the $prompter.pushReply method

The $prompter.pushReply method sends an agent appropriate answers to customers’ questions.

  1. Go to the code editor in JAICP.

  2. Create intents and add a match event to the script or add modules to the knowledge base and connect it to the script so that prompters can use answers from there:

    state: Match
    intentGroup!: /KnowledgeBase
    event!: match
    script:
    $prompter.pushReply();

Connect the Prompter API channel

On the control panel, go to ChannelsInboundConnect channel. Select Prompter API in the Prompters section.

Fill out the fields:

  • Name — specify the channel name.

  • Branch — specify the project branch you want to deploy into the channel (master by default). You can also select a Git tag or enter a specific commit hash.

  • Deployment — select Automatic (whenever any change made to the project is saved) or Manual (using the Deploy button in the channel description line).

    caution
    You have to deploy a script before starting the bot. At this stage, the system builds the bot, checks the script syntax, and performs tests.

Select Create. Once created, the channel editing window will open and new fields will appear:

  • Access token — it is configured automatically when the channel is created.
  • Webhook address — it is used to connect prompters in Aimychat. Copy it.

Use the webhook to connect the API to Aimychat

Go to AimychatSettings section. In the Prompters tab, you can add a prompter and paste the Prompter API webhook.

tip
Learn more about the types of prompters and how to set them up in the Aimychat documentation.