Configuration flow

Please note that all endpoints are subject to a 10 seconds timeout

How it works?

A bot gets created when an admin creates a new agent of type “Bot” under the “Automation” section. Several information are required to be able to create a bot:

  • which scenario it can be associated to

  • what is the availability strategy associated to the bot

Provide your bot scenarios to iAdvize

First, you need to implement the GET /external-bots endpoint to list all the scenarios a new bot can be associated to. This route is called by iAdvize during the bot creation process and the result will appear directly in the scenario select picker.

A scenario can only be associated to only one bot operator, which means if you have two bot operators, you need to provide at least two scenarios.

GET /external-bots

Expected response from your API

Example

[
    {
        "idBot": "my_scenario_id_1", 
        "name": "Scenario 1",
        "description": "In this scenario, the bot will ask your customers to provide some data about their orders",
        "editorUrl": "http://your-saas/editor/my_scenario_id_1"
    },
    {
        "idBot": "my_scenario_id_2",
        "name": "In this scenario, the bot will ask your customers to provide some data about their orders",
        "editorUrl": "http://your-saas/editor/my_scenario_id_2"
    }
]

You can validate your response data format with the associated json schema

It will look like this in the UI.

Handle creation and modification of your external bot inside the iAdvize admin

This endpoint is being called when a user finalises the bot creation or when bot information are being updated (such as name, scenario association…).

PUT /bots/:operatorId

Example

{
    "name": "My first bot !",
    "pseudo": "Botty",
    "language": "fr",
    "distributionRules": [
        {
            "id": "ef4670c3-d715-4a21-8226-ed17f354fc44",
            "label": "Distribution rule label"
        }
    ],
    "external": {
        "idBot": "my_scenario_id_1"
    }
}

Expected response from your API

Example

{
    "idOperator": "ha-456678",
    "external": {
        "idBot": "my_scenario_id_1", 
        "name": "Scenario 1",
        "description": "In this scenario, the bot will ask your customers to provide some data about their orders",
        "editorUrl": "http://your-saas/editor/my_scenario_id_1"
    },
    "createdAt": "2017-11-22T12:04:00Z",
    "updatedAt": "2017-11-22T12:04:00Z"
}

Note: You can validate your response data format with the associated json schema.

Provide your external bot details

When an admin wants to edit a bot user, we have to first load the existing information related to this bot. This endpoints allows you do give back those information to iAdvize.

GET /bots/:operatorId

Expected response from your API

Example

{
    "idOperator": "ha-456678",
    "external": {
        "idBot": "my_scenario_id_1", 
        "name": "Scenario 1",
        "description": "In this scenario, the bot will ask your customers to provide some data about their orders",
        "editorUrl": "http://your-saas/editor/my_scenario_id_1"
    },
    "createdAt": "2017-11-22T12:04:00Z",
    "updatedAt": "2017-11-22T12:04:00Z"
}

Define the availability strategy of your external bot

This endpoint will be called on a frequent basis (as of now, every second) and will indicate whether a bot agent is online or not, hence being its availability.

GET /availability-strategies

Expected response from your API

Example 1 : the availability of your bot depends on the availability of another iAdvize routing/distribution rule

In this case, your external bot will be available only if atLeastOne iAdvize distribution rules to check returns true

[
    {
        "strategy": "atLeastOne",
        "distributionRulesToCheck": [
            "ef4670c3-d715-4a21-8226-ed17f354fc44",
            "fab46f63-a61b-4aec-930b-21a438863a6c"
        ]
    }
]

Example 2: always available

In this case, your external bot will still be considered available.

[
    {
        "strategy": "customAvailability",
        "availability": true
    }
]

You can validate your response data format with the associated json schema

Last updated