Search Entity Events with Cursor
The Search Entity Events with Cursor function returns the records matching a specified criteria with a strictly defined order.
The Search Entity Events with Cursor function works like a cursor in relational databases. When using this function, some character sequences are returned to the API user as a part of the response and all the subsequent requests with this cursor, then returns the next portion of data in the defined order. No data is repeated in the entire dataset that is returned.
This API endpoint does not check for long-term storage, hence, it will not return any data older than 4 months.
Request:
POST {TenantURL}/entities/_events/_scan
Parameter | Required | Details | Example | |
---|---|---|---|---|
Headers |
Authorization
| Yes | This represents the information about authentication access token in
the format of "Bearer <accessToken> " (see details
in Authentication API ). | |
Query |
filter
| No | This enables events filtering by a condition. Format for the
filter query parameter is,
filter=({Condition Type}[AND/OR {Condition Type}]*)
To know more about the conditions, see Filtering Entities. Note: Consider
the following points:
| Consider the following examples:
|
Query | types | No | This indicates a comma-separated list of event types using which
events must be filtered. The possible values for the
eventType field are as follows:
| types=CREATED,UPDATED |
Query | offset | No | This represents the positive Integer value to identify which starting element in a result set must be returned in a response. | offset=100 |
Query | options | No | An option for the endpoint to return:
| options=resolveMergedEntities |
Query | max | No | This indicates the maximum number of events to be retrieved. Note: You can specify a maximum value of 2000 for this parameter . | max=200 |
Request body | Cursor definition | Yes for all requests except the first one. | This indicates the JSON object that defines the cursor value and must
have one JSON attribute cursor with the sub-JSON
structure having one string attribute value . |
|
Response:
Indicates a JSON object with the cursor specification and the response part.
Request
POST {TenantURL}/entities/_events/_scan?filter=(gt(timestamp, 1373288685810) and lt(timestamp,1373288903390))
Response
GET {TenantURL}/entities/_events/_scan?filter=(gt(timestamp, 1373288685810) and lt(timestamp,1373288903390))
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
{
"cursor": {
"value": "c2NhbjsxOzU5Okg5TkZ5UlVrUmJXOVh0NVp0LTVuSGc7MTt0b3RhbF9oaXRzOjQ7"
},
"objects": [
{
"type": "UPDATED",
"timestamp": 1373288732189,
"entity_uri": "entities/00tTuN7",
"entity_type": "HCP",
"label": " TheRipper0001"
},
{
"type": "UPDATED",
"timestamp": 1373288732190,
"entity_uri": "entities/00tTydN",
"entity_type": "HCP",
"label": " AAAAAAAAAAAAAA2 "
}
]
}
Consequent Request - get next data part
POST {TenantURL}/entities/_events/_scan
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
{
"cursor": {
"value": "c2NhbjsxOzU5Okg5TkZ5UlVrUmJXOVh0NVp0LTVuSGc7MTt0b3RhbF9oaXRzOjQ7"
}
}
Response
POST {TenantURL}/entities/_events/_scan
Headers: Authorization: Bearer 204938ca-2cf7-44b0-b11a-1b4c59984512
{
"cursor": {
"value": "c2NhbjsxOzU5Okg5TkZ5UlVrUmJXOVh0NVp0LTVuSGc7MTt0b3RhbF9oaXRzOjQ7"
},
"objects": [
{
"type": "UPDATED",
"timestamp": 1373288829551,
"entity_uri": "entities/00tTuN7",
"entity_type": "HCP",
"label": " TheRipper0001"
},
{
"type": "UPDATED",
"timestamp": 1373288829551,
"entity_uri": "entities/00tTydN",
"entity_type": "HCP",
"label": " AAAAAAAAAAAAAA3 "
}
]
}