Bot Open API (1.0.0)
Download OpenAPI specification:Download
Return auth token for use open api
Request Body schema: application/jsonrequired
appId | string |
appSecret | string |
Responses
Request samples
- Payload
{- "appId": "string",
- "appSecret": "string"
}
Response samples
- 200
- 400
- 409
{- "authToken": "string",
- "expireAt": "string"
}
Returns a bot usage data.
This endpoint allows you to retrieve bot usage data
Authorizations:
query Parameters
monthDate | string Example: monthDate=2021-08-01 specify month of retrieval data |
channelId | integer specify channelId |
Responses
Response samples
- 200
- 401
- 500
{- "totalMessages": 0,
- "totalUsers": 0
}
Returns a list of users.
Authorizations:
query Parameters
page | integer > 1 return requested page |
limit | integer > 25 return number of users |
Request Body schema: application/jsonrequired
channelIds | Array of integers unique Items Enum: 1010 1014 1016 1017 Each channel have unique code. { 1010: 'webchat', 1014: 'whatsapp', 1016: 'telegram', 1017: 'facebook'} |
startDate | string Date must be ISO format string in UTC. |
endDate | string Date must be ISO format string in UTC. |
Responses
Request samples
- Payload
{- "channelIds": [
- 1010
], - "startDate": "2021-10-01T00:00:00.000Z",
- "endDate": "2021-10-02T00:00:00.000Z"
}
Response samples
- 200
- 400
- 401
{- "users": [
- {
- "userId": "string",
- "channelName": "string",
- "userName": "string",
- "createdDate": "string",
- "first interacted date": "string",
- "last interacted date": "string"
}
], - "page": 0,
- "pages": 0,
- "total": 0,
- "limit": 0,
- "hasNextPage": 0
}
Returns a list of transcripts & bot user custom fields.
Authorizations:
query Parameters
page | integer >= 1 Default: 1 number of page to be returned |
limit | integer [ 25 .. 1000 ] Default: 50 number of records to be returned per page |
Request Body schema: application/jsonrequired
botUserId | string Unique bot user identifier according to channel. For 'whatsapp' channel it should be the phone number of bot user |
channelId | integer Enum: 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 Each channel has a unique code. { 1010: 'webchat', 1011: 'workflow', 1012: 'googleBusinessMessages', 1013: 'general', 1014: 'whatsapp', 1015: 'RCSBusinessMessages', 1016: 'telegram', 1017: 'facebook', 1018: 'sms', 1019: 'hangoutsChat', 1020: 'google', 1021: 'instagramMessaging' } |
startDate | string Date must be ISO format string in UTC & must not be older than 3 months from current date. If no startDate is provided data of last 3 months will be returned |
endDate | string Date must be ISO format string in UTC. If no endDate is provided data upto current date & time is returned |
Responses
Request samples
- Payload
{- "botUserId": "+919876543210",
- "channelId": 1014,
- "startDate": "2021-10-02T00:00:00.000Z",
- "endDate": "2021-10-03T00:00:00.000Z"
}
Response samples
- 200
- 400
- 401
{- "botUser": {
- "customFields": { }
}, - "transcripts": [
- {
- "from": "User",
- "type": "text",
- "text": {
- "message": "string",
- "buttons": [
- "string"
], - "isRating": true
}, - "attachment": {
- "contentType": "string",
- "contentUrl": "string"
}, - "card": {
- "title": "string",
- "type": "string",
- "subtitle": "string",
- "image_url": {
- "url": "string"
}, - "buttons": [
- "string"
]
}, - "audio": {
- "url": "string"
}, - "video": {
- "url": "string"
}, - "image": {
- "url": "string"
}, - "pdf": {
- "url": "string"
}, - "location": {
- "longitude": "string",
- "latitude": "string",
- "label": "string",
- "address": "string"
}, - "doc": {
- "url": "string"
}, - "xls": {
- "url": "string"
}, - "ppt": {
- "url": "string"
}, - "contact": {
- "phoneNumber": "string",
- "firstName": "string",
- "lastName": "string",
- "vcard": "string"
}, - "form": {
- "botId": "string",
- "name": "string",
- "isArchived": true,
- "title": "string",
- "description": "string",
- "formElements": [
- {
- "type": "textInput",
- "label": "string",
- "required": true,
- "inputMapping": "string",
- "answerMapping": null,
- "textInput": {
- "validation": "string",
- "placeholder": "string"
}, - "dropdown": {
- "items": [
- "string"
]
}, - "radioButtons": {
- "items": [
- "string"
]
}, - "checkBox": {
- "items": [
- "string"
]
}
}
], - "createdBy": "string"
}, - "carousel": [
- {
- "title": "string",
- "subtitle": "string",
- "image_url": "string",
- "buttons": [
- "string"
]
}
], - "list": {
- "header": {
- "type": "string",
- "text": "string"
}, - "body": "string",
- "footer": "string",
- "actions": {
- "button_text": "string",
- "sections": [
- {
- "title": "string",
- "row": [
- {
- "title": "string",
- " description": "string"
}
]
}
]
}
}, - "reply": {
- "header": {
- "type": "string",
- "text": "string",
- "url": "string"
}, - "body": "string",
- "footer": "string",
- "action": {
- "buttons": [
- {
- "type": "string",
- "title": "string",
- "id": "string"
}
]
}
}, - "order": {
- "catalogId": "string",
- "text": "string",
- "items": [
- {
- "retailerId": "string",
- "quantity": "string",
- "price": "string",
- "currency": "string",
- "title": "string",
- "subTitle": "string",
- "image": "string"
}
]
}, - "formResponse": {
- "formTranscriptId": "string",
- "answerMapping": null
}, - "template": {
- "name": "string",
- "header": {
- "type": "TEXT",
- "url": "string",
- "text": "string",
- "fileName": "string",
- "caption": "string"
}, - "body": "string",
- "footer": "string",
- "buttons": [
- {
- "type": "QUICK_REPLY",
- "text": "string",
- "phoneNumber": "string",
- "url": "string",
- "payload": "string"
}
], - "campaignId": "string"
}, - "productSingle": {
- "isDynamicProduct": true,
- "body": "string",
- "footer": "string",
- "action": {
- "catalogId": "string",
- "retailerId": "string",
- "title": "string",
- "subTitle": "string",
- "image": "string",
- "price": "string"
}
}, - "productMulti": {
- "isDynamicProduct": true,
- "header": {
- "type": "text",
- "text": "string"
}, - "body": "string",
- "footer": "string",
- "action": {
- "catalogId": "string",
- "sections": [
- {
- "title": "string",
- "items": [
- {
- "retailerId": "string",
- "title": "string",
- "subTitle": "string",
- "image": "string",
- "price": "string"
}
]
}
]
}
}, - "dynamicList": {
- "header": {
- "type": "string",
- "text": "string"
}, - "body": "string",
- "footer": "string",
- "actions": {
- "button_text": "string",
- "sections": [
- {
- "title": "string",
- "row": [
- {
- "title": "string",
- "description": "string"
}
]
}
]
}
}, - "dynamicReply": {
- "header": {
- "type": "string",
- "text": "string",
- "url": "string"
}, - "body": "string",
- "footer": "string",
- "actions": {
- "buttons": [
- {
- "type": "string",
- "title": "string"
}
]
}
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "isPreviewUser": true
}
], - "paginationDetails": {
- "page": 0,
- "pages": 0,
- "total": 0,
- "limit": 0
}
}