# 获取企业员工列表
该接口用于获取企业通讯录可见范围的员工列表信息
请求方式:POST
请求地址:https://$basehost/gateway/qopen/GetCompanyAccountList
body参数:
{
"offset": 0,
"limit": 10
}
字段 | 类型 | 必填 | 说明 |
---|---|---|---|
offset | int | 是 | 每次获取的的开始位置,最小值为0 |
limit | int | 是 | 每次获取的条数,取值范围(1~100) |
返回值:
{
"data": {
"has_more": true,
"account_list": [
{
"account_id": "员工id",
"account_type": 2,
"profile": {
"gender": 2,
"name": "",
"avatar": "头像url",
"ww_user_id": "",
"alias": "",
}
}
]
},
"errcode": 0,
"errmsg": "",
"hint": ""
}
返回说明
字段 | 类型 | 说明 |
---|---|---|
data | json | json返回值 |
has_more | bool | 是否还有更多 |
account_list | array | 获取到的客户列表 |
errcode | int | 状态码,0为正常,非0代表错误 |
errmsg | string | 错误信息 |
hint | string | 请求日志ID |
account_list说明
字段 | 类型 | 说明 | |
---|---|---|---|
account_id | string | 客户id | |
account_type | int | 客户类型:0:客户类型未知,1=员工,2=微信外部联系人,3=企业微信外部联系人 | |
profile | object | 详细信息 |
profile说明
字段 | 类型 | 说明 |
---|---|---|
name | string | 姓名 |
alias | string | 别名 |
avatar | string | 头像 |
gender | int | 性别:1=男,2=女,0=未知 |
ww_user_id | string | 企业微信id |
完整请求示例:
curl -X POST \
https://$basehost/gateway/qopen/GetCompanyAccountList \
-H 'Content-Type: application/json; charset=UTF-8' \
-H 'Token: c2NdxDHKXIJ5j1zrhJeq2eJEHjh9xxx' \
-d '{
"offset": 0,
"limit": 10
}'
← 主动退群 异步获取企业员工列表 →