Bot user
Bot_user - is the specific contact the bot is communicating with.
Get BotUsers
GET
https://app.hightouch.ai/api/bot/bot_users/
Getting the list of bot_user objects
Query Parameters
Name | Type | Description |
---|---|---|
shop_id | integer | Store ID |
search | string | Filter by field: -messenger_user_id -name -id |
Get BotUser
GET
https://app.hightouch.ai/api/bot/bot_users/:id/
Getting the data of the bot_user object
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | Object ID bot_user |
Update BotUser
PATCH
https://app.hightouch.ai/api/bot/bot_users/:id/
Updating the data of the bot_user object and its associated store (e.g., the value of variables)
Path Parameters
Name | Type | Description |
---|---|---|
id | integer | Object ID bot_user |
Query Parameters
Name | Type | Description |
---|---|---|
shop_id | integer | Store ID |
Request Body
Name | Type | Description |
---|---|---|
state | object | User status (object of typr dict) |
lang_code | string | Language code, like ru or en |
name | string | Name of the user |
avatar_url | string | User avatar URL |
messager_user_url | string | User URL in messenger |
store | object | Object store |
Object store
Parameter | Type | Description |
name | string | User name |
phone | string | telepphone |
avatar_url | string | User avatar URL |
subscribe_to_bot | boolean | Whether the user is subscribed to the bot |
tags | array | Tags assigned to the user |
user_vars | object | An object of type dict containing user variables and their values (e.g, {'var1':'some text', 'var2': 15}). |
In order to set the value of a variable, you need to send a request with the following content: { "store": { "user_vars": { "goods":5 } } } This will set the value of the "good" variable to 5.
In order to add a tag, you need to send a request: { "store": { "tags": [{ "id": 13 } ] } }
In order to delete a tag, you need to send a request: { "store": { "tags": [] } }
Create BotUser
POST
https://app.hightouch.ai/api/bot/bot_user/unsafe_create/
Creates an object BotUser
Request Body
Name | Type | Description |
---|---|---|
bot_id | string | Bot ID |
shop_id | string | Store ID |
chat_type | string | Type of thechat: 1 - private 2 - group |
chat_id_in_messenger | string | Chat ID in messenger |
chat_name_in_messenger | string | Name of the chat in messenger |
chat_avatar_in_messenger | string | Chat avatar URL in the messenger |
chat_url_in_messenger | string | Chat URL in the messenger |
bot_user_id_in_messenger | string | User ID in messenger |
bot_user_name_in_messenger | string | User name in messenger |
bot_user_avatar_in_messenger | string | User avatar URL in messenger |
bot_user_url_in_messenger | string | URL of the user in messenger |
subscribe_flow | string | Whether to sign the user to the default script. Default = False |
Last updated