OWNER 的角色分配将被排除。
两个筛选器都是可选的,可通过 email 和/或 phone 进一步缩小结果范围。
🔒 受限访问
此查询需要 VIEW_SUBUSERS 范围。它同时支持 Bearer(用户访问令牌)和 Basic(<API_KEY>)认证。
query AuthorizedUsers(
$email: String
$phone: String
) {
authorizedUsers(
email: $email
phone: $phone
) {
authUserId
roles
status
email
phone
firstName
lastName
}
}
参数
| Parameter | Type | Required | Description |
|---|---|---|---|
| String | No | 按授权用户的电子邮箱地址筛选。 | |
| phone | String | No | 按授权用户的电话号码筛选。 |
响应
成功响应
{
"data": {
"authorizedUsers": [
{
"authUserId": "8b2c1e0a-7d4f-4a9b-9c2d-1f3e4a5b6c7d",
"roles": ["MANAGER", "VIEWER"],
"status": "ACTIVE",
"email": "teammate@example.com",
"phone": "+15555555555",
"firstName": "Ada",
"lastName": "Lovelace"
}
]
}
}
响应字段
| Field | Type | Description |
|---|---|---|
authUserId | UUID | 授权用户 ID(UAC 角色分配 ID)。将此值传递给 removeAuthorizedUser。 |
roles | [UACRoleType] | 分配给该用户在账户上的角色。 |
status | UACRoleStatusType | 角色分配的状态:PENDING、ACTIVE、INACTIVE 或 DECLINED。 |
email | String | 授权用户的电子邮箱地址。 |
phone | String | 授权用户的电话号码。 |
firstName | String | 授权用户的名。 |
lastName | String | 授权用户的姓。 |
示例请求
curl -X POST https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your_access_token>" \
-d '{
"query": "query AuthorizedUsers($email: String, $phone: String) { authorizedUsers(email: $email, phone: $phone) { authUserId roles status email phone firstName lastName } }",
"variables": {
"email": "teammate@example.com"
}
}'
const response = await fetch('https://transactional-graph.staging.fluzapp.com/api/v1/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`
},
body: JSON.stringify({
query: `
query AuthorizedUsers(
$email: String
$phone: String
) {
authorizedUsers(
email: $email
phone: $phone
) {
authUserId
roles
status
email
phone
firstName
lastName
}
}
`,
variables: {
email: "teammate@example.com"
}
})
});
const data = await response.json();
console.log('Authorized users:', data.data.authorizedUsers);
错误代码
| Code | Message | Description |
|---|---|---|
AUTH-0008 | Invalid user access | 无法根据访问令牌或 API key 解析调用方,或使用 Basic 认证的应用未配置运营商账户。请验证您的认证凭证。 |
AUTH-0031 | The requested scopes must be granted by the user first. | 该令牌缺少列出授权用户所需的 VIEW_SUBUSERS 范围。 |