Skip to content

External Events Recording API

martinkonopka edited this page Apr 23, 2018 · 4 revisions

This API is available during the session recording and only if External Events (EXTEV) device was included in the session definition.

External Event JSON

  • system : string - name of the application sending the event.
  • name : string - name of the event.
  • data : JSON object (optional) - data specifying the event.
  • timestamp : long (optional) - timestamp when the event occurred in milliseconds from the epoch (01/01/1970 00:00:00). If not specified, timestamp when the event was received by the UXC is used.
  • validTill : long (optional) - timestamp of the end of validity of the event.

Send event

POST /api/event/

Records new external event.

Request

Response

Empty.

Examples

$ curl -X POST \ 
       -H 'Content-Type: application/json' \
       --data '{ /* External Event JSON */ }' \ 
       http://localhost:55555/api/event

Equivalent with jQuery, enable cross domain request:

function sendEvent(system, name, timestamp, data) {
    // construct external event object
    var event = {
        system: system,
        name: name,
        timestamp: timestamp,
        data: data
    };

    $.ajax({
        type: "POST",
        url: "http://localhost:55555/api/event",
        data: JSON.stringify(event),
        crossDomain: true,
        contentType:"application/json; charset=utf-8",
        success: function () {
            // event successfully sent
        },
        error: function (error) {
            // failed to send event
        }
    });

Send many events

POST /api/event/many

Records array of external events.

Request

  • Parameters: None.
  • Body: ExternalEvent[] - array of external events.

Response

Empty.

Examples

$ curl -X POST \ 
       -H 'Content-Type: application/json' \
       --data '[ { /* External Event JSON */ }, ... ]' \ 
       http://localhost:55555/api/event/many
Clone this wiki locally