2.19 获取用户自定义字段列表
请求方法
GET
请求地址
/users/customFields
响应参数
参数 |
数据类型 |
描述 |
customFields |
CustomField[] |
自定义字段列表 |
CustomField
参数 |
数据类型 |
描述 |
key |
String |
自定义字段变量名 |
label |
String |
自定义字段名称 |
type |
Integer |
自定义字段类型,0:文本,1:号码,2:URL,3:选项 |
callMode |
Integer |
呼叫模式,0:不支持呼叫,1:支持电话呼叫,2:支持会议呼叫,当字段类型为自定义字段且自定义字段类型为号码时才有值 |
valueList |
String[] |
自定义字段类型为选项类型的自定义字段可选值 |
HTTP状态码
返回值 |
描述 |
200 |
操作成功,详见响应参数 |
400 |
客户端传参异常 |
401 |
鉴权失败 |
500 |
服务端异常 |
请求消息示例
GET /open/api/v2/users/customFields HTTP/1.1
Host: api.yealink.com
Content-Type: application/json
响应消息示例
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
{
"customFields": [
{
"key": "customField1",
"label": "自定义字段1",
"type": 1,
"callMode": null,
"valueList": null
},
{
"key": "customField3",
"label": "自定义字段3",
"type": 1,
"callMode": null,
"valueList": null
},
{
"key": "customField4",
"label": "自定义字段4",
"type": 1,
"callMode": 2,
"valueList": null
},
{
"key": "customField5",
"label": "自定义字段5",
"type": 1,
"callMode": null,
"valueList": null
},
{
"key": "customField7",
"label": "自定义字段7",
"type": 1,
"callMode": null,
"valueList": [
"1",
"2",
"3"
]
},
{
"key": "customField8",
"label": "自定义字段8",
"type": 1,
"callMode": null,
"valueList": null
},
{
"key": "customField9",
"label": "自定义字段9",
"type": 1,
"callMode": null,
"valueList": null
},
{
"key": "customField10",
"label": "自定义字段10",
"type": 1,
"callMode": null,
"valueList": 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/customFields'