Help Contents

 

Users Search

Resource: Users Search ( /api/userssearch )

Allows the searching of all users by partial match.

Root Relation: UsersSearch

This resource supports the following methods: GET, POST

Methods

GET


Searches for users by partial name match

Required Permissions

  • TestManagement/ManageExecutions/View
  • TestManagement/ManageIncidents/View
  • TestManagement/ManageRequirements/View
  • TestManagement/ManageScripts/View

Supported Expansions

For more details on expansions, please see the Expand help topic.

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the search request was able to be satisfied.

Example - Search for users

An example of searching for users.

Request Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Request Parameters

KeyValueDescription
queryjoThe partial username, firstname or lastname to search for
$skip20Number of items to skip (start result number)
$top10Number of search results to return
$inlinecountallpagesInclude or supress inline counts
$expandDisplayNameAllows expansion of additional user properties

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Skip": 20,
  "Top": 10,
  "Total": 1,
  "Items": [
    {
      "Id": "3464e9da-f1b7-49aa-87db-7e1eebfd17a5",
      "UserName": "joeb",
      "Email": "joeb@unknown.net",
      "FirstName": "Joe",
      "LastName": "Bloggs",
      "Phone": "(09)-555-999",
      "LastLogIn": null,
      "Enabled": true,
      "IsExternal": false,
      "DisplayName": "Joe Bloggs (joeb)",
      "Self": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5",
      "Links": [
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/password",
          "Rel": "ChangePassword"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/permissions/global",
          "Rel": "GlobalPermissions"
        },
        {
          "Title": "Group Memberships",
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/groups",
          "Rel": "Groups"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/notifications",
          "Rel": "Notifications"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/permissions/projects",
          "Rel": "ProjectPermissions"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/mailmessages",
          "Rel": "MailMessages"
        }
      ]
    }
  ],
  "Self": "http://localhost/api/userssearch/assignees?query=jo&$skip=20&$top=10&$inlinecount=allpages",
  "Links": [
    {
      "Href": "http://localhost/api/userssearch/assignees?query=jo&$skip=10&$top=10&$inlinecount=allpages",
      "Rel": "prev"
    },
    {
      "Href": "http://localhost/api/userssearch/assignees?query=jo&$skip=0&$top=10&$inlinecount=allpages",
      "Rel": "first"
    }
  ]
}

Status Code

200 - OK

POST


Searches for users by partial name match (using POST to allow large existing value queries).

Required Permissions

  • TestManagement/ManageExecutions/View
  • TestManagement/ManageIncidents/View
  • TestManagement/ManageRequirements/View
  • TestManagement/ManageScripts/View

Supported Expansions

For more details on expansions, please see the Expand help topic.

Status Codes

These are the expected status codes returned by the service. In addition, some other status codes may be returned if either an internal error occurs or there is an authentication issue (such as an expired OAuth token).

StatusDescription
200 - OKReturned if the search request was able to be satisfied.

Example - Search for users

An example of searching for users.

Request Headers

KeyValueDescription
Content-Typeapplication/x-www-form-urlencoded

Request Parameters

KeyValueDescription
queryjoThe partial username, firstname or lastname to search for
$skip20Number of items to skip (start result number)
$top10Number of search results to return
$inlinecountallpagesInclude or supress inline counts
$expandDisplayNameAllows expansion of additional user properties

Response Headers

KeyValueDescription
Content-Typeapplication/json; charset=utf-8

Response Body

{
  "Skip": 20,
  "Top": 10,
  "Total": 1,
  "Items": [
    {
      "Id": "3464e9da-f1b7-49aa-87db-7e1eebfd17a5",
      "UserName": "joeb",
      "Email": "joeb@unknown.net",
      "FirstName": "Joe",
      "LastName": "Bloggs",
      "Phone": "(09)-555-999",
      "LastLogIn": null,
      "Enabled": true,
      "IsExternal": false,
      "DisplayName": "Joe Bloggs (joeb)",
      "Self": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5",
      "Links": [
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/password",
          "Rel": "ChangePassword"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/permissions/global",
          "Rel": "GlobalPermissions"
        },
        {
          "Title": "Group Memberships",
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/groups",
          "Rel": "Groups"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/notifications",
          "Rel": "Notifications"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/permissions/projects",
          "Rel": "ProjectPermissions"
        },
        {
          "Href": "http://localhost/api/user/3464e9da-f1b7-49aa-87db-7e1eebfd17a5/mailmessages",
          "Rel": "MailMessages"
        }
      ]
    }
  ],
  "Self": "http://localhost/api/userssearch/assignees?$skip=20&$top=10&$inlinecount=allpages",
  "Links": [
    {
      "Href": "http://localhost/api/userssearch/assignees?$skip=10&$top=10&$inlinecount=allpages",
      "Rel": "prev"
    },
    {
      "Href": "http://localhost/api/userssearch/assignees?$skip=0&$top=10&$inlinecount=allpages",
      "Rel": "first"
    }
  ]
}

Status Code

200 - OK