API For Mobile
When sending data to Intilery from a mobile app you use the same endpoints as the JavaScript tag detailed below.
We recommend that to preserve the users' battery and minimise network connections, you should batch events up and send them to the batch endpoint. See our Native SDKs for examples.
#
Write KeyTo match the data to your account you need to include a writeKey
with each call.
You get your writeKey
by going to the Tag menu and copying it out of
the JavaScript Website Tag from line 3:
analytics.load("<this is the writeKey you need to copy>");
You pass the writeKey
in each event or batch sent to Intilery.
#
EndpointsTo send data to Intilery POST
a JSON document
with the content-type
header set to application/json
.
Send the data as described in the appropriate schema
with the writeKey
as part of the root object.
#
Single Event EndpointFor a single event, include the writeKey
as a field in the JSON
POST https://events.intilery.com/cdp/events/segment/t
e.g. sending a screen event you would send:
{ "type": "screen", "name": "Home", "writeKey": "<this is your write key>"}
#
Batch Event EndpointWhen you batch events up, send a list of the events in the order they happened.
The writeKey
is only passed in the root of the request, along with batch
.
POST https://events.intilery.com//cdp/events/segment/mobile/batch
{ "writeKey": "<this is your write key>", "batch": [ { "type": "screen", "name": "Home", "properties": { "Feed Type": "private" }, "timestamp": "2021-08-11T12:58:23.062Z", "sentAt": "2021-08-11T12:58:28.374Z" }, { "type": "screen", "name": "Account", "timestamp": "2021-08-11T12:58:28.019Z", "sentAt": "2021-08-11T12:58:28.374Z" } ]}
note
timestamp
and sentAt
are optional,
and if not provided Intilery will add a timestamp on receipt of the event.
They can be used to help debug and spot time differences between device and
receipt of event. Intilery will add a receivedAt
timestamp on receipt of the
event.