GET/depts/{DeptId}/users

Applies to QAComplete 14.5, last modified on August 06, 2024

Returns all users from a specified department.

Use this operation to get the information about users of the specified department.

To get information on a specific user, use the /depts/{DeptId}/users/{UserId} (GET) operation.

Authentication

Basic authentication using a user’s login and password. See Authentication for details.

Security Rights

The authenticating user must have administrator privileges.

Request Format

To get information on users, send a GET request to the following URL:

http://{server}/rest-api/service/api/v1/depts/{DeptId}/users?offset={offset}&limit={limit}&Filter={filter}

offset  :  integer, default: 0

The number of users to skip before counting the returned users.The default value is 0, which is the offset of the first item. For details, see Paging Through Results Using Offset and Limit.

DeptId  :  integer, required

The ID of the needed department.

limit  :  integer, default: 25

The maximum number of users to return in the response.

filter  :  string

The filter expression to apply to the returned list. See Search Filters.

A sample request:

GET http://yourserver.com/rest-api/service/api/v1/depts/8162/users HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==

A sample request made by using cURL:

curl -u [email protected]:p@ssword -H "Accept: application/json" http://yourserver.com/service/api/v1/depts/8162/users

Response Format

If successful, the operation responds with HTTP status code 200 and returns a JSON object with user information.

If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.

A sample response:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 845


{
    "metadata": {
       "result_set": {
          "count": 1,
          "offset": 0,
          "limit": 25,
          "total": 1
       },
        "permissions": {
            "acl": 7
       }
    },
    "results": [
       {
         "id": 12345,
         "first_name": "John",
         "middle_name": "Hamish",
         "last_name": "Watson",
         "work_phone": "555-35-35",
         "title": "",
         "company_name": "ACME",
         "grouping": "",
         "sub_grouping": "",
         "email: "[email protected]",
         "email2": "",
         "web_site": "",
         "web_site2": "",
         "is_logged_on": false,
         "is_security_admin": true,
         "is_active": true,
         "date_last_logon": "2015-04-10T01:22:00.8430000",
         "nbr_times_logon": 869,
         "newsletters: "",
         "contact_person": "",
         "spouse_name": "",
         "is_selected": false,
         "comments": "",
         "time_zone_code": "GMT London",
         "update_user_id": 24674,
         "date_created": "2015-04-10T01:22:00.8430000",
         "date_updated": "2015-04-10T01:22:00.8430000",
         "discount": 0,
         "import_id": 0, 
         "primary_dept_id": 8162,
         "logon_attempts": 0, 
         "is_a_d_account": false
      }
  ]
}

See Also

Users REST API Reference

Highlight search results