User Search

Description

The User Search operation searches for users in the portal.

The search index is updated whenever users are created, updated, or deleted. There can be a lag between the time that the user is updated and the time when it's reflected in the search results.

The results only contain users that the calling user has permissions to see. Users can control this visibility by changing the access property of their user.

Care should be taken when using ArcGIS REST API search operations (search, user search, group search) to find items, groups, and users programmatically. The Portal uses a powerful search engine to index information and to allow full text searching on it. This search engine uses many different inputs to find the appropriate results and rank them. This often makes search 'fuzzy', making it ideal for human interaction, but not necessarily ideal for looking for specific records programmatically. Developers should avoid using search to find specific items (e.g. by title) as the results of these types of queries might change as the search engine evolves.

Request Parameters

Parameter

Details

[Common Parameter]

For a complete listing, see Common parameters.

q

The query string to search the users against.

See Search reference for advanced options.

Example: q=john+smith

start

The number of the first entry in the result set response. The index number is 1-based.

The default value of start is 1 (for example, the first search result).

The start parameter, along with the num parameter can be used to paginate the search results.

Example: start=11 (return result #11 as the first entry in the response)

num

The maximum number of results to be included in the result set response.

The default value is 10, and the maximum allowed value is 100.

The start parameter, along with the num parameter can be used to paginate the search results.

The actual number of returned results may be less than num. This happens when the number of results remaining after start is less than num.

Example: num=50 (returns a max of 50 results in the response)

sortField

Field to sort by. The allowed field names are username and created.

sortOrder

Describes whether the returned results are in ascending or descending order. Default is ascending.

Values: asc | desc

Response Properties

Property

Details

query

The query string searched.

total

The total number of results found for the whole query. The number of query results is limited to 10000.

start

The number of the first entry in the result set for this response. The index number is 1-based.

num

The number of results included in the result set for this response.

nextStart

The next entry index if the current result set doesn't contain all results.

users

A JSON array of user objects. See the response properties for User.

Example Usage

URL for User Search

http://www.arcgis.com/sharing/rest/community/users
q=john

JSON Response Syntax

{
  "query": "<query>",
  "total": <total number of results>
  "start": <results in first set>,
  "num": <number of results per page>,
  "nextStart": <result number of next page>,
  "results": [{
      "username": "<username>",
      "fullName": "<first name> <last name>",
      "description": "<description>", 
	   "tags": [ 
         "<tag1>",
          "tag2>"        
],   
      "culture": <culture code>,        
      "region": <region>,     
	   "thumbnail": "<file name>",  
      "created": date created shown in UNIX time, 
      "modified": date modified shown in UNIX time
    },
}

JSON Response Example

{
  "query": "john",
  "total": 2,
  "start": 1,
  "num": 10,
  "nextStart": -1,
  "results": [
    {
      "username": "jsmith",
      "fullName": "John Smith",
      "description": "I work for the city of Redlands as a senior planner. ",  
      "tags": [ 
         "urban planner",
          "GIS"        
],   
      "culture": en,        
      "region": US,     
	   "thumbnail": "mySelf.jpg", 
      "created": 1224793528000,
      "modified": 1317239877000
    },
    {
      "username": "jhenry",
      "fullName": "John Henry",
      "description": "I'm a full time student at UCSB. ",
      "tags": [ 
         "Department of Geography",
          "GIS"        
],    
      "culture": fr,        
      "region": US,     
	   "thumbnail": "john_at_the_beach.jpg",
      "created": 1237825683000,
      "modified": 1319478041000
    }
  ]
}

3/3/2017