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 | 依授權使用者的 email 位址篩選。 | |
| 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 | 授權使用者的 email 位址。 |
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 範圍。 |