查询企业微信@用户
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/we-com/at-persons?q=uuid=ec74d6afc6fa32419a8e22857038dca8&q=endpointUuid=b1a06b4282043ec39305377a3df1c99dcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/sns/application-endpoints/we-com/at-persons/8ab29c25622e3419b5690b6002596af3可查询字段
运行zstack-cli命令行工具,输入QuerySNSWeComAtPerson并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
该API成功时返回一个空的JSON结构**{}**,出错时返回的JSON结构包含一个error字段,例如:
{
"inventories": [
{
"uuid": "02be8517bdda3a3990343870d24a55df",
"userId": "zhang.san",
"endpointUuid": "6c8dafc01f3135ec954d6fd937f4e0e1"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 4.2.0 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 4.2.0 |
| inventories | List | 详情参考inventories | 4.2.0 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 5.0.0 |
| description | String | 错误的概要描述 | 5.0.0 |
| details | String | 错误的详细信息 | 5.0.0 |
| elaboration | String | 保留字段,默认为null | 5.0.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 5.0.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 5.0.0 |
inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 4.2.0 |
| userId | String | 企业微信用户id | 4.2.0 |
| endpointUuid | String | 企业微信endpoint uuid | 4.2.0 |
SDK示例
Java SDK
QuerySNSWeComAtPersonAction action = new QuerySNSWeComAtPersonAction();
action.conditions = asList("uuid=4bd23fb21c7d3d4d9d5d18b794ab05d0","endpointUuid=a0b96b1f27fa3ef992e1fd37b1ab58f9");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySNSWeComAtPersonAction.Result res = action.call();Python SDK
QuerySNSWeComAtPersonAction action = QuerySNSWeComAtPersonAction()
action.conditions = ["uuid=0f5346ee4a9d36da9228e57e3249f853","endpointUuid=6f42b53c5a9336368921441afdf19583"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySNSWeComAtPersonAction.Result res = action.call()