Service endpoint for getting list of users having employee relation to company.
Only service app authentication is permitted.
Returns employees of company, to which service app belongs Service app must have "accounts.company.users.list" scope to use this endpoint.

Query Parameters

NameDescriptionRequired
sizeThe number of results to return. If is equal to 0, return all records.No
pageThe page number to return.No

Body Parameters

None.

Authentication

ServiceAppAuthenticator

Authorization

None

Example Request

URL

For Production: GET https://accounts.avayacloud.com/api/1.0/companies/list_users
For Staging: GET https://onesnastaging.esna.com/api/1.0/companies/list_users

Headers

Authorization: "service_app eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Body

None

Pagination

By default (if "size" query is not provided) endpoint returns list of all users which have employee relation to company or first 1000 entries if total number of employees in company is greater than 1000.

To enable pagination use "page" and "size" query parameters as described in pagination guide.

Example Response

{
  "total": 5,
  "currentPage": 0,
  "nextUrl": "",
  "pageRangeDisplay": [
    1,
    5
  ],
  "previousUrl": "",
  "data": [
    {
      "id": "aghkZXZ-Tm9uZXIRCxIEVXNlchiAgICAoNn_Cqb",
      "username": "Dorian Gray",
      "name": {
        "familyname": "Gray",
        "formatted": "",
        "givenname": "Dorian",
        "honorific_prefix": "",
        "honorific_suffix": "",
        "middlename": "",
        "pronunciation": "",
        "pronunciation_url": ""
      },
      "last_login": "2021-10-28T09:39:38.356000",
      "date_joined": "2021-10-28T09:36:03.713000",
      "lastmodifiedversion": "2021-12-15T10:07:39.324000",
      "emails": [
        {
          "value": "doriangray@newcompany.com",
          "type": "",
          "primary": true,
          "label": "",
          "relationdef_id": "aghkZXZ-Tm9uZXIYCxILUmVsYXRpb25EZWYYgICAgKC5gAgM"
        }
      ],
      "languages": [
        {
          "code": "en-US",
          "primary": true
        }
      ],
      "timezone": "",
      "picturefile": "",
      "relation_graphs": [
        {
          "relationdef_id": "aghkZXZ-Tm9uZXIYCxILUmVsYXRpb25EZWYYgICAgKC5gAgM",
          "initiator_id": "aghkZXZ-Tm9uZXIUCxIHQ29tcGFueRiAgICAgOqUCQw",
          "initiator_type": "company",
          "relation_type": "employee"
        }
      ],
      "phone_numbers": [],
      "addresses": [],
      "gender": "",
      "displayname": "Dorian Gray",
      "permission_groups": [
        "USERSELF_PERMISSION_GROUP",
        "IT_ADMIN_PERMISSION_GROUP"
      ],
      "licenses": []
    },
    // ...
    // data of other users
    // ...
}

Errors

Error codeResponse codeError messageDescription
service_app.scope_required403No required scope configured for service appService app must have scope for this endpoint ("accounts.company.users.list")
company_users_list.page_size_too_big400Total number of records exceeds 1000Value of 'size' query parameter should not be greater than 1000

Response example:

{
  "error": {
    "message": "No required scope configured for service app",
    "code": "service_app.scope_required"
  }
}