/entity.find

Searches an entity type for all the users who meet the specified criteria. For example, you might search for all the users who have not logged on since a specified date, or all the users whose accounts were created after a specified date.

When constructing a search query (by using the filter parameter), the following operators are supported, from highest to lowest precedence.

  • is null, is not null (postfix)
  • not, ! (prefix)
  • >, >=, <, <= (infix)
  • =, != (infix)
  • and (infix)
  • or (infix)

Note. Previous releases of this call included the contains operator. This operator has been removed because its behavior was counterintuitive. If you use this operator now, you will get a 485 error.

For the filter parameter, String values specified by operators must be surrounded by single quotes. Integer values work either with or without single quotes. If used with email, only a full email address can be used (for example, `fsmith@example.com). You cannot filter on a domain (for example,example.com`).


Refer to the Registration Error Codes section for details on error codes.

Important: Querying Large Datasets

When using the entity.find endpoint to search large sets of data (> 100,000), queries should be optimized using natural database sorting by sorting on the id attribute. This has two benefits:

  • Records created between when the time iteration begins and when the time iteration ends are included in the results.
  • Efficient and consistent performance querying and loading for each page of results.

The following tips will help you optimize your queries:

  • Use the attributes parameter to limit the number of attributes returned for each record. This helps to minimize the size of the HTTP payload.
  • Experiment with the max_results parameter to optimize for responses under 10 seconds.
  • Include the timeout parameter (up to 60 seconds) if, and only if, you are unable to keep responses under 10 seconds using the max_results parameter.

See the article Managing User Data for a sample Python script that returns each record created since January 1, 2016.This endpoint includes the following methods:

  • POST


POST

Authentication

This endpoint supports both Basic authentication (recommended) and janrain-signed authentication.

How to Create an Authentication String

Base URL

The base URL for this endpoint is your Identity Cloud Capture domain; for example:

https://educationcenter.us-dev.janraincapture.com

Your Capture domains (also known as Registration domains) can be found in the Console on the Manage Application page:

Examples

This command returns user profile information for all the users in the user entity type, sorting the returned results by the lastUpdated attribute (the last time the user profile was modified). Note that the hyphen in front of lastUpdated means that the returned data will be sorted in descending order (i.e., from the most-recently updated profile to the profile that has gone the longest amount of time without being updated). To sort in ascending order, leave off the hyphen.

curl -X POST -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg=" \
  --data-urlencode type_name=user \
  --data-urlencode sort_on='["-lastUpdated"]' \
  https://my-app.janraincapture.com/entity.find


Example: Find users with a birthday

This command returns user profile information for all the users who have included their birthday in their user profile (that is, profiles where the birthday attribute is not set to a null value).

curl -X POST \
  -H "Authorization: c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg=" \
  --data-urlencode type_name=user \
  --data-urlencode filter="birthday is not null" \
  https://my-app.janraincapture.com/entity.find


Example: Find users who identify as male

This command returns information about all the users who have set their gender attribute to male.

curl -X POST \
  -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg=" \
  --data-urlencode type_name=user \
  --data-urlencode filter="gender='male'" \
  https://my-app.janraincapture.com/entity.find


Example: Adding more than one condition to a filter

This command returns the display name and email address for all users who have a gender attribute equal to male and were born on December 19, 1989.

curl -X POST \
  -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg=" \
  --data-urlencode type_name=user \
  --data-urlencode filter="gender='male' and birthday='12-19-1989'" \
  https://my-app.janraincapture.com/entity.find


Example: Retrieve data for specific attributes

This command returns two attributes (displayName and email) for all the users in the user entity type.


curl -X POST \
  -H "Authorization: Basic c2dueXZ1czZwYzRqbTdraHIybmVxNWdzODlnYnIyZXE6d3Q0YzN1bjl3a2tjZnZ5a25xeDQ0eW5jNDc2YWZzNjg=" 
  --data-urlencode type_name=user \
  --data-urlencode attributes='["displayName", "email"]' \
  https://my-app.janraincapture.com/entity.find
          
      Running this command in Postman

Example Response


{
  "result_count": 6,
  "stat": "ok",
  "results": [
    {
      "displayName": "ian",
      "email": "ian@example.com"
    },
    {
      "displayName": "Rex",
      "email": "rex@example.com"
    },
    {
      "displayName": "sam",
      "email": "smann@example.com"
    },
    {
      "displayName": "alex",
      "email": "alex@example.com"
    },
    {
      "displayName": "john.j",
      "email": "jj@example.com"
    },
    {
      "displayName": "daniel",
      "email": "daniel@example.com"
    }
  ]
}
          

Authorized Clients

  • owner 
  • direct_access 
  • direct_read_access

Query Parameters

Parameter Type Required Description
type_name string Yes Name of the entityType.
 
filter string Expression used to filter the result. By default, all records are returned.
 
max_results string Integer value between 1 and 1000, inclusive, specifying the maximum number of records to be returned. The default value is 100.
 
sort_on string JSON array of attributes used to specify the sort order. By default, results are sorted in ascending order. To sort in descending order, place a minus sign (-) directly in front of the appropriate attribute. For example:
 
-displayName
attributes string JSON array of attributes to be returned. By default, all attributes and attribute values are returned.