You're browsing the legacy version of the API documentation. Switch to the latest stable version →
User Segment
ChatBot automatically collects all users that chat with the bot and stores their data in the Users section. You can browse this section to find a particular person or a group that meets specified criteria.
Create segment
Creates new segment.
Properties
parameter | type | required | default |
---|---|---|---|
name |
String(1, 256) | required |
Request URL
curl --request POST \
--url https://api.chatbot.com/segments \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json'
Response Example
{
"id": "\<ID\>",
"timestamp": "2018-01-19T11:55:07.552Z",
"status": {
"code": 200,
"type": "success"
}
}
List segments
Returns list of Segments.
Request URL
curl --request GET \
--url https://api.chatbot.com/segments \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}'
Response Example
[
{
"id": "5b7ff8476f7g3fb33c9249a8",
"name": "Foo",
"users": 0,
"createdAt": "2019-01-23 13:32:30.163Z"
}
]
Segment object
parameter | type |
---|---|
id |
String |
name |
String |
users |
Number |
createdAt |
String |
Update segment
Update segment name.
URL Params
Required:
id=[alphanumeric]
Properties
parameter | type | required | default |
---|---|---|---|
name |
String(1, 256) | required |
Request URL
curl --request PUT \
--url https://api.chatbot.com/segments/:id \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json'
Response Example
{
"timestamp": "2018-01-19T11:55:07.552Z",
"status": {
"code": 200,
"type": "success"
}
}
Remove segment
Remove segment.
URL Params
Required:
id=[alphanumeric]
Request URL
curl --request DELETE \
--url https://api.chatbot.com/segments/:id \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json'
Response Example
{
"timestamp": "2018-01-19T11:55:07.552Z",
"status": {
"code": 200,
"type": "success"
}
}
Add members
Adds one or more Users to on or more Segments.
Properties
parameter | type | required |
---|---|---|
segments |
String[1,100] | required |
users |
String[1,1000] | required |
Request URL
curl --request POST \
--url https://api.chatbot.com/segments/members \
--header 'authorization: Bearer ${DEVELOPER_ACCESS_TOKEN}' \
--header 'content-type: application/json'
Response Example
{
"timestamp": "2018-01-19T11:55:07.552Z",
"status": {
"code": 200,
"type": "success"
}
}