¬ę Back to help center

Sending bulk events via HTTPS

This guide explains how to send events in batches via HTTPS

Contents

Sending bulk events via HTTPS

1. Introduction

The bulk endpoint is part of the trackers HTTPS interface. It can be used to send batches of historic events or for higher throughput.

2. HTTPS endpoint

Property Value
URL https://track.contiamo.com/v3/event_bulk
Protocol HTTPS
Method POST
Payload JSON
Content-Type application/json
Recommended content size up to 10MB per request

Authentication

There are two options to authenticate a request:

Option Description
HTTP Header Authorization: Contiamo YOURTOKEN
or Token in JSON body { "_token": "YOURTOKEN", "events": [...] }

Note: When sending the token as part of the JSON body, it has to be outside the individual event payloads.

Gzip encoding

Bulk event requests can optionally use gzip encoding.

If there is a Content-Encoding: gzip header in the request, Contiamo decodes the data received as gzipped data.

3. Bulk events

POST https://track.contiamo.com/v3/event_bulk
Property Type Comments
events array Array of events

Note: Refer to the HTTPS endpoint documentation for the structure of an event.

Example

$ curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Contiamo YOURTOKEN' \
  -d @event.json \
  https://track.contiamo.com/v3/event_bulk

Where event.json could contain the following information:

{
  "events": [
    {
      "_uid": "sarah@contiamo.com",
      "_sid": "550e8400-e29b-11d4-a716-446655440000",
      "_event": "signup",
      "varian": "Variant A"
    },
    {
      "_uid": "peter@contiamo.com",
      "_sid": "241e2520-s30h-92l5-s122-3982823900123",
      "_event": "order",
      "value": 14.49,
      "payment_method": "Credit Card"
    }
  ]
}