Appearance
Search users by role
Returns the users who hold one role at a service provider or at a location.
POST /fieldservicegateway/usermanagement/v3/authorization/users/by-role-scope/search
Request
Send roleName and exactly one scope.
| Field | Type | Required | Description |
|---|---|---|---|
roleName | string | yes | Application:RoleName, for example Honeycomb:Technician |
serviceProviderNumber | number | one scope | Look in this service provider |
serviceProviderLocationNumber | number | one scope | Look in this location |
Example
json
{
"roleName": "Honeycomb:Technician",
"serviceProviderNumber": 10001
}cURL
bash
curl --request POST 'https://[BASE_URL]/fieldservicegateway/usermanagement/v3/authorization/users/by-role-scope/search' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{x-api-key}}' \
--header 'Authorization: {{Authorization}}' \
--header 'Asurion-correlationid: correlation-id' \
--header 'Asurion-enduser: end-user' \
--header 'Asurion-sourcesystem: source-system' \
--header 'Asurion-serviceprovider: company-id' \
--header 'Asurion-client: default' \
--data '{
"roleName": "Honeycomb:Technician",
"serviceProviderNumber": 10001
}'Response
200 OK
User numbers are returned as strings, with duplicates removed, in ascending order.
json
{
"success": true,
"data": {
"userNumbers": ["1001", "1002"]
}
}Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_ERROR | roleName is not Application:RoleName, or both scopes are sent, or neither scope is sent |
| 500 | INTERNAL_ERROR | Something unexpected failed |