Listen for New Events and Retrieve Them As They Occur

To listen for new events as well as modifications to prior events, issue the following event status request:

curl -X GET "http://localhost:8082/event/status?since=<currentEpochTimeInMs>" 
-H "X-RPC-AUTHORIZATION: userId:pwd" -H "X-RPC-DIRECTORY: main"

Note: Replace =<currentEpochTimeInMs> with the current epoch time in milliseconds.

This request blocks until a new event is recorded or started, or until an existing event is updated. Previously recorded but still active events without an end date undergo updates (e.g. a person identity being assigned or an event simply being given an end time as the face disappears from view).

If the request times out or returns HTTP 204, submit the request again. Once the request returns HTTP 200, it includes the following information:

Element Type Notes
lastModDate integer Epoch time in milliseconds of last inserted or updated event.
serverDate integer Epoch time on server, in milliseconds.
since integer Ensures all events returned that have ended–endDate, prior to their parameter, are excluded from query results. Number based on epoch time in milliseconds.
sinceModDate integer Ensures all events returned have a modDate greater than their parameter. Number based on epoch time in milliseconds.

On a HTTP 200 response, the record returns lastModDate and retrieves all newly added or updated events:

curl -X GET "http://localhost:8082/events?sinceModDate=<epochTimeInMsUsedInStatusCallAbove>"
-H "X-RPC-AUTHORIZATION: userId:pwd" -H "X-RPC-DIRECTORY: main"

Note: Replace <epochTimeInMsUsedInStatusCallAbove> with the value used in the since parameter of the /event/status request described previously.

Once the events are retrieved, listen for more events by issuing an /event/status request again, but instead use the value of the recorded lastModDate for the value of the since parameter. Continue to repeat by alternating retrieval and listening steps:

curl -X GET "http://localhost:8082/event/status?since=<lastModDate>" 
-H "X-RPC-AUTHORIZATION: userId:pwd" -H "X-RPC-DIRECTORY: main"

See Also