MyBOT API

1. Introduction

The MyBOT APIs allow you to integrate with the platform and create useful functionality around the platform. The APIs are REST-based using JSON as the standard response type.

2. Authentication

The MyBOT APIs follow basic authentication utilising API Keys to authenticate the API calls. The API Keys can be generated by going to the Integration->MyBOT APIs Settings and creating an app.
The API Keys can be revoked or regenerated at any point in time. Revoked or older keys would throw authentication errors for the API calls made using them.
The API Keys need to be added in the Authorization header as follows –

“Authorization”: “Basic <API Key>”

3. API Endpoints

Following is the list of API endpoints currently supported along with their parameters and sample responses. Customer identifier and bot key details required for the APIs can also be accessed from the Developer Settings section on the portal.

Base URL for the APIs –

3.1 Get matching users

This API will return the list of users matching the set of attribute values as specified.

Sample Curl command

List of required parameters for this API call

Parameter DescriptionType
attribute_nameThe name of the attribute associated with the userString
attribute_valueThe value of the attribute associated with the userString 

Error codes you might get while making the API call.

Error CodesDescription
401Unauthorized
403Forbidden
404Not Found
500Server-side API failure

3.2 Retrieve chat history for a user

This API will return the messages exchanged between the bot and the user, based on the parameters specified.

Using the user id present on the frontend.


/bot-api/v1.0/customer/{customerId}/bot/{botKey}/channel-user/{channeluserId}/conversations

Sample Curl command

Parameters you can pass to filter the API response

ParameterDescriptionType
userId [Path parameter]The user identifier. Retrieved from users list APIString
start_date [Optional]Start Date (UTC time in milliseconds), If blank, all records will be considered.long
end_date [Optional]End Date (UTC time in milliseconds), If blank, current UTC time will be considered.long
page_number [Optional]The number of pages for which the data should be displayed. By default, the first page will be shown.integer
Page_size [Optional]Total number of records to be shown in the API call, the default value is set to 500integer

Error codes you might get while making the API call.

Error CodesDescription
400    Error Code: 1002,    Error Message: INVALID_BOT_OR_CUSTOMER_ID,    Error Details: The bot id/customer id/user id provided is invalid     Error Code: 1003,    Error Message: INVALID_INPUT_DATE_VALUE,    Error Details: The start_date and end_date values are the time in milliseconds and the end_date should be greater than start_date.     Error Code: 1004,    Error Message: INVALID_PAGE_NUMBER,    Error Details: Please enter the correct page number. The page number in the API is a positive integer value starting with 1.
401Unauthorized
403Forbidden
500Server-side API failure

Was this article helpful?

Related Articles

Leave A Comment?