user.list

The user.list command is used to retrieve a list of users.

TR50 Request

{
  "cmd": {
    "command": "user.list",
    "params": {
      "offset": 0,
      "limit": 10,
      "showAll": false,
      "sort": "-emailAddress",
      "show": [
        "id",
        "emailAddress",
        "defaultOrgId",
        "firstName",
        "lastName",
        "company",
        "title",
        "officePhone",
        "mobilePhone",
        "isSuperAdmin",
        "isSuperOps",
        "createdBy",
        "createdOn",
        "updatedBy",
        "updatedOn"
      ]
    }
  }
}

Request Parameters

Name Type Required Description
offset Integer The starting list offset, used for pagination, defaults to 0 if not specified.
limit Integer Limits the number of users returned. The maximum limit you can set is 2000. Defaults to 2000.
showAll Boolean Shows all users, in any org. Requires Super-Ops.
admins Boolean If set to true, only returns org admins.
support Boolean If set to true, returns all users across all organizations who have access to the support system. Results are not paginated.
sort String A string indicated the direction (+ for ascending, - for descending) and column to sort the results by. To sort by last name descending, use "-lastName". Defaults to "+emailAddress".

TR50 Response

If the command is sent successfully a success message and a list of users is returned. Otherwise, an error and error message will be returned.

{
  "cmd": {
    "success": true,
    "params": {
      "count": 42,
      "fields": [
        "id",
        "emailAddress",
        "firstName",
        "lastName",
        "mobilePhone",
        "officePhone",
        "company",
        "title",
        "defaultOrgId",
        "lastLoginOn",
        "createdOn",
        "createdBy",
        "updatedOn",
        "updatedBy"
      ],
      "result": [
        {
          "id": "52a1d3db169e1fd03217940d",
          "emailAddress": "user@example.com",
          "defaultOrgId": "fd03217940d52a1d3db169e1",
          "firstName": "Jane",
          "lastName": "Smith",
          "company": "Acme",
          "title": "CEO",
          "officePhone": "5558675309",
          "mobilePhone": "5558675309",
          "isSuperAdmin": false,
          "isSuperOps": false,
          "createdBy": "SYSTEM",
          "createdOn": "2013-12-06T08:40:43.885-05:00",
          "updatedBy": "SYSYEM",
          "updatedOn": "2013-12-06T08:40:43.885-05:00"
        },
        ...
      ]
    }
  }
}

Response parameters

Name Type Description
count Integer The total number of user objects.
result Array The array of user objects.

Results Array Object

Name Type Description
id String The object id of the user.
emailAddress String The email address of the user.
password String The password of the user.
defaultOrgId String The object id of the default org the user is associated to.
firstName String The first name of the user.
lastName String The last name of the user.
company String The name of the company the user belongs to.
title String The title the user holds within the company.
officePhone String The office phone number of the user.
mobilePhone String The mobile phone number of the user.
isSuperAdmin Boolean If the user has super admin permission.
isSuperOps Boolean If the the user has super ops permission.
support Boolean Whether the user has access to the support system.
lastLoginOn Timestamp The date and time of the user's last login.
createdBy String The email address of the user who created the thing.
createdOn Timestamp The date and time that the thing was created.
updatedBy String The email address of the user who last updated the thing.
updatedOn Timestamp The date and time that the thing was updated.
locked Boolean This flag will be set to true if the user account is locked.
mustResetPassword Boolean This flag will be set to true if the user must change their password before their next authentication.

PHP API

mixed TR50httpWorker::userList([$offset[, $limit]]);