CRM Product API
# CRM Product API
# API Declaration
The "token" param must be contained in the header of the https request when calling the API.
Token is the only global API call credential for the Sobot API open platform. It is used when developers call the business APIs and thus should be properly kept. At least 32 chars should be reserved to store token. The validity period of token is currently 24 hours. It needs to be refreshed regularly or reacquired according to the token failure prompt returned by the API. When requesting the token API, regardless of the existence of token, a new token will be returned and its expiry time will be reset (currently 24 hours).
Token usage description:
- Developers need to obtain and manage the token uniformly. When calling the Sobot open APIs of various business, they should use the same token, instead of refreshing and obtaining new tokens for each business. Otherwise, it will easily lead to token invalidation and affect the normal API call.
- The current validity period of the token is transmitted by the returned expire_in, which is currently a value within 86,400 s. Developers need to refresh the new token in advance based on this valid time.
- Developers should reacquire the token according to the token invalidation prompt returned by the API.
# i18n Declaration
If the prompt text of the corresponding language needs to be returned when calling the API, the "language" parameter must be contained in the header of the https request.
Currently, it supports text in both Chinese (zh) and English (en), with Chinese being the default.
request headers:
Param | Type | Required | Description |
---|---|---|---|
language | String | Yes | Language identifiers: en-English, zh-Chinese |
# API Call
# ● Get the Access Token Code
API description:
Get the open API token, which is only applicable to all APIs of Sobot Open Platform v5.0. Contact the Sobot after-sales service personnel to get appid and app_key in the API.
Request method:
GET
Request URL:
https://sg.sobot.io/api/get_token
Request param:
Param | Type | Required | Description |
---|---|---|---|
appid | String | Yes | API credential id, the unique API call credential id for the 3rd-party users |
create_time | String | Yes | Timestamp (s), e.g.: timestamp 1569397773 for 2019-09-25 15:49:33 |
sign | String | Yes | Signature, which is md5(appid+create_time+app_key) sign signature; app_key is a key |
Request example:
curl https://sg.sobot.io/api/get_token?appid=1&create_time=1569397773&sign=258eec3118705112b2c53dc8043d4d34
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
item | Object | No | Return object |
Item object:
Param | Type | Required | Description |
---|---|---|---|
token | String | Yes | Token code |
expires_in | String | Yes | Credential valid time (unit: s) |
Timestamp conversion tool:
https://www.unixtimestamp.com/
sign Signature generation example:
E.g., appid = "1"; create_time="1569397773"; app_key="2"
sign = Md5("115693977732") is 258eec3118705112b2c53dc8043d4d34.
Return example:
{
"item": {
"token": "4ac37cb2e9c740dba4b75a34d5358802",
"expires_in": "86400"
},
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
# ● Search Time Zone
API description:
Search all time zones
Request URL:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user/get_timezone
Request param:
Param | Type | Required | Description |
---|---|---|---|
language | String | Yes | Language identification zh-Chinese en-English |
Request example:
curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://sg.sobot.io/api/scrm/5/user/get_timezone
?language=zh
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
items | String | Yes | List of time zones |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Primary key |
language | String | Yes | Language |
timezone_value | Integer | Yes | Time zone value |
timezoneid | String | Yes | Time zone ID |
Return example:
{
"items": [
{
"id": "aa08a602e63d4d188f52b0809e6794b0",
"language": "zh",
"timezone_value": "GMT-11:00 American Samoa",
"timezoneid": "US/Samoa"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
# ● Search language
API description:
Search all languages
Request URL:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user/get_language
Request param:
Param | Type | Required | Description |
---|---|---|---|
language | String | Yes | Language identification zh-Chinese en-English |
Request example:
curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://sg.sobot.io/api/scrm/5/user/get_language
?language=zh
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
items | String | Yes | Lists of languages |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Primary key |
language | String | Yes | Language |
language_value | Integer | Yes | Language value |
language_code | String | Yes | language identification |
Return example:
{
"items": [
{
"id": "aa08a602e63d4d188f52b0809e6794b0",
"language": "zh",
"language_value": "Simplified Chinese",
"language_code": "zh"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
# ● Search country
API description:
Search all countries
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user/get_country
Request param:
Param | Type | Required | Description |
---|---|---|---|
language | String | Yes | Language identification zh-Chinese en-English |
Request example:
curl -H 'token:4ac37cb2e9c740dba4b75a34d5358802' https://sg.sobot.io/api/scrm/5/user/get_country
?language=zh
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
items | String | Yes | List of countries |
Items set:
Param | Type | Required | Description |
---|---|---|---|
countryid | String | Yes | Country ID |
country_name | String | Yes | Country Name |
Return example:
{
"items": [
{
"countryid": "101",
"country_name": "China"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
# ● Query multilingual content detail
API description:
Query multilingual content details
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/get_multilingual_content_detail
Request param:
Param | Type | Required | Description |
---|---|---|---|
lang_type | List | No | The language type list of the multilingual content that needs to be returned |
placeholder | String | Yes | Multilingual content placeholder |
rich_text_flag | Integer | No | Determine whether to filter rich text based on this identifier ( 1: No filtering, return rich text. 0: Filter rich text. default is 0) |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/get_multilingual_content_detail -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
-d '{"placeholder":"{dc_test}","lang_type":["zh","en"]}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
companyid | String | Yes | Company ID |
catalogid | String | Yes | Category ID |
placeholderid | String | Yes | Multilingual content placeholder ID |
name | String | Yes | Multilingual content name |
placeholder | String | Yes | Multilingual content placeholder |
default_value | String | Yes | Multilingual content defaults |
update_time | Long | Yes | Update time |
create_time | Long | Yes | Creation time |
status | Integer | Yes | Status: 1-Normal, -1-Deleted |
lang_list | List | Yes | Multilingual content supports multiple languages and language codes |
Lang_list:
Param | Type | Required | Description |
---|---|---|---|
lang_type | String | Yes | Language Type Code |
lang_value | String | Yes | Corresponding translation |
Return example:
{
"item": {
"lang_list": [
{
"lang_value": "The Chinese",
"lang_type": "zh"
},
{
"lang_value": "The English",
"lang_type": "en"
}
],
"companyid": "061b091ac088473484d4b66a7123test",
"update_time": 1736428321879,
"catalogid": "0502746dec8b475fa5e9620ca101test",
"placeholderid": "186cd24451034864ad57bf23d484test",
"create_time": 1736425468700,
"name": "Sample",
"default_value": "Sample",
"placeholder": "{dc_test}",
"status": -1
},
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# ● Create Tag Group Info
API description:
Create tag groups based on input info (only business tags are available).
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label_group/save
Request param:
Param | Type | Required | Description |
---|---|---|---|
name | String | Yes | Tag group name |
color_value | String | Yes | Color value of tag group |
is_multiple_choice | Integer | Yes | Whether to allow multiple selections (0: not allow, 1: allow) |
label_list | List | Yes | Tag |
Request example:
curl https://sg.sobot.io/api/scrm/5/label_group/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"name":"test","color_value":"#345454","is_multiple_choice":1,"label_list":[{"name":"label1"}]}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
item | String | Yes | Tag group id |
Return example:
{
"item": "221542acc9cb4e259530719eb1de21c2",
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
# ● Edit Tag Group Info
API description:
Edit tag group info based on tag group id (only business tags are available)
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label_group/update
Request param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag group id |
name | String | Yes | Tag name |
color_value | String | No | Color value of tag group |
is_multiple_choice | Integer | No | Whether to allow multiple selections (0: not allow, 1: allow) |
Request example:
curl https://sg.sobot.io/api/scrm/5/label_group/update -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' -d '{"id":"221542acc9cb4e259530719eb1de21c2 ","name":"test123","color_value":"#23432"}'
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Query Tag Group List
API description:
Query all tag info (only business tags are available)
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/label_group/list
Request param:
Param | Type | Required | Description |
---|---|---|---|
page_no | Integer | Yes | Current page (start from the first page by default) |
page_size | Integer | Yes | Pieces on each page (100 by default) |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/5/label_group/list
?page_no=1&page_size=100
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
items | List | No | Object list |
page_count | Integer | Yes | Total pages |
page_no | Integer | Yes | Current page |
page_size | Integer | Yes | Pieces on each page |
total_count | Integer | Yes | Total pieces |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag group id |
bizid | String | Yes | Business id |
type | Integer | Yes | Business type of tag group (0: visitor, 1: customer, 2: ticket) |
name | String | Yes | Tag group name |
color_value | String | No | Color value of tag group |
is_multiple_choice | Integer | No | Whether to allow multiple selections (0: not allow, 1: allow) |
status | Integer | No | Status (-1: deleted, 0: invalid, 1: valid) |
create_time | String | No | Creation Time |
update_time | String | No | Update Time |
create_time_ms | Long | No | Creation Time, e.g.: 1678085323404 |
update_time_ms | Long | No | Update Time, e.g.: 1678085323404 |
Return example:
{
"items": [
{
"id": "aa08a602e63d4d188f52b0809e6794b0",
"name": "test32",
"status": 1,
"type": 1,
"bizid": null,
"color_value": "#gt5433",
"create_time": "2021-07-14 05 :00: 00",
"create_time_ms": 1678085323404,
"is_multiple_choice": 0,
"update_time": "2021-07-14 05 :00: 00",
"update_time_ms": 1678085323404
},
{
"id": "764ff9fd2e094c0cb1c7d2a69beb1593",
"name": "test111",
"status": 1,
"type": 1,
"bizid": null,
"color_value": "#gt54323",
"create_time": "2021-07-14 05 :38: 13",
"create_time_ms": 1678085323404,
"is_multiple_choice": 0,
"update_time": "2021-07-14 05 :38: 13",
"update_time_ms": 1678085323404
}
],
"page_no": 1,
"page_count": 2,
"total_count": 4,
"page_size": 3,
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ● Delete Tag Group Info
API description:
Delete tag group info based on tag id and delete all tag info under the group (only business tags are available)
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/label_group/remove
Request param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag group id |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/5/label_group/remove/221542acc9cb4e259530719eb1de21c2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Create Tag Info
API description:
Create tag info (only business tags are available)
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label/save
Request param:
Param | Type | Required | Description |
---|---|---|---|
name | String | Yes | Tag name |
groupid | String | Yes | Tag group id |
param_name | String | No | Tag param name |
Request example:
curl https://sg.sobot.io/api/scrm/5/label/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"name":"test","groupId":"46a2cd4c9321452eaadc1d0892ca58cd"}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Edit Tag Info
API description:
Edit tag info based on tag id (only business tags are available)
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label/update
Request param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag ID |
name | String | Yes | Tag name |
param_name | String | No | Tag param name |
Request example:
curl https://sg.sobot.io/api/scrm/5/lable/update -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"id":"f72aa19d0ecd414eaa4863cc9964b3f0","name":"test"}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Query Tag List
API description:
Query tag info list (only business tags are available)
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/label/list
Request param:
Param | Type | Required | Description |
---|---|---|---|
groupid | String | Yes | Tag group id |
page_no | Integer | Yes | Current page (start from the first page by default) |
page_size | Integer | Yes | Pieces on each page (100 by default) |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/5/lable/list
?groupid=8b7b3cede2c34c81a61001431fcd4529&page_no=1&page_size=100
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
items | List | No | Object list |
page_count | Integer | Yes | Total pages |
page_no | Integer | Yes | Current page |
page_size | Integer | Yes | Pieces on each page |
total_count | Integer | Yes | Total pieces |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag group id |
groupid | String | Yes | Tag group id |
bizid | String | Yes | Business id |
name | String | Yes | Tag name |
create_time | String | Yes | Creation Time |
create_time_ms | Long | Yes | Creation Time, e.g.: 1678085323404 |
param_name | String | No | Tag param name |
update_time | String | Yes | Update Time |
update_time_ms | Long | Yes | Update Time, e.g.: 1678085323404 |
status | Integer | Yes | Status (-1: deleted, 0: invalid, 1: valid) |
Return example:
{
"items": [
{
"id": "8e842b52a028445cbeb593dc48f69fa9",
"name": "labelGroup",
"status": 1,
"bizid": null,
"create_time": "2021-07-14 12 :17: 10",
"create_time_ms": 1678085323404,
"param_name": null,
"groupid": "164783fc76bc4b25b204dd22fa5a9927",
"update_time": "2021-07-14 12:17:10",
"update_time_ms": 1678085323404
}
],
"page_no": 1,
"page_count": 1,
"total_count": 1,
"page_size": 3,
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# ● Delete Tag Info
API description:
Delete tag info based on tag id (only business tags are available)
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/label/remove
Request param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag ID |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/5/lable/remove/221542acc9cb4e259530719eb1de21c2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Query Customer Tags in Batch
API description:
Query the existing customer tags in batch (only business tags are available)
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label/userlabels
Request param:
Param | Type | Required | Description |
---|---|---|---|
ids | List | Yes | Customer id set |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/5/label/userlabels '["aead252a1e754e4f9eb1b6b7bf3ae7f7","aead252a1e754e4f9eb1b6b7bf3ae7f7"]'
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
items | List | Yes | Object list |
Items set:
Param | Type | Required | Description |
---|---|---|---|
userid | String | Yes | Customer ID |
label_set | List | Yes | Tag set |
label_set set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag ID |
name | String | Yes | Tag name |
color_value | String | Yes | Color |
Return example:
{
"items": [
{
"userid": "aead252a1e754e4f9eb1b6b7bf3ae7f7",
"label_set": [
{
"id": "830a1b02574643c78b0177a066f32ab6",
"name": "label1",
"color_value": "#76A6F1"
},
{
"id": "62e10d5fa3534cfb97807d956db1a558",
"name": "label2",
"color_value": "#15C7C9"
}
]
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# ● Modify Customer Tag
API description:
Modify customer tags (only business tags are available)
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label/update_userlabel/{id}
Request param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Customer ID |
list | List | Yes | Tag set |
list set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Tag ID |
name | String | Yes | Tag name |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/5/lable/update_userlabel/aead252a1e754e4f9eb1b6b7bf3ae7f7 '[{{"name": "label1","id":"ffb02e1d3bee47d291e72ad7d5a46ab5"},{"name":"label2","id":"62847ed717114db6838cc94b60ac3d8e"}]'
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Tag the Business
API description:
Tag the business based on passed customer id.
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/label/update_biz_label
Request param:
Param | Type | Required | Description |
---|---|---|---|
userid | String | No | Customer id (userid, unionid and external_userid cannot be concurrently blank) |
unionid | String | No | unionid |
external_userid | String | No | External contact userid |
add_tag | List | No | Tag id set to be tagged (add_tag and remove_tag cannot be both blank) |
remove_tag | List | No | Tag id set to be removed |
Request example:
curl -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' https://sg.sobot.io/api/scrm/ 5 /lable/update_biz_label '{"userid": "9616577c98f045e2a02b314708a8251d","add_tag":["9616577c98f045e2a02b314708a8251d","9616577c98f045e2a02b314708a8251d"]}'
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Create Customer
API description:
Create Customer
The system will identify the customer based on the unique customer identification sign (CRM/settings/customer unique identification rules) configured with the incoming telephone, email, etc. Once the customer is identified, it will be updated (crm_status, liable_serviceid, and liable_service_name will not be updated). If not identified, the customer will be created
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/save
Request param:
Param | Type | Required | Description |
---|---|---|---|
nick | String | Yes | Customer nickname (50 chars max) |
uname | String | No | Real name (50 chars max) |
String | No | ||
tel | String | No | Telephone |
String | No | QQ number | |
wx | String | No | WeChat ID |
partnerid | String | No | Docking ID |
sex | Ingeter | No | Gender (1: male, 2: female) |
crm_status | Ingeter | Yes | Customer status (1: 1st Inquiry, 2: to-be-assigned, 3: follow-up, 4: customer pool) |
liable_serviceid | String | No | Agent id (when customer status is follow-up, the field is required) |
liable_service_name | String | No | Agent name |
countryid | String | No | Country id |
proviceid | String | No | Province id |
provice_name | String | No | Province name |
cityid | String | No | City id |
city_name | String | No | City name |
areaid | String | No | District id |
area_name | String | No | District name |
remark | String | No | Note |
enterpriseid | String | No | Enterprise id (different from company id) |
enterprise_name | String | No | Enterprise name |
is_vip | String | No | Customer level (0: general, 1: vip) |
ex_field_str | String | No | Customer custom-extension field |
wx_build_unionid | String | No | Wechat unionId of customer - self-built app |
visitorids | String | No | Visitor ID |
wx_external_userids | list | No | Wechat ExternaUserid |
wx_unionids | list | No | Wechat UnionID |
wx_openids | list | No | Wechat OpenID |
whatsappids | list | No | WhatsApp ID |
faceBookids | list | No | FaceBook ID |
instagramids | list | No | Instagram ID |
lineids | list | No | Line Id |
telegramids | list | No | Telegram ID |
discordids | list | No | Discord ID |
timezoneid | String | No | Time zone ID |
language | String | No | Language identification |
ex_field_str:
Param | Type | Required | Description |
---|---|---|---|
fieldid | String | No | Custom field id (When the field type is drop-down option, fieldid and field_params can be passed in as either) |
field_value | String | Yes | Custom field value (When the field type is drop-down, multi-selection, or cascade, it refers to the field option value set) |
field_params | String | No | Param name |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{
"nick": "test20210906005",
"uname": "stedfss",
"email": "234468554@qq.com",
"tel": "13214599999",
"crm_status":2,
"ex_field_str":"[{\"fieldid\":\"5445245507ab48b68769093bd413a5c8\",\"field_value\":\"130434199909099898\"},{\"fieldid\":\"e9b7010584114145a99d3566ace22e4b\",\"field_value\":\"2021\"},{\"fieldid\":\"de4b8e9271c64b4f95035442e2003681\",\"field_value\":\"628767337948969,628767337951618,628767337953718\"}]"
}'
2
3
4
5
6
7
8
9
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
data | Object | Yes | Customer ID |
action | String | Yes | Operation Flag; add-Add new customer, update-Edit customer |
Return example:
{
"data": {
"userid": "786e7ff2c3904c90bf1f19ea547d645c"
},
"ret_code": "000000",
"ret_msg": "Success",
"action": "add"
}
2
3
4
5
6
7
8
# ● Edit Customer Info
API description:
Edit customer information
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/update/{id}
Request param:
Param | Type | Required | Description |
---|---|---|---|
nick | String | Yes | Customer nickname (50 chars max) |
uname | String | No | Real name (50 chars max) |
visitorids | String | No | Visitor ID |
partnerid | String | No | Docking ID |
String | No | ||
tel | String | No | Telephone |
String | No | QQ number | |
wx | String | No | WeChat ID |
sex | Ingeter | No | Gender (1: male, 2: female) |
liable_serviceid | String | No | Agent id (when customer status is follow-up, the field is required) |
liable_service_name | String | No | Agent name |
countryid | String | No | Country id |
proviceid | String | No | Province id |
provice_name | String | No | Province name |
cityid | String | No | City id |
city_name | String | No | City name |
areaid | String | No | District id |
area_name | String | No | District name |
remark | String | No | Note |
enterpriseid | String | No | Enterprise id (different from company id) |
enterprise_name | String | No | Enterprise name |
is_vip | String | No | Customer level (0: general, 1: vip) |
vip_level | String | No | VIP level (a fixed field, which can be defined by user through drop-down list) |
upset_ex_field_str | Int | No | Whether to update the user’s custom fields by upsert? 0: No (update by full overwriting, by default) 1: Yes (update the fields passed) |
ex_field_str | String | No | Customer custom-extension field |
wx_build_unionid | String | No | Wechat unionId of customer - self-built app |
wx_external_userids | list | No | Wechat ExternaUserid |
wx_unionids | list | No | Wechat UnionID |
wx_openids | list | No | Wechat OpenID |
whatsappids | list | No | WhatsApp ID |
faceBookids | list | No | FaceBook ID |
instagramids | list | No | Instagram ID |
lineids | list | No | Line Id |
telegramids | list | No | Telegram ID |
discordids | list | No | Discord ID |
timezoneid | String | No | Time zone ID |
language | String | No | Language identification |
ex_field_str:
Param | Type | Required | Description |
---|---|---|---|
fieldid | String | No | Custom field id (when the field type is drop-down option, fieldid and field_params can be passed in as either) |
field_value | String | Yes | Custom field value (When the field type is drop-down, multi-selection, or cascade, it refers to the field option value set) |
field_params | String | No | Param name |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/update/6bbe358da6534bb190c22fe3e2278c48 -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{
"id": "786e7ff2c3904c90bf1f19ea547d645c",
"nick": "test20210906005",
"uname": "stedfss",
"email": "234468554@qq.com",
"tel": "13214599999",
"crm_status":2,
"ex_field_str":"[{\"fieldid\":\"5445245507ab48b68769093bd413a5c8\",\"field_value\":\"130434199909099898\"},{\"fieldid\":\"e9b7010584114145a99d3566ace22e4b\",\"field_value\":\"2021\"},{\"fieldid\":\"de4b8e9271c64b4f95035442e2003681\",\"field_value\":\"628767337948969,628767337951618,628767337953718\"}]"
}'
2
3
4
5
6
7
8
9
10
Return param:
Param | Type | Required | Name |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Create Enterprise
API description:
Create Enterprise
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/enterprise/save
Request param:
Param | Type | Required | Description |
---|---|---|---|
enterprise_name | String | Yes | Enterprise name |
proviceid | String | No | Province id |
provice_name | String | No | Province name |
cityid | String | No | City id |
city_name | String | No | City name |
areaid | String | No | District id |
area_name | String | No | District name |
enterprise_domains | List | No | Enterprise domain |
extend_fields | List | No | Enterprise custom-extension field |
extend_fields:
Param | Type | Required | Description |
---|---|---|---|
fieldid | String | No | Custom field id (when the field type is drop-down option, fieldid and field_params can be passed in as either) |
field_value | String | Yes | Custom field value (When the field type is drop-down, multi-selection, or cascade, it refers to the field option value set) |
field_params | String | No | Param name |
Request example:
curl https://sg.sobot.io/api/scrm/5/enterprise/save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{
"enterprise_name": "test20210906005",
"enterprise_domains":["sobot.io"],
"extend_fields":[{"fieldid":"5445245507ab48b68769093bd413a5a8","field_value":"130434199909099998"},{"fieldid":"e9b7010584114145a99d3566ace22a4b","field_value":"2023"},{"fieldid":"de4b8e9271c64b4f95035442e2103681","field_value":"628767337948966,628767337951628"}]
}'
2
3
4
5
6
Return param:
Param | Type | Required | Name |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
item | String | Yes | Enterprise ID |
Return example:
{
"item": "101df35399344a71a32cef0cb0afe268",
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
# ● Assign Customer
API description:
Assign customer
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/public_user/assign
Request param:
Param | Type | Required | Description |
---|---|---|---|
confirmids | String | Yes | Customer id (separated by ",", e.g.: "12345,54321") |
liable_list | List | Yes | Agent list |
assign_biz_type | String | Yes | Assign business type (1: To-be-assigned customer - Assign customer; 2: Customer in customer pool - Assign customer; 3: Customer in customer pool - Receive customer, 4: My customer - Assign customer, 5: Following up - Modify agent info) |
liable_list set:
Param | Type | Required | Description |
---|---|---|---|
liable_serviceid | String | Yes | Responsible Person(s) |
liable_service_name | String | Yes | Agent name |
liable_departmentid | String | No | Agent department (data permission) |
Request example:
curl https://sg.sobot.io/api/scrm/5/label_group/draw -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"assign_biz_type":"1","confirmids":"b9f009ea6440439c987a31b79fb8abe1","liable_list":[{"liable_departmentid":"60b7e31daf15417aa0f521aa7d822ddd|bab2c1b0a95248e4bf30ef1c2bf36946","liable_serviceid":"b9f009ea6440439c987a31b79fb8abe1","liable_service_name": "name"}]}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Recycle to Customer Pool
API description:
Recycle to customer pool
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/public_user/confirm
Request param:
Param | Type | Required | Description |
---|---|---|---|
confirmids | String | Yes | Customer id (separated by ",", e.g.: "12345,54321") |
confirm_type | Integer | Yes | Confirm customer type (1: valid, 2: invalid) |
Request example:
curl https://sg.sobot.io/api/scrm/5/label_group/draw -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"confirmids":"b9f009ea6440439c987a31b79fb8abe1","confirm_type": 1 }'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Query Customer List
API description:
Query customer list
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user/list_by_page
Request param:
Param | Type | Required | Description |
---|---|---|---|
search_type | String | No | Query type (1: customer nickname, 2: real name, 3: company, 4:phone no., 5: email) |
search_value | String | No | Query content |
wx_build_unionId | String | No | Wechat unionId of customer - self-built app |
stageid | String | No | Follow-up stage id |
create_start_time | String | No | Creation start time (s) |
create_end_time | String | No | Creation end time (s) |
user_label | List | No | Tag (business tag id or WeCom tag id is available) |
isblack | String | No | Blacklisted or not (1: Yes, 0: No) |
module_type | String | No | Module category (1: All customers (default), 2: New customer list, 3: To-be-assigned customer list, 4: Follow-up customer list, 5: Pool customer list, 6: List of my customers) |
external_userid | String | No | External contact id of WeCom |
development_mode | Integer | No | Development mode (1: 3rd-party development, 2: Self-built application agent development. 3rd-part development is chosen by default, and if the self-built application agent development is not installed, 3rd-party data will be returned even when 2 is selected) |
update_start_time | String | No | Update start time (s) |
update_end_time | String | No | Update end time (s) |
liable_serviceid | String | No | Agent ID |
page_no | Integer | Yes | Current page (start from the first page by default) |
page_size | Integer | Yes | Pieces on each page (15 by default) |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/list_by_page?page_size=5&page_no=1&isblack=0&search_type=tel&search_value=13234333434&stageid=fb642ab91666472bb81c3beb1889b2dc&create_start_time=1625138677&create_end_time=1625397877&user_label=9693c1896bbc45779ac7a28485b0a854,201ff94ccfe242629b557042867a13ad&module_type=3 -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
page_no | String | Yes | Current page |
page_count | String | Yes | Total pages |
total_count | String | Yes | Total pieces |
page_size | String | Yes | Pieces on each page |
items | List | Yes | Query Info |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Customer ID |
nick | String | Yes | Customer Nickname |
uname | String | No | Real Name |
visitorids | String | No | Visitor ID |
partnerid | String | No | Docking ID |
String | No | ||
tel | String | No | Telephone |
String | No | QQ number | |
wx | String | No | WeChat ID |
sex | Ingeter | No | Gender (1: male, 2: female) |
remark | String | No | Note |
enterpriseid | String | No | Enterprise id (different from company id) |
enterprise_name | String | No | Enterprise name |
is_vip | String | No | Customer level (0: general, 1: vip) |
vip_level | String | No | VIP level (a fixed field, which can be defined by user through drop-down list) |
user_status | String | No | Customer status (0: normal, 1: blacklisted) |
proviceid | String | No | Province id |
provice_name | String | No | Province name |
cityid | String | No | City id |
city_name | String | No | City name |
areaid | String | No | District id |
area_name | String | No | District name |
user_label | String | No | WeCom tag id (separated by comma) |
biz_label | String | No | Business tag id (separated by comma) |
extend_fields | Object | No | Extension field |
fixed_fields | Object | No | Customer custom-fixed field (customer defines the option value) |
ex_field_str | String | No | Customer custom-extension field |
source | Integer | No | Customer Source |
wx_build_unionid | String | No | WeChat unionId of customer - self-built app (Only available for WeCom bound with official account or mini program) |
create_type | String | No | Creator type (1: Agent, 2: Collection bot, 3: Reception bot, 4: Voice bot, 5: Telemarketing bot, 6: Trigger, 7: Scheduled task) |
external_userid | String | No | External contact id of WeCom |
development_mode | Integer | No | Development mode (1: 3rd-party development, 2: Self-built application agent development. 3rd-part development is chosen by default, and if the self-built application agent development is not installed, 3rd-party data will be returned even when 2 is selected) |
follow_user | Object | No | WeCom employee added |
follow_user.userid | String | No | WeCom employee's userid |
follow_user.remark | String | No | The employee's notes on this external contact |
follow_user.createtime | Long | No | Time (s) for the employee to add this external contact |
follow_user.add_way | Long | No | Source of the customer added by the employee. See _Source Definition (opens new window) for details |
follow_user.status | Integer | No | 1: Normal, with a friend relationship, -1: Employee deleted the customer, -2: Customer deleted the employee |
create_time | Long | No | Creation time (s) |
create_date | Long | No | Creation date (s) |
update_time | Long | No | Update time (s) |
timezoneid | String | No | Time zone ID |
timezone_value | String | No | Time zone value |
language | String | No | Language identification |
language_value | String | No | Language value |
Return example:
{
"items": [
{
"id": "6738912701e74e02ae20f5a6c40c1d14",
"pid": "60b7e31daf15417aa0f521aa7d822ddd",
"nick": "admin",
"sex": 1,
"source": 9,
"status": 8,
"partnerid": "wmzcrEDAAAAn_GEUrwuprZYeJkv99PeA",
"is_vip": "0",
"user_status": 0,
"extend_fields": { },
"fixed_fields": {
"userLabel": "label1,label2,www"
},
"create_type": 1,
"create_time": 1629860308,
"create_date": 1629820800,
"create_serviceid": "52e5ed05ee984a4f8bb0b3f921ba2b05",
"update_time": 1632369757,
"update_user_id": "5f96c8393cea49078a2c676ec6aad697",
"update_user_name": "admin1",
"liable_serviceid": "52e5ed05ee984a4f8bb0b3f921ba2b05",
"liable_service_name": "admin1",
"crm_status": 3,
"wx_build_unionid": "or-MA51K3ISeMe_4W6_6LPNaL3MU"
},
{
"id": "dcf361d7889a43bca87fb9ca3a636e75",
"pid": "60b7e31daf15417aa0f521aa7d822ddd",
"nick": "tet221",
"uname": "stedfg",
"email": "2344sds5234@qq.com",
"tel": "13014502333",
"source": 18,
"status": 8,
"is_vip": "0",
"user_status": 0,
"extend_fields": { },
"fixed_fields": { },
"create_type": 1,
"create_time": 1632369647,
"create_date": 1632326400,
"create_serviceid": "f1b8dfc486bd42508edbc80e5c9fd8e9",
"create_service_name": "SCRM-test",
"update_time": 1632369647,
"update_user_id": "f1b8dfc486bd42508edbc80e5c9fd8e9",
"update_user_name": "SCRM-test",
"crm_status": 1,
"wx_build_unionid": "11112222333334",
"follow_user": [
{
"userid": "wor8AYBgAA4hQKumvkoF3vPcD-G9_GyA",
"remark": "sobot",
"createtime": 1640315257 ,
"add_way": 1
}
]
}
],
"page_count": 76,
"total_count": 152,
"page_size": 2,
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# ● Query Customer Details
API description:
Query customer details
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/detail
Request param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Customer ID |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/detail -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '
{"id":"f1b8dfc486bd42508edbc80e5c9fd8e9"}
'
2
3
4
Return param:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Customer ID |
nick | String | Yes | Customer Nickname |
uname | String | No | Real Name |
visitorIds | String | No | Visitor ID |
partnerId | String | No | Docking ID |
String | No | ||
tel | String | No | Telephone |
String | No | QQ number | |
wx | String | No | WeChat ID |
sex | Ingeter | No | Gender (1: male, 2: female) |
countryId | String | No | Country id |
countryName | String | No | Country name |
proviceId | String | No | Province id |
proviceName | String | No | Province name |
cityId | String | No | City id |
cityName | String | No | City name |
areaId | String | No | District id |
areaName | String | No | District name |
remark | String | No | Note |
enterpriseId | String | No | Enterprise id (different from company id) |
enterpriseName | String | No | Enterprise name |
isVip | String | No | Customer level (0: general, 1: vip) |
vipLevel | String | No | VIP level (a fixed field, which can be defined by user through drop-down list), obtained from Query Customer Level. |
userStatus | String | No | Customer status (0: normal, 1: blacklisted) |
user_label | String | No | WeCom tag id (separated by comma) |
biz_label | String | No | Business tag id (separated by comma) |
ex_field_str | String | No | Customer custom-extension field |
source | String | No | Customer Source |
wx_build_unionid | String | No | WeChat unionId of customer - self-built app (Only available for WeCom bound with official account or mini program) |
createType | String | No | Creator type (1: Agent, 2: Collection bot, 3: Reception bot, 4: Voice bot, 5: Telemarketing bot, 6: Trigger, 7: Scheduled task) |
createTime | String | No | Creation time (s) |
createDate | String | No | Creation date (s) |
updateTime | String | No | Update time (s) |
wxExternalUserIds | list | No | Wechat ExternaUserid |
wxUnionIds | list | No | Wechat UnionID |
wxOpenIds | list | No | Wechat OpenID |
whatsappids | list | No | WhatsApp ID |
faceBookids | list | No | FaceBook ID |
instagramids | list | No | Instagram ID |
lineids | list | No | Line Id |
telegramids | list | No | Telegram ID |
discordids | list | No | Discord ID |
timezoneid | String | No | Time zone ID |
timezone_value | String | No | Time zone value |
language | String | No | Language identification |
language_value | String | No | Language value |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"item": {
"user_label": "bb25cd094d44426ca3113b90d66a124c",
"create_type": "1",
"source": "9",
"nick": "admin2",
"wx_build_unionid": "or-MA53WmBhZexunZ0I2ZueGdk7g",
"tel": "13168765122",
"ex_field_str": "[{\"fieldid\":\"81632fdcc05d41ef92b024979e489c17\",\"field_value\":\"\",\"field_type\":\"3\"},{\"fieldid\":\"2445ede23ccc4e55940fc61236985b57\",\"field_value\":\"628242069686628\",\"field_text\":\"2\",\"field_type\":\"9\"},{\"fieldid\":\"984483b8c8d34eae9706e512ef641083\",\"field_value\":\"628241984465772\",\"field_text\":\"222\",\"field_type\":\"9\"},{\"fieldid\":\"6dbd01468c134cae95d2c30f963aeb24\",\"field_value\":\"\",\"field_type\":\"2\"},{\"fieldid\":\"14bcf8a12c81458f86998996a51d47fa\",\"field_value\":\"607592588177650\",\"field_text\":\"a-2\",\"field_type\":\"9\"},{\"fieldid\":\"e8426f86c0644078aac6549787eda1a8\",\"field_value\":\"\",\"field_type\":\"4\"},{\"fieldid\":\"bafe053fb51a40d6a2d2b3ab4ce9a80f\",\"field_value\":\"34534\",\"field_type\":\"5\"},{\"fieldid\":\"9c605f42908540529e653d3c0d6c5331\",\"field_value\":\"607592546349742\",\"field_text\":\"xiaomi\",\"field_type\":\"8\"},{\"fieldid\":\"fbf6a75380b74098a097090c7a8f7284\",\"field_value\":\"607592524201284\",\"field_text\":\"computer\",\"field_type\":\"7\"},{\"fieldid\":\"e4043f59025b454a95004e71ec7dd4b5\",\"field_value\":\"607592500181862\",\"field_text\":\"Banana\",\"field_type\":\"6\",\"field_params\":\"xialaliebiao\",\"data_params\":\"balana\"}]",
"id": "1023046dc7f94c3aa9568e5cc86cfbc7",
"sex": "1",
"update_time": "1636516394",
"create_time": "1632806109"
},
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# ● Query All Customer Behaviors
API description:
Query all customer behaviors
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user_dynamic/list_by_page
Request param:
Param | Type | Required | Description |
---|---|---|---|
userid | String | Yes | Customer ID |
biz_type | String | No | Business type (not passed: all types, groupService: staff follow-up record, groupUser: customer status, groupOther: others) |
page_no | Integer | Yes | Current page (start from the first page by default) |
page_size | Integer | Yes | Pieces on each page (100 by default) |
Request example:
curl https://sg.sobot.io/api/scrm/5/user_dynamic/list_by_page?userid=13b79f884bc94011af91df4a46373d33&biz_type=1&page_no=1&page_size=10
-X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
page_no | String | Yes | Current page |
page_count | String | Yes | Total pages |
total_count | String | Yes | Total pieces |
page_size | String | Yes | Pieces on each page |
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Primary key |
userid | String | Yes | Customer ID |
biz_type | String | No | Business type |
biz_time | Long | No | Business time (time of business occurrence, ms) |
biz_content | String | No | Business content (json object) |
create_ime | Long | No | Business recording time |
Return example:
{
"items": [
{
"id": "a4b1fad08cc74951a4b76ec571d4384d",
"userid": "13b79f884bc94011af91df4a46373d33",
"biz_type": "user_create",
"biz_time": 1621509568807 ,
"biz_content": {
"userStage": null,
"liableServiceName": null,
"helperServiceName": null,
"bizIdType": null,
"bizId": null,
"bizOperatorType": 1,
"bizOperatorTypeName": "Create manually",
"bizOperatorId": null,
"bizOperatorName": null,
"datas": [
{
"type": 1,
"field": "nick",
"name": "nick",
"value": "zhang san",
"oldValue": null
},
{
"type": 1,
"field": "sex",
"name": "sex",
"value": "man",
"oldValue": null
},
{
"type": 1,
"field": "source",
"name": "source",
"value": "WeChat",
"oldValue": null
}
]
},
"create_time": 0
},
{
"id": "ccff8be345624c6d9ece9859a2ecb763",
"userid": "13b79f884bc94011af91df4a46373d33",
"biz_type": "user_stage_update",
"biz_time": 1622018626 ,
"biz_content": {
"stageType": "1",
"stageTypeName": "Follow-up process",
"stageId": "7b1c71f10c9e40c994c733c48974ce35",
"stageName": "Payment process",
"oldStageName": "intention",
"remark": "",
"bizOperatorType": 1,
"bizOperatorId": "078aeb47c71e4c85ae29b4f68ce3320a",
"bizOperatorName": "admin4"
},
"create_time": 1622018626
},
{
"id": "0e6a14ce3d10493fb8027920e0f5a27f",
"userid": "13b79f884bc94011af91df4a46373d33",
"biz_type": "user_stage_update",
"biz_time": 1622018595 ,
"biz_content": {
"stageType": "21",
"stageTypeName": "order",
"stageId": "cb31d0aff036411fb9bf598baf4dc2ea",
"stageName": null,
"oldStageName": "intention",
"remark": null,
"bizOperatorType": 1,
"bizOperatorId": "078aeb47c71e4c85ae29b4f68ce3320a",
"bizOperatorName": "admin4"
},
"create_time": 1622018595
},
{
"id": "81a0796d17104c3e825d1e53bba640d0",
"userid": "13b79f884bc94011af91df4a46373d33",
"biz_type": "user_stage_update",
"biz_time": 1622018591 ,
"biz_content": {
"stageType": "1",
"stageTypeName": "Follow-up process",
"stageId": "cb31d0aff036411fb9bf598baf4dc2ea",
"stageName": "intention",
"oldStageName": null,
"remark": "",
"bizOperatorType": 1,
"bizOperatorId": "078aeb47c71e4c85ae29b4f68ce3320a",
"bizOperatorName": "admin4"
},
"create_time": 1622018591
}
],
"page_no": 1,
"page_count": 1,
"total_count": 4,
"page_size": 10,
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ● Add Follow-up Record
API description:
Add follow-up record
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user_stage/record_save
Request param:
Param | Type | Required | Description |
---|---|---|---|
userid | String | Yes | Customer ID |
content | String | Yes | Content |
Request example:
curl https://sg.sobot.io/api/scrm/5/user_stage/record_save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"userid": "678599e8f8a6407987c1aa4391d41f4d", "content": "finish"}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Query Follow-up Stage
API description:
Query follow-up stage
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user_stage/query_list_by_type
Request example:
curl https://sg.sobot.io/api/scrm/5/user_stage/query_list_by_type -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Primary key |
name | String | No | Stage name |
sortnum | Integer | No | Order no. |
Return example:
{
"items": [
{
"id": "15d6506f836c4340b7b36fb94bdedf31",
"name": "Preliminary Communication",
"sortnum": 0
},
{
"id": "fb642ab91666472bb81c3beb1889b2dc",
"name": "Normal follow-up",
"sortnum": 1
},
{
"id": "cb31d0aff036411fb9bf598baf4dc2ea",
"name": "intention",
"sortnum": 2
},
{
"id": "7b1c71f10c9e40c994c733c48974ce35",
"name": "Payment process",
"sortnum": 3
},
{
"id": "678599e8f8a6407987c1aa4391d41f4d",
"name": "Deal closing",
"sortnum": 4
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# ● Set Customer Stage
API description:
Set stage for customer
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user_stage/stage_save
Request param:
Param | Type | Required | Description |
---|---|---|---|
userid | String | Yes | Customer ID |
stageid | String | Yes | Stage id |
stage_name | String | Yes | Stage name |
stage_type | Integer | Yes | Follow-up stage type (1: Follow-up process, 2: Follow-up result (21: Succeeded order, 22: Failed order, 23: invalid)) |
Request example:
curl https://sg.sobot.io/api/scrm/5/user_stage/stage_save -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"remark": "","stageid": "678599e8f8a6407987c1aa4391d
41f4d", "stage_name": "finish","stage_type":1,"userid":"c68bd7ee97fc4845a65b281df27a0ef7"}'
2
3
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Customer Assignment Records
API description:
Query the start and end time through the agent id passed in to obtain the customer assignment records of the designated agent id in the designated time range.
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/cus_distribute_records
Request param:
Param | Type | Required | Description |
---|---|---|---|
liable_serviceid | String | Yes | Agent id (agent id to be queried. Pass in one for each request) |
start_time | Long | Yes | Query start time (s) |
end_time | Long | Yes | Query end time (s) |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/cus_distribute_records -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"liable_serviceid": "9616577c98f045e2a02b314708a8251d","start_time": 1653580800 , "end_time": 1654185599 }'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
page_no | String | Yes | Current page |
page_count | String | Yes | Total pages |
total_count | String | Yes | Total pieces |
page_size | String | Yes | Pieces on each page |
items | List | No | Customer assignment records list |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
assign_time | Long | Yes | Assignment time (s) |
userid | String | Yes | Customer ID |
companyid | String | Yes | Company id |
nick | String | Yes | Customer Nickname |
Return example:
{
"items": [
{
"companyid": "60b7e31daf15417aa0f521aa7d822ddd",
"userid": "eb00cf3b5aa54d8781cd42e396b7172c",
"nick": "Li si",
"assign_time": 1654141377
}
],
"page_no": 1,
"page_count": 1,
"total_count": 1,
"page_size": 15,
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ● Customer Assignment Statistics
API description:
Query the start and end time through the agent id passed in to obtain the number of daily assigned customers of the designated agent id in the designated time range.
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/cus_distribute_statistics
Request param:
Param | Type | Required | Description |
---|---|---|---|
liable_serviceid | String | Yes | Agent id (agent id to be queried. Pass in one for each request) |
start_date | String | Yes | Query start time (yyyy-MM-dd, e.g.: 2022-06-01. The difference with the query end time can be up to one month) |
end_date | String | Yes | Query end time (yyyy-MM-dd, e.g.: 2022-06-01. The difference with the query start time can be up to one month) |
timezone | String | No | timezone (e.g.: +08:00) |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/cus_distribute_statistics -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"liable_serviceid": "4d932aa0ae704968be6e37d20de31d4c","start_date": "2022-05-02", "end_date": "2022-06-02"}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | No | Customer assignment statistics list |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
liable_serviceid | String | Yes | Agent ID |
companyid | String | Yes | Company id |
assign_num | Integer | Yes | Assignment quantity |
assign_date | String | Yes | Assignment date (yyyy-MM-dd, e.g.: 2022-06-01) |
Return example:
{
"items": [
{
"liable_serviceid": "4d932aa0ae704968be6e37d20de31d4c",
"companyid": "60b7e31daf15417aa0f521aa7d822ddd",
"assign_num": 1,
"assign_date": "2022-05-09"
},
{
"liable_serviceid": "4d932aa0ae704968be6e37d20de31d4c",
"companyid": "60b7e31daf15417aa0f521aa7d822ddd",
"assign_num": 1,
"assign_date": "2022-06-01"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# ● Query Customer Source
API description:
Query customer source
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user_dynamic/getsource
Request example:
curl https://sg.sobot.io/api/scrm/5/user_dynamic/getsource -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
value | String | Yes | Dictionary value |
label | String | Yes | Dictionary tag |
Return example:
{
"items": [
{
"label": "mail",
"value": "11"
},
{
"label": "Baidu Marketing",
"value": "12"
},
{
"label": "headline",
"value": "13"
},
{
"label": "360",
"value": "14"
},
{
"label": "Desktop website",
"value": "0"
},
{
"label": "WeChat official account",
"value": "1"
},
{
"label": "APP",
"value": "2"
},
{
"label": "micro-blog",
"value": "3"
},
{
"label": "Mobile website",
"value": "4"
},
{
"label": "Melting cloud",
"value": "5"
},
{
"label": "call center",
"value": "6"
},
{
"label": "Work order center",
"value": "7"
},
{
"label": "Customer Center",
"value": "8"
},
{
"label": "Enterprise WeChat",
"value": "9"
},
{
"label": "WeChat applet",
"value": "10"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# ● Query Agent List
API description:
Query agent list
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user/user_list
Request example:
curl https://sg.sobot.io/api/scrm/5/user/user_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"name":"test","color_value":"#345454","type":1}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
id | String | Yes | Department id or agent id |
name | String | Yes | Department name or agent name |
image | String | Yes | Agent avatar |
path | String | Yes | Department id list |
type | Integer | Yes | Data type (1: Department, 2: Agent) |
manager | Integer | Yes | Admin tag (1: Admin, 2: Agent) |
sub_list | List | Yes | Sub-department info set (data content is consistent with items set) |
Return example:
{
"items": [
{
"id": "fa9e42241b154353ab629ed4b897ee63",
"name": "user1",
"image": null,
"path": "60b7e31daf15417aa0f521aa7d822ddd|bab2c1b0a95248e4bf30ef1c2bf36946|fa9e42241b154353ab629ed4b897ee63",
"type": 1,
"manager_flag": null,
"sub_list": [
{
"id": "edf5f6bbf1ee488093edc3eea29cdc63",
"name": "test2",
"image": null,
"path": null,
"type": 2,
"manager_flag": null,
"sub_list": null
}
]
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# ● Query Province
API description:
Query province
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user_dynamic/provice
Request example:
curl https://sg.sobot.io/api/scrm/5/user_dynamic/provice -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"name":"test","color_value":"#345454","type":1}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
provinceid | String | Yes | Province id |
province_name | String | Yes | Province name |
Return example:
{
"items": [
{
"provinceid": "110000",
"province_name": "Beijing"
},
{
"provinceid": "120000",
"province_name": "Tianjin"
},
{
"provinceid": "130000",
"province_name": "Hebei Province"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# ● Query City
API description:
Query city
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user_dynamic/city/{provinceid}
Request param:
Param | Type | Required | Description |
---|---|---|---|
provinceid | String | Yes | Province id |
Request example:
curl https://sg.sobot.io/api/scrm/5/user_dynamic/city/130000 -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"name":"test","color_value":"#345454","type":1}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
provinceid | String | Yes | Province id |
cityid | String | Yes | City id |
city_name | String | Yes | City name |
Return example:
{
"items": [
{
"cityid": "130100",
"city_name": "Shijiazhuang City",
"provinceid": "130000"
},
{
"cityid": "130200",
"city_name": "Tangshan City",
"provinceid": "130000"
},
{
"cityid": "130300",
"city_name": "Qinhuangdao City",
"provinceid": "130000"
},
{
"cityid": "130400",
"city_name": "Handan City",
"provinceid": "130000"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# ● Query District and County
API description:
Query district and county
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user_dynamic/area/{cityid}
Request param:
Param | Type | Required | Description |
---|---|---|---|
cityid | String | Yes | City id |
Request example:
curl https://sg.sobot.io/api/scrm/5/user_dynamic/area/130300 -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en' \\
-d '{"name":"test","color_value":"#345454","type":1}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
items | List | Yes | Query info set |
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Items set:
Param | Type | Required | Description |
---|---|---|---|
cityid | String | Yes | City id |
areaid | String | Yes | District and county id |
area_name | String | Yes | District and county name |
Return example:
{
"items": [
{
"areaid": "130302",
"area_name": "Seaport area",
"cityid": "130300"
},
{
"areaid": "130303",
"area_name": "Shanhaiguan District",
"cityid": "130300"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ● Query Customer Custom Field
API description:
Query customer custom field
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/custom_field/custom_fieid_info_list
Request example:
curl https://sg.sobot.io/api/scrm/5/custom_field/custom_fieid_info_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
Return param:
Param | Type | Required | Description |
---|---|---|---|
field_id | String | Yes | Custom field id |
field_name | String | Yes | Custom field name |
field_variable | String | Yes | Variable name of custom field |
field_type | Integer | Yes | Custom field type (1: Single-line text, 2: Multi-line text, 3: Date, 4: Time, 5: Number, 6: Drop-down list, 7: Check box, 8: Radio button, 9: Cascade field) |
fill_flag | Integer | Yes | Whether custom field is required (0: No, 1: Yes) |
field_status | Integer | Yes | Custom field status |
field_remark | String | Yes | Custom field note |
operate_type | Integer | Yes | Operation Type |
cus_field_data_info_list | List | No | Optional field option info set |
cus_field_data_info_list set:
Param | Type | Required | Description |
---|---|---|---|
data_id | String | Yes | Option id |
data_value | String | Yes | Option value |
data_name | String | Yes | Option name |
data_params | String | Yes | Option param name |
Return example:
{
"items": [
{
"field_id": "6dbd01468c134cae95d2c30f963aeb24",
"field_name": "Multiline text",
"field_variable": "customField2",
"field_type": 2,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 1,
"cus_field_data_info_list": null
},
{
"field_id": "81632fdcc05d41ef92b024979e489c17",
"field_name": "date",
"field_variable": "customField3",
"field_type": 3,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 1,
"cus_field_data_info_list": null
},
{
"field_id": "e4043f59025b454a95004e71ec7dd4b5",
"field_name": "Dropdown list",
"field_variable": "customField6",
"field_type": 6,
"fill_flag": 0,
"field_status": 1,
"field_remark": "test",
"operate_type": 1,
"cus_field_data_info_list": [
{
"data_id": "27e4321062124922a35eb93986fe7d7d",
"data_value": "607592500180588",
"data_name": "Apple",
"data_params": "apple"
},
{
"data_id": "bb2f8d1b8dbc475598c71185b7f3a5f2",
"data_value": "607592500181862",
"data_name": "balana",
"data_params": "balana"
},
{
"data_id": "0c2fa8cbece54af7b24ca450c69a5d4f",
"data_value": "607592500182148",
"data_name": "watermelon",
"data_params": "xigua"
}
]
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# ● Query Customer Level
API description:
Query customer level
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/custom_field/get_vip_level_data_list
Request example:
curl https://sg.sobot.io/api/scrm/5/custom_field/get_vip_level_data_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
Return param:
Param | Type | Required | Description |
---|---|---|---|
data_value | String | Yes | Option value |
data_name | String | Yes | Option name |
Return example:
{
"items": [
{
"data_name": "VIP3",
"data_value": "bb00cb033daa4eee912b0d51a8c12abf"
},
{
"data_name": "VIP1",
"data_value": "655779656425532"
},
{
"data_name": "VIP4",
"data_value": "655783829635797"
},
{
"data_name": "VIP2",
"data_value": "655779656428072"
},
{
"data_name": "vip11",
"data_value": "656301514215001"
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# ● Query Enterprise Custom Field
API description:
Query enterprise custom field
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/enterprise/query_custom_field_list
Request example:
curl https://sg.sobot.io/api/scrm/5/enterprise/query_custom_field_list -X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' -H 'language:en'
Return param:
Param | Type | Required | Description |
---|---|---|---|
field_id | String | Yes | Custom field id |
field_name | String | Yes | Custom field name |
field_variable | String | Yes | Variable name of custom field |
field_type | Integer | Yes | Custom field type (1: Single-line text, 2: Multi-line text, 3: Date, 4: Time, 5: Number, 6: Drop-down list, 7: Check box, 8: Radio button, 9: Cascade field) |
fill_flag | Integer | Yes | Whether custom field is required (0: No, 1: Yes) |
field_status | Integer | Yes | Custom field status |
field_remark | String | Yes | Custom field note |
operate_type | Integer | Yes | Operation Type |
cus_field_data_info_list | List | No | Optional field option info set |
cus_field_data_info_list set:
Param | Type | Required | Description |
---|---|---|---|
data_id | String | Yes | Option id |
data_value | String | Yes | Option value |
data_name | String | Yes | Option name |
data_params | String | Yes | Option param name |
Return example:
{
"items": [
{
"field_id": "c7fb916b757846b68feda361ea38c6bc",
"field_name": "Drop-down list",
"field_variable": "customField1",
"field_type": 6,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 2,
"field_params": null,
"cus_field_data_info_list": [
{
"data_id": "62b96d279d92498ba772711f9e9560eb",
"data_value": "698745548415355",
"data_name": "list",
"field_id": "c7fb916b757846b68feda361ea38c6bc",
"field_variable": null,
"data_params": "canscanshcanshu1"
}
]
},
{
"field_id": "3c368b05bfff4ff0af45654d5ef1a4e7",
"field_name": "Multi-line text",
"field_variable": "customField3",
"field_type": 2,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 2,
"field_params": null,
"cus_field_data_info_list": null
},
{
"field_id": "975c040de38f46dd872201fa42aa7a32",
"field_name": "date",
"field_variable": "customField4",
"field_type": 3,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 2,
"field_params": null,
"cus_field_data_info_list": null
},
{
"field_id": "9d3d0e6be314401cbc64a1d902b439cc",
"field_name": "Number",
"field_variable": "customField6",
"field_type": 5,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 2,
"field_params": null,
"cus_field_data_info_list": null
},
{
"field_id": "d9aecfb5d9694422b68938f9e9287c10",
"field_name": "Check box",
"field_variable": "customField8",
"field_type": 7,
"fill_flag": 1,
"field_status": 1,
"field_remark": "",
"operate_type": 2,
"field_params": null,
"cus_field_data_info_list": [
{
"data_id": "4fbfe166d8794049b3cf53b3b0ffc17d",
"data_value": "699341039230996",
"data_name": "box",
"field_id": "d9aecfb5d9694422b68938f9e9287c10",
"field_variable": null,
"data_params": null
}
]
},
{
"field_id": "c06ad8a5e6ca48d3b317c3d5890657ed",
"field_name": "Radio button",
"field_variable": "customField9",
"field_type": 8,
"fill_flag": 0,
"field_status": 1,
"field_remark": "",
"operate_type": 2,
"field_params": null,
"cus_field_data_info_list": [
{
"data_id": "72aef04f506945c8a67673890354cf00",
"data_value": "699341057671409",
"data_name": "radio",
"field_id": "c06ad8a5e6ca48d3b317c3d5890657ed",
"field_variable": null,
"data_params": null
}
]
}
],
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# ● Query the customer list on the blacklist
API description:
Query the customer list on the blacklist
Request method:
GET
Request URL:
https://sg.sobot.io/api/scrm/5/user/query_black_list
Request param:
Param | Type | Required | Description |
---|---|---|---|
user_id | String | No | Customer ID |
black_type | Intager | No | Blacklist type (-1:forever 24:24h 48:48h 72:72h) |
start_time | Long | No | Query start time (s) |
end_time | Long | No | Query end time (s) |
page_no | Integer | No | Current page |
page_size | Intager | No | Pieces on each page |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/query_black_list?user_id=17c6f373555141efaf3059a2ee4b9e0c&black_type=24&start_time=1710345600&end_time=1714374009&page_no=1&page_size=15
-X GET -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
page_no | String | Yes | Current page |
page_count | String | Yes | Total pages |
total_count | String | Yes | Total pieces |
page_size | String | Yes | Pieces on each page |
items | List | Yes | Query info set |
items set:
Param | Type | Required | Description |
---|---|---|---|
user_id | String | Yes | Customer ID |
nick | String | Yes | Customer Nickname |
black_type | Integer | Yes | Blacklist type (-1:forever 24:24h 48:48h 72:72h) |
black_reason | String | Yes | Reason for Blacklisting |
black_time | Long | Yes | Blacklisting time |
black_end_time | Long | Yes | Unblacklisting time |
is_black | Integer | Yes | Blacklisted or not (1: yes, 0: no) |
user_status | Integer | Yes | Customer status (0: normal, 1: blacklisted) |
Return example:
{
"items": [
{
"user_id": "4d1ecf10289a4a6887eddc5db7621f0b",
"black_type": 48,
"nick": "local",
"black_time": 1714298404,
"black_end_time": 1714471204,
"is_black": 1,
"user_status": 1
},
{
"user_id": "1a814972610e4806a60385a3e8ddaa6f",
"black_type": -1,
"black_reason": "test",
"nick": "Nick",
"black_time": 1714298389,
"black_end_time": 1800698389,
"is_black": 1,
"user_status": 1
},
{
"user_id": "17c6f373555141efaf3059a2ee4b9e0c",
"black_type": 0,
"black_reason": "",
"nick": "liling",
"black_time": 0,
"black_end_time": 0,
"is_black": 0,
"user_status": 1
}
],
"page_no": 1,
"page_count": 1,
"total_count": 3,
"page_size": 3,
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# ● Add to customer blacklist
API description:
Add to customer blacklist
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/add_black_list
Request param:
Param | Type | Required | Description |
---|---|---|---|
user_id | String | Yes | Customer ID |
black_type | Integer | Yes | Blacklist type (-1:forever 24:24h 48:48h 72:72h) |
black_reason | String | Yes | Reason for Blacklisting |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/add_black_list -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
-d '{"user_id":"65cd9f14bdc74a5b888ae26103ac5164","black_type":24,"black_reason":"save test"}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# ● Remove from customer blacklist
API description:
Remove from customer blacklist
Request method:
POST
Request URL:
https://sg.sobot.io/api/scrm/5/user/remove_black_list
Request param:
Param | Type | Required | Description |
---|---|---|---|
user_id | String | Yes | Customer ID |
Request example:
curl https://sg.sobot.io/api/scrm/5/user/remove_black_list -X POST -H 'content-type: application/json' -H 'token: 4ac37cb2e9c740dba4b75a34d5358802' \\
-d '{"user_id":"65cd9f14bdc74a5b888ae26103ac5164"}'
2
Return param:
Param | Type | Required | Description |
---|---|---|---|
ret_code | String | Yes | Return code |
ret_msg | String | Yes | Return message |
Return example:
{
"ret_code": "000000",
"ret_msg": "Success"
}
2
3
4
# Customer CRM message push
Click here (opens new window) to see callback message param description
# ● Add Customer
API description:
Push messages in real time when adding customers (new customer, to-be-assigned customer, follow-up customer, my customers, all customers, pool customer, company details).
Return content:
Param | Type | Required | Description |
---|---|---|---|
sys_code | String | Yes | Product code |
type | String | Yes | Message Type |
content | List | Yes | Pushed message content set |
content set:
Param | Type | Required | Description |
---|---|---|---|
area_name | String | No | District and county name |
liable_agentid | String | No | Agent id |
update_id | String | Yes | Updater id |
biz_operatorid | String | No | Operator id |
update_datetime | String | Yes | Update time (s) |
create_type | String | Yes | Creator type (1: Agent, 2: Collection bot, 3: Reception bot, 4: Voice bot, 5: Telemarketing bot, 6: Trigger, 7: Scheduled task) |
user_emails | String | No | Email (separated by comma, e.g.: "xxxxxx@qq.com;xxxxxxx@qq.com") |
crm_status | String | No | Customer status (1: 1st Inquiry, 2: to-be-assigned, 3: follow-up, 4: customer pool) |
userid | String | Yes | Customer ID |
update_name | String | Yes | Updater name |
user_tels | String | No | Telephone (separated by comma, e.g.: "13xxxxxxxxx;15xxxxxxxxx") |
delete_reason | String | No | Reason for deletion |
companyid | String | Yes | Company id |
datetime | String | Yes | Data time (s) |
create_id | String | Yes | Creator id |
stage_name | String | No | Stage name |
black_reason | String | No | Reason for Blacklisting |
String | No | QQ number | |
update_type | String | Yes | Updater type (1: Agent, 2: Collection bot, 3: Reception bot, 4: Voice bot, 5: Telemarketing bot, 6: Trigger, 7: Scheduled task) |
black_type | String | No | Blacklist type (24h/48h/72h) |
liable_agent_name | String | No | Agent name |
province_name | String | No | Province name |
msg_type | String | Yes | Message Type |
group_chat_name | String | No | Affiliated Group Chat |
biz_operator_type | String | No | Operator type (1: Agent, 2: Collection bot, 3: Reception bot, 4: Voice bot, 5: Telemarketing bot, 6: Trigger, 7: Scheduled task) |
status | String | Yes | Logic deletion (8: Normal, 9: Deleted) |
unionid | String | No | WeCom unionid |
user_name | String | Yes | Real name |
remark | String | No | Note |
is_black | String | No | Blacklisted or not (1: yes, 0: no) |
city_name | String | No | City name |
liable_department_name | String | No | Agent department name |
create_datetime | String | Yes | Creation time (s) |
wx_build_unionid | String | No | Self-built unionid (Only available for WeCom bound with official account or mini program) |
helper_agentid | String | No | Assistant id |
user_status | String | No | Customer status (0: normal, 1: blacklisted) |
wx | String | No | WeChat ID |
helper_agent_name | String | No | Assistant name |
stage_type | String | No | Follow-up stage type (1: follow-up process, 2: follow-up result (21: succeeded order, 22: failed order, 23: invalid)) |
user_label | String | No | User tag |
sex | String | No | Gender (1: male, 2: female) |
bizid_type | String | No | Business type (0: none, 1:chat, 2: talk, 3: ticket) |
biz_operator_name | String | No | Operator name (1: agent name, 2: collection bot name) |
user_nick | String | Yes | Customer Nickname |
qywx_friends_name | String | No | Wecom Friend |
bizid | String | No | Business id |
user_level | String | No | VIP level (a fixed field, which can be defined by user through drop-down list) |
black_endtime | String | No | Unblacklisting time |
stageid | String | No | Stage id |
create_name | String | Yes | Creator name |
extend_field_values | List | No | Extension field set |
extend_field_values set:
Param | Type | Required | Description |
---|---|---|---|
field_value | String | No | Extension field value |
field_type | String | No | Extension field type: (1: single-line text, 2: multi-line text, 3: date (2019-09-01), 4: time (10:20), 5: number, 6: drop-down list (options), 7: radio button (options), 8: check box (options)) |
fieldid | String | No | Extension field id |
field_params | String | No | Field param name |
data_params | String | No | Option param name |
Return example:
{
"sys_code":"50",
"type":"crm",
"content":[
{
"area_name":"",
"liable_agentid":"aa9e36822c6e447596fb4c231a5f6a32",
"update_id":"aa9e36822c6e447596fb4c231a5f6a32",
"biz_operatorid":"",
"update_datetime":"1631821183",
"create_type":"1",
"user_emails":"",
"crm_status":"3",
"userid":"c9187ee3eb184ea7b297002e1066641d",
"update_name":"admin2",
"user_tels":"",
"delete_reason":"",
"companyid":"e93d39fe311b4cf2a6ccd69cafaf256f",
"datetime":"1631821183",
"create_id":"aa9e36822c6e447596fb4c231a5f6a32",
"stage_name":"",
"black_reason":"",
"qq":"",
"update_type":"",
"black_type":"",
"liable_agent_name":"admin2",
"province_name":"",
"msg_type":"0",
"group_chat_name":"",
"biz_operator_type":"",
"status":"8",
"unionid":"wmexjPBgAACq0AVd5XHNCNyDfT5ZGRVw",
"user_name":"",
"remark":"",
"is_black":"",
"city_name":"",
"liable_department_name":"company",
"create_datetime":"1631821183",
"wx_build_unionId":"",
"helper_agentid":"",
"user_status":"",
"wx":"",
"helper_agent_name":"",
"stage_type":"",
"user_label":"",
"sex":"0",
"bizid_type":"",
"biz_operator_name":"",
"user_nick":"sobot",
"extend_field_values":"",
"qywx_friends_name":"admin2",
"bizid":"",
"user_level":"",
"black_endtime":"",
"stageid":"",
"create_name":"admin2"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# ● Update Customer
API description:
Push messages in real time when editing customer info and modifying follow-up stage.
Return content:
Param | Type | Required | Description |
---|---|---|---|
sys_code | String | Yes | Product code |
type | String | Yes | Message Type |
content | List | Yes | Pushed message content set |
content set:
Param | Type | Required | Description |
---|---|---|---|
area_name | String | No | District and county name |
liable_agentid | String | No | Agent id |
update_id | String | Yes | Updater id |
biz_operatorid | String | No | Operator id |
update_datetime | String | Yes | Update time (s) |
create_type | String | Yes | Creator type (1: Agent, 2: Collection bot, 3: Reception bot, 4: Voice bot, 5: Telemarketing bot, 6: Trigger, 7: Scheduled task) |
user_emails | String | No | Email (separated by comma, e.g.: "xxxxxx@qq.com;xxxxxxx@qq.com") |
crm_status | String | No | Customer status (1: 1st Inquiry, 2: to-be-assigned, 3: follow-up, 4: customer pool) |
userid | String | Yes | Customer ID |
update_name | String | Yes | Updater name |
user_tels | String | No | Telephone (separated by comma, e.g.: "13xxxxxxxxx;15xxxxxxxxx") |
delete_reason | String | No | Reason for deletion |
companyid | String | Yes | Company id |
datetime | String | Yes | Data time (s) |
create_id | String | Yes | Creator id |
stage_name | String | No | Stage name |
black_reason | String | No | Reason for Blacklisting |
String | No | QQ number | |
update_type | String | Yes | Updater type (1: agent, 2: collection bot, 3: reception bot, 4: voice bot, 5: telemarketing bot, 6: trigger, 7: scheduled task) |
black_type | String | No | Blacklist type (24h/48h/72h) |
liable_agent_name | String | No | Agent name |
province_name | String | No | Province name |
msg_type | String | Yes | Message Type |
group_chat_name | String | No | Affiliated Group Chat |
biz_operator_type | String | No | Operator type (1: agent, 2: collection bot, 3: reception bot, 4: voice bot, 5: telemarketing bot, 6: trigger, 7: scheduled task) |
status | String | Yes | Logic deletion (8: Normal, 9: Deleted) |
unionid | String | No | WeCom unionid |
wx_build_unionid | String | No | Self-built unionid (Only available for WeCom bound with official account or mini program) |
user_name | String | Yes | Real name |
remark | String | No | Note |
is_black | String | No | Blacklisted or not (1: yes, 0: no) |
city_name | String | No | City name |
liable_department_name | String | No | Agent department name |
create_datetime | String | Yes | Creation time (s) |
helper_agentid | String | No | Assistant id |
user_status | String | No | Customer status (0: normal, 1: blacklisted) |
wx | String | No | WeChat ID |
helper_agent_name | String | No | Assistant name |
stage_type | String | No | Follow-up stage type (1: Follow-up process, 2: Follow-up result (21: Succeeded order, 22: Failed order, 23: invalid)) |
user_label | String | No | User tag |
sex | String | No | Gender (1: male, 2: female) |
bizid_type | String | No | Business type (0: none, 1:chat, 2: talk, 3: ticket) |
biz_operator_name | String | No | Operator name (1: agent name, 2: collection bot name) |
user_nick | String | Yes | Customer Nickname |
qywx_friends_name | String | No | Wecom Friend |
bizid | String | No | Business id (chat id and talk id, which may be directly blacklisted ) |
user_level | String | No | VIP level (a fixed field, which can be defined by user through drop-down list) |
black_endtime | String | No | Unblacklisting time |
stageid | String | No | Stage id |
create_name | String | Yes | Creator name |
extend_field_values | List | No | Extension field set |
extend_field_values set:
Param | Type | Required | Name | Note |
---|---|---|---|---|
field_value | String | No | Extension field value | |
field_type | String | No | Extension field type: (1: single-line text, 2: multi-line text, 3: date (2019-09-01), 4: time (10:20), 5: number, 6: drop-down list (options), 7: radio button (options), 8: check box (options)) | |
fieldid | String | No | Extension field id | |
field_params | String | No | Field param name | |
data_params | String | No | Option param name |
Return example:
{
"sys_code":"50",
"type":"crm",
"content":[
{
"area_name":"",
"liable_agentid":"",
"update_id":"382e70947e274f7ab0380de27e104c29",
"biz_operatorid":"",
"update_datetime":"1614222756",
"create_type":"1",
"user_emails":"17789890000@qq.com",
"crm_status":"2",
"userid":"e5708e9626514ddb9b4f02f7e5fe659b",
"update_name":"admin2",
"user_tels":"17789890000",
"delete_reason":"",
"companyid":"36551b8f301c43c3b2ac271ecc8ac9d9",
"datetime":"1614222756",
"create_id":"382e70947e274f7ab0380de27e104c29",
"stage_name":"",
"black_reason":"",
"qq":"13344445555",
"update_type":"1",
"black_type":"",
"liable_agent_name":"",
"province_name":"",
"msg_type":"0",
"group_chat_name":"",
"biz_operator_type":"",
"status":"8",
"unionid":"",
"wx_build_unionId":"",
"user_name":"Li si",
"remark":"Customer consultation",
"is_black":"",
"city_name":"Qinhuangdao City",
"liable_department_name":"",
"create_datetime":"1614222756",
"helper_agentid":"",
"user_status":"",
"wx":"test_sobot",
"helper_agent_name":"",
"stage_type":"",
"user_label":"",
"sex":"2",
"bizid_type":"",
"biz_operator_name":"",
"user_nick":"user2",
"extend_field_values":[
{
"field_value":"fishing",
"field_type":"1",
"fieldid":"62deb0e13ddc4d67ad3ecfd505e42964"
},
{
"field_value":"1980-11-27",
"field_type":"3",
"fieldid":"ecc35bf9e94e482b9ffe839be6d221a5"
}
],
"qywx_friends_name":"",
"bizid":"",
"user_level":"8f3ccf868e3e425abe364686a7dd6803",
"black_endtime":"",
"stageid":"",
"create_name":"admin2"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# ● Combine Customer
API description:
Push messages in real time when combining customers.
Return content:
Param | Type | Required | Description |
---|---|---|---|
sys_code | String | Yes | Product code |
type | String | Yes | Message Type |
content | List | Yes | Pushed message content set |
content set:
Param | Type | Required | Description |
---|---|---|---|
companyid | String | Yes | Company id |
datetime | Long | Yes | Data time (s) |
biz_operatorid | String | No | Operator id |
msg_type | Integer | Yes | Message Type |
biz_operator_name | String | No | Operator name |
userid | String | Yes | Customer ID |
merged_userid | String | Yes | Combined customer id |
Return example:
{
"sys_code":"50",
"type":"crm",
"content":[
{
"companyid":"36551b8f301c43c3b2ac271ecc8ac9d9",
"datetime": 1614222177 ,
"biz_operatorid":"382e70947e274f7ab0380de27e104c29",
"msg_type":1,
"biz_operator_name":"admin2",
"userid":"6c8e6562d1e448b397e6b7a046673423",
"merged_userid":"6c8e6562d1e448b397e6b7a046673423"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# API return code
# ● Operation Done
Return code | Code description |
---|---|
000000 | Operation done (Any code other than this code is an error code) |
# ● System Exception
Return code | Code description |
---|---|
700046 | The current version purchased by the enterprise does not support the use of API(not available in free and overseas team versions) |
900001 | Blank token |
900002 | Token expired. Get a new one |
900003 | signature error |
900004 | Company api configuration info not found |
999999 | Unknown System Exception |
# ● System Exception
Return code | Code description |
---|---|
510001 | Tag group not found |
510002 | Tag group name already exists |
510003 | Tag name already exists |
510004 | .Tag param name already exists. Tag not found |
510005 | Tag group name cannot be blank |
510006 | Tag name cannot be blank |
510007 | The name cannot exceed 30 chars |
510008 | Param name cannot exceed 30 chars |