Integrate Your Chatbot

Introduction

You can use Acquire as platform, by creating your own Bot with API endpoint that describe within this document. You can also make your Bot public, by this other people can use your Bot as service. These are few examples that show how Acquire platform will accept the request and give response, from API Endpoint for Bot uses. You can make your own Web API and put that into below popup with given request format.

Screenshots

1. Here you can setup you Bot’s Basic Details:

2. Here you can setup you Bot Interaction API with any dynamic parameters:

About ‘type’ Parameter:

We have various types for parameter ‘type’ like:

1. Request ‘type’ parameter:

  1. init-chat: To initiate the Bot chat.

  2. suggestion: To get the suggestions from Bot.

  3. message: To ask a question to Bot.

  4. more will be added soon(like: button press, etc)

2. Response ‘type’ parameter:

  1. suggestion: It gives few matched questions for suggestion to visitor.

  2. message: It gives the response that generated by the Bot.

  3. quick-replies:If By this type, You can send replies buttons along with response message.

  4. transfer: If Bot stuck in any unanswered situation then it indicates that hat will be transfer to one of executive.

  5. redirect: Useful when you want that your visitor have to redirect any given URL.

  6. card : Under this type, you can show carousel card and browse carousel card in chat widget.

  7. multiple-tasks: Indicates that response data have multiple actions or task.

Single API Endpoint with various example formats:

Example 1. To activate or refresh the Bot:

Here you can see that, we can activate our Bot for that particular session or just we can refresh our Bot when any updation of Bot setting will occur, Bot will retrieve the updated data.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

Body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

init-chat

API Response will be:

{
    "success": true
}

Example 2. To get suggestions from Bot:

This example shows that, if a visitor types a query to the Bot, then this example is helpful to directly select that query from suggestions.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

suggestion

message

how bot

API Response will be:

{
    "success": true,
    "type": "suggestion",
    "data": [
        {
            "id": 1249,
            "question": "how does co browsing work",
            "formatted": "<strong>how</strong> does co browsing work"
        },
        {
            "id": 1251,
            "question": "bot work flow",
            "formatted": "<strong>bot</strong> work flow"
        }
    ]
}

Example 3. To ask a message:

By this example a visitor can simply ask a question and get their response with given format.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

hi

API Response will be:

{
    "success": true,
    "type": "message",
    "data": "Hello there!"
}

Example 4. To ask a message that Bot doesn’t knows:

This example illustrate the condition when Bot have not any response for visitor, that time it gives response that given below. In the response we have two type of data(message, event), Bot gives the message as ‘Sorry, I am still learning...’ and then put a event that ‘Your chat is transferring...’. thenafter one of the executive pick that chat, and interact with that visitor directly.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

do you sell banana

API Response will be:

{
    "success": true,
    "type": "transfer",
    "data": {
        "message": "Sorry, I am still learning and I can not answer this query right now. want 
                            to chat with our one of executive? ",
        "event": "Your chat is transferring with our one of the agents, agent will be with you 
                            shortly..."
    }
}

Example 5. Quick Replies:

Here we can give choices to our visitor. in this section, we pass a bunch of quick replies buttons along with response message. It will show message and buttons on the chat widget, customer can click on that button and bot will get this as a reply.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

I want to buy this

API Response will be:

{
  "success": true,
  "type": 'quick-replies',
  "data": {
      "title": 'Are you sure?'
      "type": 'obj',                       //obj stands for Objectives, FIXED FOR NOW
      "quickReplies": [ 'Yes', 'No', ... ],
  },
}

Example 6. Basic Card:

In Basic Card, you can preview item like an article to your customer with banner, title, subtitle, description & button to redirect URL. By this interactive way, you can share many basic cards to visitors so they can redirect to particular that link.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

show basic cards

API Response will be:

{
  "success": true,
  "type": "cards",
  "data": {
    "id": "basic_card",
    "design": [
        {
        "title": "<Title Here>",
        "subtitle": "<Subtitle Here>",
        "desc": "<Description Here>",
        "imgUrl": "<Image URL Here>",
        "quickReplies": [
          {
            "text": "<Button Title Here>",
            "value": "<Redirect URL Here>"
            }
          ]
        }
     ]
  }
}

In this section, you can give choices to your customer as quick-replies but in a visual format with Title, subtitle, lists of items with the picture. so the customer sees those visuals and it helps in his/her selection and Bot will get this as a reply.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

show cards

API Response will be:

{
  "success": true,
  "type": "cards",
  "data": {
    "id": "carousel_card",
    "design": {
      "title": "<Title Here>",
      "subtitle": "<Subtitle Here>",
      "items": [
        ------ 
        {
          "title": "<Item Title Here>",
          "desc": "<Item Description Here>",
          "imgUrl": "<Image URL Here>",
        },
        ------ 
      ]
    }
  },
}

In this section, you can preview a bunch of items to your customer with title, description, footer, open URL & picture. whenever the customer clicks one of them, it redirects on that URL. it helps customer to explore that item by going on that URL link.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

show cards

API Response will be:

{
  "success": true,
  "type": "cards",
  "data": {
    "id": "browse_carousel_card",
    "design": [
       ------ 
      {
        "title": "<Item Title Here>",
        "desc": "<Item Description Here>",
        "footer": "<Item Footer Here>",
        "openUrl": "<Website link here>",
        "imgUrl": "<Image URL Here>",
      },
      ------ 
    ]
  }
}

Example 8. In case of multiple responses:

When visitor asks a query and we have multiple actions or tasks with that response message then Bot will manage that response like this below example.

POST /bot_interaction

Headers:

Parameter

Type

Content-type

application/x-www-form-urlencoded

body

Parameter

Description

account_id

Account ID on which Bot is running. (Internally managed)

chat_id

Chat ID/Session ID (Internally managed)

type

message

message

describe co browsing

API Response will be:

{
    "success": true,
    "type": "multiple-tasks",
    "data": [
        {
            "type": "message",
            "data": "Co-browsing allows you to see and interact with your customer’s web 
                           screen in real time."
        },
        {
            "type": "redirect",
            "data": {
                "message": "Let me redirect you to the specific page.",
                "link": " https://acquire.io/co-browsing/"
            }
        }
    ]
}

Last updated