用户资源
查询成员信息
1.接口说明
接口路径:/ac/openapi/v2/groupmembers
请求方式:GET
请求数据类型:
接口描述:组管理员查询所有组的组成员
2.请求消息
请求参数:
Headers:
名称 | 类型 | 必填 | 描述 | 示例 |
---|---|---|---|---|
token | string | 是 | 接口凭证 | eyJhbGciOiJIUzI1N... |
3.请求示例
cURL请求示例
curl --location 'https://api01.xxx.com:65102/ac/openapi/v2/groupmembers' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODYwMzY3NjA5NTQiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.f7nvKA2DqTsXjqF90zblMhwx0zKPpITY0uuSG2ouKG0'
Java请求示例
import okhttp3.*;
public class QueryAllGroupUserDemo {
public static final String TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODY5MDg1MDkyMzEiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.U7pZKgO_K6NuRwOWPxblDfgRpGeVxS-BYieOdLhGDK4";
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
Request request = new Request.Builder()
.url("https://api01.xxx.com:65102/ac/openapi/v2/groupmembers")
.method("GET", null)
.addHeader("token", TOKEN)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Python请求示例
import requests
url = "https://api01.xxx.com:65102/ac/openapi/v2/groupmembers"
payload = {}
headers = {
'token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wdXRlVXNlciI6InNsdXJtdGVzdCIsImFjY291bnRTdGF0dXMiOiJUcmlhbCIsImNyZWF0b3IiOiJhYyIsInJvbGUiOiIxIiwiZXhwaXJlVGltZSI6IjE2ODYwMzY3NjA5NTQiLCJjbHVzdGVySWQiOiIxMTExMiIsImludm9rZXIiOiI2MDQ4Y2U3YmExNWMyYWYyZThjZWMxMjk5MWVjMTNjZiIsInVzZXIiOiJzbHVybXRlc3QiLCJ1c2VySWQiOiIxMTY1NTA0ODU0MSJ9.f7nvKA2DqTsXjqF90zblMhwx0zKPpITY0uuSG2ouKG0'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
4.响应消息
返回参数
名称 | 类型 | 描述 | 示例 |
---|---|---|---|
msg | string | 信息 | success |
code | string | 状态码 | 0 |
data | array | 用户信息列表 | |
accountId | string | 账号ID | 528170362383368192 |
accountName | string | 账号名称 | demo0626 |
groupDisplayName | string | 组展示名称 | demo0626的团队 |
groupId | string | 组ID | 528170364665069568 |
groupRole | string | 当前用户在组中的角色 | Leader |
groupUsersInfos | array | 组成员列表 | |
userId | String | 用户ID | 12714724316 |
userName | string | 用户名 | demo0626 |
clusterId | string | 区域ID | 11112 |
clusterUserName | string | 区域用户名 | demo0626 |
返回示例:
{
"code": "0",
"msg": "success",
"data": [{
"accountId": "528170362383368192",
"accountName": "test",
"groupDisplayName": "test的团队",
"groupId": "528170364665069568",
"groupRole": "Leader",
"groupUsersInfos": [{
"userId": "12714724316",
"userName": "stest",
"clusterId": "11112",
"clusterUserName": "stest"
},
{
"userId": "22031812592",
"userName": "demo0626e",
"clusterId": "11112",
"clusterUserName": "demo0626e"
}
]
}]
}
5.错误码
错误码 | 说明 |
---|---|
10001 | 内部错误 |
10003 | 参数不全 |
10004 | 参数无效 |
10008 | 权限不足 |
10009 | 没有权限访问接口 |
0 | 接口调用成功 |