Accelerate the Value of Data

Iterate Entities By Type

Iterate entities of a specific type in a particular tenant.

This function allows you to iterate entities of a specific type in a tenant. Each request returns the specified number of entities (see pageSize parameter of initial request), but not more than 150 entities, and the cursor that must be provided as a parameter of the next request to retrieve the next data portion.

Request

POST {TenantURL}/entities/_dbscan
Table 1. Parameters
Parameter Required Details
Headers Authorization Yes Information about the authentication access token in the format of a "Bearer <accessToken>" (see details in Authentication API ).
Body Request definition Yes JSON object defining the request. When requesting the first portion of data, the JSON object must have entity types to filter entities. All the subsequent requests must contain the cursor that defines how to continue requesting data.

Examples:

  • First request:

    { "type" : "configuration/entityTypes/Individual", "pageSize" : 15 }
  • Subsequent requests:

    { "cursor" :"cXVlcnlBbmRGZNGNnUWU2YlBqc1JQbTlNbnc7MDs="}

In a request, some filters can be put inside the first request's cursor specification. See Options for details.

Query options No Comma-separated list of different options, which affect the entity's JSON content in the response. Following are the available options:
  • sendHidden - This option is disabled by default. The entity's JSON contains the hidden attributes if this option is enabled.
  • ovOnly - This option only returns the attribute values that have the Operational Value (OV) flag set to true.
  • nonOvOnly - This option only returns the attribute values that have the Operational Value (OV) flag set to false. If you have a nested or reference attribute value where the Operational Value (OV) flag is set to true, but for the sub-attributes the Operational Value (OV) flag is set to false, then these sub-attributes do not appear in the response.
Table 2. Options
Option Description
returnObjects This is a boolean flag that specifies only the object URIs that must be returned as a result of scanning.
type This option indicates the entity type filter. This is a string property that defines the type of entities that must be returned.
startDate This is a long value property that defines the modification or creation date of entities to filter. You can retrieve all the entities changed or created since the specified time.
pageSize This option specifies how many entities to return in each request. The default value is 10.
filter This option enables entities filtering by a condition. The format is the same as for filter in the "Entity Search" request. For more information, see Filtering Entities.
timeLimit This option specifies the amount of time (in ms) before the entities return a cursor, if none or lesser entities than pageSize are found. The default value is 0 (no time limit).

Response

JSON object with the cursor specification and response part.

First Request - Get First 150 Entities Having Individual Type

POST {TenantURL}/entities/_dbscan
Headers: Authorization: Bearer 204938 ca-2 cf7-44 b0-b11a-1 b4c59984512 
{
  "type": "configuration/entityTypes/Individual",
  "pageSize": 10,
  "filter": "equals(attributes.FirstName, 'John')",
  "timeLimit " : 0
}

Response

{
  	"cursor": {
  		"cursor": " cXVlcnlBbmRGZNGNnUWU2YlBqc1JQbTlNbnc7MDs= "
  	},
  	"objects": [{
  		"URI": "entities/0Fglh8Z",
  		...
  	}, {
  		"URI": "entities/0Fglh11",
  		...
  	},...]
}

Subsequent Request

POST {TenantURL}/entities/_dbscan
Headers: Authorization: Bearer 204938 ca-2 cf7-44 b0-b11a-1 b4c59984512
{
	"cursor": " cXVlcnlBbmRGZNGNnUWU2YlBqc1JQbTlNbnc7MDs= "
}

Response

{
 	"cursor": {
 		"cursor": " cXVlcnlBbmRGZNGNnUWU2YlBqc1JQbTlNbnc7MDs= "
 	},
 	"objects": [{
 		"URI": "entities/0Fglh34",
 		...
 	}, {
 		"URI": "entities/0Fglh89",
 		...
 	},...]
}