查询用户树
请求方法
GET
请求地址
/users/tree
请求参数
参数 |
参数类型 |
数据类型 |
是否必需 |
描述 |
onlyGroup |
Query |
Boolean |
否 |
是否只查分组,true表示只查分组,默认false |
needExtAccount |
Query |
Boolean |
否 |
是否查询第三方账号,默认false |
HTTP状态码
返回值 |
描述 |
200 |
操作成功,详见Node[] |
400 |
客户端传参异常 |
401 |
鉴权失败 |
500 |
服务端异常 |
Node对象定义
参数 |
数据类型 |
描述 |
id |
String |
节点id |
parentId |
String |
父节点Id |
index |
Long |
分组下序号 |
dataType |
Integer |
节点数据类型,1:用户分组;2:用户 |
dataId |
String |
对应数据类型的主键id |
type |
Integer |
节点类型,0:非叶子节点;1:叶子节点 |
name |
String |
节点名称 |
namePinyin |
String |
名称拼音 |
namePinyinForSearch |
String |
名称全拼,简拼用于搜索 |
phoneExtension |
String |
分机号 |
gender |
Integer |
性别,0 保密,1 男,2 女 |
signature |
String |
签名 |
title |
String |
职位 |
number |
String |
企业号+分机号 |
email |
String |
邮箱 |
extAccount |
String |
第三方账号 |
alias |
String |
别名 |
mobile |
String |
手机号 |
mobileCode |
String |
手机区号 |
请求消息示例
GET /open/api/v2/users/tree HTTP/1.1
Host: api.yealink.com
Content-Type: application/json
响应消息示例
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
[
{
"id": "b83ba3ae902e43679be4e311d0ccaa4a",
"dataId": "bab49ca6dfdf4c109af1d75a666c3e58",
"parentId": "f4a8a1ef816244f1bf8e1b730c19fb2c",
"index": 10000,
"type": 0,
"name": "3333",
"dataType": 1,
"number": null,
"email": null,
"phoneExtension": null,
"gender": null,
"namePinyin": "3333",
"namePinyinForSearch": "3,3333,3333",
"signature": null,
"title": null,
"extAccount": null,
"mobile":"13500000000",
"mobileCode": "86",
"alias": null
},
{
"id": "2e66b8f9982040a69a49a7fe24fdc8ff",
"dataId": "1332fede469d46b09026a4baa96ef52a",
"parentId": "6ef0a38a65eb4b499aab0fffa41a8072",
"index": 10000,
"type": 1,
"name": "fwq1",
"dataType": 2,
"number": "7755449999",
"email": "",
"phoneExtension": "9999",
"gender": 0,
"namePinyin": "fwq1",
"namePinyinForSearch": "f,fwq1,fwq1",
"signature": null,
"title": null,
"extAccount": "yl3022"
"mobile":"13500000001",
"mobileCode": "86",
"alias": null
}
]
CURL命令示例
curl -XGET -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJwc3QiOjAsImFyZWEiOiJDTi1GSiIsImNvdW50cnkiOiJDTiIsImN0IjoxLCJzIjo1NCwiZXgiOjE1ODMxMTc3MzMxNzMsInQiOiJvIiwiY2kiOiIxZGU3MzA4YzZlYzM0YmZlODY5OWY0ZmQ0ZjZlMWE4MyIsInBpZCI6IjE5MmI4NmM4MzNhMDQ5OGFiNWU5NTgwMGE0YWMxOWU4IiwianRpIjoiMTkwYzljMDgxMzA2NDQ3M2IxZTI0MDY4YzE1OWFmOWEifQ.UPbzEA5i4To9SAWXor-KU835cBaRp3Ws_aZI6MHIrcqy8l2BSXz_XdgiGU5D3Cv0QwF7Bt9oWScNOspk4AbWVRTtYMhQfsVuemwBHD7BVth3UiBJDyScl-kcoQ_2vajUlv-pglcCQtNLfPyzH6Dk1gKzcrMSmYRKtIjqNyuFOmg' -H 'timestamp: 1583742732181' -H 'nonce: 53f0765fadb54fb6b002f3baac2d5ec8' -H "Content-type: application/json" 'https://api.yealink.com/open/api/v2/users/tree'