Skip to content

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.

FieldTypeRequiredDescription
roleNamestringyesApplication:RoleName, for example Honeycomb:Technician
serviceProviderNumbernumberone scopeLook in this service provider
serviceProviderLocationNumbernumberone scopeLook 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 ​

StatusCodeWhen
400VALIDATION_ERRORroleName is not Application:RoleName, or both scopes are sent, or neither scope is sent
500INTERNAL_ERRORSomething unexpected failed