Customer
Customer List
Request parameters
name | type | required | description |
token | string | yes | token for authorization |
current | Number | yes | current page |
pageSize | Number | yes | page size |
userId | string | no | corp user id, if this is empty, API will return back customers of all corp users |
TIP
- pageSize is data count for each page, max is 1000.
Sample Response data:
Description
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
data.unionId | string | no | customer unionId |
data.externalUserId | string | yes | customer id |
data.name | string | yes | customer name |
data.avatar | string | no | customer avatar |
data.gender | number | yes | customer gender 0 unknown 1 male 2 female |
data.type | number | yes | customer type 1 WeChat 2 WeCom |
data.followUser.userId | string | yes | the corp user id which is added as the friend inside corp |
data.followUser.name | string | yes | the corp user name |
data.followUser.avatar | string | no | the corp user avatar |
data.followUser.remark | string | yes | the remark that the corp user put on the customer |
data.followUser.createTimestamp | number | yes | the timestamp that the customer added the corp user |
data.followUser.tags | array | yes | tags that the corp user put on the customer |
data.followUser.tags.groupName | string | yes | the tag group name, each tag has to be in a tag group |
data.followUser.tags.tagName | string | yes | the tag name |
data.followUser.tags.type | string | yes | the tag type 1 corp tag, 2 personal tag |
data.followUser.tags.tagId | string | no | the tag id, only available when the tag type is 1 |
total | number | yes | customer total count |
Customer Detail
Request Parameters
name | type | required | description |
token | string | yes | token for authorization |
unionId | string | no | customer unionId |
externalUserId | string | customer external user id | |
TIP
unionId
and externalUserId
has to have at least one. unionId
will take affected when both id exist
Sample Response Data:
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
data.unionId | string | no | customer unionId |
data.externalUserId | string | yes | customer id |
data.name | string | yes | customer name |
data.avatar | string | no | customer avatar |
data.gender | number | yes | customer gender 0 unknown 1 male 2 female |
data.type | number | yes | customer type 1 WeChat 2 WeCom |
data.followUser.userId | string | yes | the corp user id which is added as the friend inside corp |
data.followUser.name | string | yes | the corp user name |
data.followUser.avatar | string | no | the corp user avatar |
data.followUser.remark | string | yes | the remark that the corp user put on the customer |
data.followUser.createTimestamp | number | yes | the timestamp that the customer added the corp user |
data.followUser.tags | array | yes | tags that the corp user put on the customer |
data.followUser.tags.groupName | string | yes | the tag group name, each tag has to be in a tag group |
data.followUser.tags.tagName | string | yes | the tag name |
data.followUser.tags.type | string | yes | the tag type 1 corp tag, 2 personal tag |
data.followUser.tags.tagId | string | no | the tag id, only available when the tag type is 1 |
Sample Request data:
Description:
name | type | required | description |
token | stirng | yes | token for authorization |
userId | string | yes | corp user id |
unionId | string | yes | customer unionId |
remark | string | no | remark, max length 20 |
description | string | no | description, max length 150 |
TIP
- remark and description can not be empty at the same request
- batch update supports 50 items at most
Sample Response data:
Error Code:
code | description |
-1 | remark exceed the limit |
-2 | description exceed the limit |
Description:
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
fail_list | array | no | failed list which contains failed operation |
fail_list.userId | string | yes | the corp user id |
fail_list.unionId | string | yes | the customer unionId |
fail_list.remark | string | no | the remark |
fail_list.description | string | no | the description |
fail_list.errcode | string | yes | error code from WeCom |
fail_list.errmsg | string | yes | error message from WeCom |
WARNING
fail_list
is the list contains all failed operations, if all operations completes successfully, there will be no fail_list
Add Follow History
Sample Request data:
Description
name | type | required | description |
follow_list.unionId | string | yes | customer unionId |
follow_list.userId | string | yes | corp user id |
follow_list.text.content | string | yes | the content of the follow history |
follow_list.text.timestamp | number | no | the timestamp of the follow history |
TIP
- follow_list max length is 500.
Sample Response data:
Description
name | type | required | description |
errcode | number | yes | return code |
errmsg | string | yes | error message |
fail_list | array | no | failed list which contains failed operation |
fail_list.unionId | string | yes | customer unionId |
fail_list.userId | string | yes | corp user id |
fail_list.text.content | string | yes | the content of the follow history |
fail_list.text.timestamp | number | 否 | timestamp of the follow history |
WARNING
fail_list
is the list contains all failed operations, if all operations completes successfully, there will be no fail_list