REST API

Using Journey Analytics's REST API enables customers to send data to Journey Analytics. All API calls are HTTPS based, and require an app-key, provided by Journey Analytics . REST API data is sent in POST method.Each call should be sent as an array of JSONs – one JSON per event. We only support flat JSON files – nested JSON is not supported. A single call may include as many as 300 events in a batch. To achieve better throughput, and if you are having many events per second, you should send ONLY in batch (and not one after the other).

For each call Journey Analytics responds with a "200 ok" status.Note: As we accept events in JSON format, avoid using escape characters in the data sent to Journey Analytics . See a list of all escape chars here: http://json.org/. As a best practice we recommend sending events in the event payload url encoded.

Method:POSTEndpoint:

https://api.cooladata.com/v3/[app_key]/track

Headers:

Content-Type: application/x-www-form-urlencoded

Payload:

The payload must be in JSON format, and URL encoded (to avoid escape characters).The JSON structure is:

{events:[{"parameter_name":"parameter_value",...},...]}

The following mandatory parameters must be sent with all events (events without these mandatory fields will be invalid and will not be saved in Journey Analytics):

Name Type Mandatory Description
event_name String Yes The name of the event to report.
user_id String Yes The id (possibly anonymous) of the user who generated the event
event_timestamp_epoch Number Yes* *Must be sent if the project is NOT set to override event time-stamp with server time.Format is milliseconds (13 digits) only. If the project is defined to override event time-stamp with server time, any time-stamp sent with the event will be ignored.Supported time stamp formats:yyyy-mm-ddThh:mm:ssyyyy-mm-ddyyyy/mm/dddd/mm/yyyydd-mm-yyyyEpoch in millisecondsDays and months can also be sent in 3 letter format, such as: Mon, Tue, etc. or Jan, Feb, etc.
custom properties String/Number No See more information here.

Example:

{
  "events":[
  {"event_name":"signup","user_id":"1001","event_timestamp_epoch":1436798955476,"first_name":"john","last_name":"doe"},
  {"event_name":"login","user_id":"1005","event_timestamp_epoch":1436798956879,"first_name":"johanna","last_name":"jones"}
  ]
}

Response:

{"results":{},"status":true,"events_count":n,"version":"5"}

Auto Resolution

By default, CoolaData server resolves several properties such as IP and DUA to enrich the event with additional data

DUA Resolution:

User information such as browser, os other technology information is resolved based on the session_dua property.

When one users a REST API, the users session_dua is best be send with every event to enable Journey Analytics to enrich the event with additional user agent info.

IP Resolution:

Geographic data such as city, country and state according is resolved based on the session_ip property.When one uses a Rest API, the IP is determined according to your server, hence in such case, the geographical data won't represent correctly your users' geographical data. In case you would like to resolve this, send the actual session_ip as part of the event JSON, and if it's not available set it to be 0 so we won't override it with the server ip. For example:

curl -X POST https://api.cooladata.com/v2/aknek0zuo8i4ztcmgopn5wotsceg80m9/track -d
'{"events":[{"session_ip":"0","event_name":"Add Item","user_id":"uid_123456"}]}'