Tag
Tag List
Description:
name | type | required | description |
token | string | yes | token for authorization |
isSync | boolean | no | whether trigger a tag sync operation to WeCom |
TIP
- When isSync is enabled, JuziBot will sync tag info from WeCom, which will take longer time
- Don't call API with isSync enabled frequently
Sample Response Data:
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
data.id | string | yes | tag group id |
data.name | string | yes | tag group name |
data.createTimestamp | yes | number | tag group create timestamp in milliseconds, 0 for no timestamp |
data.order | number | yes | tag group order, larger number will be before smaller number, number range [0, 2^32) |
data.tags.id | string | yes | tag id |
data.tags.name | string | yes | tag name |
data.tags.createTimestamp | number | yes | tag create timestamp in milliseconds, 0 for no timestamp |
data.tags.order | number | yes | tag order, larger number will be before smaller number, number range [0, 2^32) |
TIP
The 0 value for createTimestamp means not exists, which will exist after a sync
Tag Detail
Description
name | type | required | description |
token | string | 是 | token for authorization |
tagId | string | 是 | tag id |
Sample Response Data:
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
data.id | string | yes | tag group id |
data.name | string | yes | tag group name |
data.createTimestamp | yes | number | tag group create timestamp in milliseconds, 0 for no timestamp |
data.order | number | yes | tag group order, larger number will be before smaller number, number range [0, 2^32) |
data.tags.id | string | yes | tag id |
data.tags.name | string | yes | tag name |
data.tags.createTimestamp | number | yes | tag create timestamp in milliseconds, 0 for no timestamp |
data.tags.order | number | yes | tag order, larger number will be before smaller number, number range [0, 2^32) |
TIP
The 0 value for createTimestamp means not exists, which will exist after a sync
Create Tag
Sample Request Data:
Description:
name | type | required | description |
token | string | 是 | token for authorization |
groupId | string | 否 | tag group id |
groupName | string | 否 | tag group name, max length 30 |
tag.name | string | 是 | new tag name, max length 30 |
TIP
- To add a tag to a given tag group,
groupId
is required. - To create a tag with new tag group,
groupName
is required. If the groupName
already exists, the tag will be added to the tag group. - If
groupId
is available, groupName
will be ignored. - It is not allowed to create an empty tag group.
- Tags within same tag group can not have same tag name, if passed in duplicate tag name, only one tag will be created.
Sample Response Data:
参数说明:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
data.id | string | yes | tag group id |
data.name | string | yes | tag group name |
data.createTimestamp | yes | number | tag group create timestamp in milliseconds, 0 for no timestamp |
data.order | number | yes | tag group order, larger number will be before smaller number, number range [0, 2^32) |
data.tags.id | string | yes | tag id |
data.tags.name | string | yes | tag name |
data.tags.createTimestamp | number | yes | tag create timestamp in milliseconds, 0 for no timestamp |
data.tags.order | number | yes | tag order, larger number will be before smaller number, number range [0, 2^32) |
TIP
The 0 value for createTimestamp means not exists, which will exist after a sync
Error Code
code | description |
-1 | invalid tag group name |
-2 | no permission to tag group |
-3 | tag group name exceed max length |
-4 | tag name exceed max length |
Update Tag Group
Sample Request Data:
Description:
name | type | required | description |
token | string | yes | token for authorization |
id | string | yes | tag group id |
name | string | no | tag group name, max length 30 |
order | number | no | tag group order, larger number will be before smaller number, number range [0, 2^32) |
TIP
name
and order
can not be empty at the same time. - The
name
is duplicate with other tag group, the request will be failed.
Sample Response Data:
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
Error Code
code | description |
-2 | no permission to tag group |
-3 | tag group name exceed max length |
-4 | tag name exceed max length |
Update Tag
Sample Request Data:
Description:
name | type | required | description |
token | string | yes | token for authorization |
id | string | yes | tag id |
name | string | no | tag name, max length 30 |
order | number | no | tag order, larger number will be before smaller number, number range [0, 2^32) |
TIP
name
and order
can not be empty at the same time. - The
name
is duplicate with other tag in the same group, the request will be failed.
Sample Response Data:
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
Error Code
code | description |
-2 | no permission to tag group |
-4 | tag name exceed max length |
Delete Tag Group
Sample Request Data:
Description:
name | type | required | description |
token | string | yes | token for authorization |
id | string[] | yes | tag group id list |
Sample Response Data:
Description
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
Error Code
code | decription |
-2 | no permission to tag group |
Delete Tag
Sample Request Data:
Description:
name | type | required | description |
token | string | yes | token for authorization |
id | string[] | yes | tag id list |
WARNING
If all tags in a tag group is deleted, the tag group will be automatically deleted
Sample Response Data:
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
Error Code
code | decription |
-2 | no permission to tag group |
Update Customer Tag
Sample Request Data:
Description:
name | type | required | description |
token | string | yes | token for authorization |
mark_list.unionId | string | yes | customer unionId |
mark_list.userId | string | yes | corp user id |
mark_list.addTagId | string[] | no | the tag list to be added |
mark_list.delTagId | string[] | no | the tag list to be removed |
TIP
- Please make sure the customer is a friend of the user
addTagId
and delTagId
can not be empty at the same time.
Sample Response Data:
Description
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |