# 异步获取机器人的客户列表

每次请求,会同步异步回调的方式,分成多次回调,给出全量的数据

请求方式:POST

请求地址:https://$basehost/gateway/qopen/GetRobotAccountListAsync

body参数

{
    "robot_id": "机器人id",
    "mark_id": "标识某一次请求"
}
字段 类型 必填 说明
robot_id string 机器人id
mark_id string 标识某一次请求

处理结果,异步返回值:

{
    "event_type": 42016,
    "err_code": 0,
    "err_msg": "success", 
    "robot_id": "accAR6zv3yNeXF2IE5TENM3",
    "data": {
        "has_more": true,
        "mark_id":"标识某一次请求",
        "account_list": [
            {
                "account_id": "客户id",
                "account_type": 2,
                "deleted_by_contact": false,
                "deleted_by_staff": false,
                "profile": {
                    "name": "姓名",
                    "gender": 0,
                    "avatar": "头像url",
                    "alias": "备注",
                    "phone": 1399998888,
                    "add_way": 2,
                    "add_at": 1624873867,
                    "union_id": "微信union_id",
                    "external_user_id": "微信external_user_id",
                    "state_code": "微信添加来源state",
                    "channel_name": "微信添加渠道",
                    "desc": "客户描述"
                },
              "user_attr_sys_field_list": [
                {
                  "field_name": "备注",
                  "field_value": ""
                },
                {
                  "field_name": "生日1",
                  "field_value": "2022-05-12"
                }
              ],
              "user_attr_field_list": [
                {
                  "field_name": "user_attr_field1",
                  "field_value": "user_attr_value1"
                },
                {
                  "field_name": "user_attr_field2",
                  "field_value": "user_attr_value2"
                }
              ],
              "tag_info_list":[
                {
                  "parent_tag_name": "标签组名称",
                  "tag_name": "标签名称"
                }
              ]
            }
        ]
    }
}

返回说明

字段 类型 说明
event_type int 事件类型,42016
err_code int 状态码,0为正常,非0代表错误
err_msg string 错误信息
has_more bool 是否还有更多
account_list array 客户列表
mark_id string 标识某一次请求
robot_id string 机器人编号

account_list说明

字段 类型 说明
account_id string 客户id
account_type int 客户类型:0:客户类型未知,1=员工,2=微信外部联系人,3=企业微信外部联系人
deleted_by_contact bool 是否被客户删除
deleted_by_staff bool 是否主动删除客户
profile object 详细信息
user_attr_sys_field_list array 用户系统属性字段列表
user_attr_field_list array 用户自定义属性字段列表
tag_info_list array 获取到的客户标签列表

profile说明

字段 类型 说明
name string 姓名
gender int 性别 0为未知,1为男,2为女
avatar string 头像url
alias string 别名
phone string 电话号码
add_at int 添加时间
add_way string 添加方式
union_id string 微信union_id
external_user_id string 微信external_user_id
state_code string 微信添加来源state
channel_name string 微信添加渠道
desc string 客户描述

tag_info_list说明

字段 类型 说明
parent_tag_name string 标签组名称
tag_name string 标签名称

add_way枚举说明

说明
0 未知来源
1 扫描二维码
2 搜索手机号
3 名片分享
4 群聊
5 手机通讯录
6 微信联系人
7 来自微信的添加好友申请
8 安装第三方应用时自动添加的客服人员
9 搜索邮箱
201 内部成员共享
202 管理员/负责人分配

完整请求示例:

curl -X POST \
  https://$basehost/gateway/qopen/GetRobotAccountListAsync \
  -H 'Content-Type: application/json; charset=UTF-8' \
  -H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
  -d '{
    "robot_id": "",
    "mark_id": "",
}'
最后更新时间: 2024/9/5 18:12:51