In this page, you will find the documentation for how to send event data to our api. EventBunker currently supports HTTP POST request with write api key in the http header and JSON data in the body to track events.
You will need a write api key in the request header, if you don't have a key yet, you can create a project and create a write api key. Check out Managing Api Keys for that.
We are using Cloudflare Network to host tracker api, so tracking requests will be fast from all around the world, regardless of your customer's location. Typical response time of the api is around 30-40ms after first request. Also scaling up and down is not an issue since it is handled by Cloudflare system. There is no cold-start time or mini batching, your event will be ready for querying under 10 seconds.
Track Event via Post Api
Only mandatory fields are
x-eventbunker-write-key header. All about Event Data Format has been described in previous page.
Timestamp is optional, if not given, api will asign current UTC time for it.
customer_identifier is a useful field, you can learn more here.
Please copy one of your write api key from web ui or management api response and replace it with placeholders in example code below. Copy and run the sample code below in your terminal window.
curl --request POST 'https://track.eventbunker.io/post' \
--header 'x-eventbunker-write-key: <YOUR-WRITE-API-KEY>' \
--header 'Content-Type: application/json' \
"example_array_field": ["cat", "dog"]
Response will be a JSON contaning
time_recorded (also this is timestamp field's value if set by api). Or you can get validation errors if your api key is wrong or json format is invalid. Check out errors section
That's it! Congratulations, you have sent your first event. You can implement this request in any language since it is just a http post request to EventBunker api endpoint.
For a general explanation of error codes please read here in project management
For all api methods in api key management you can possibly get the following errors with
HTTP 400 error code in addition to list in linked page.
|Error Message||HTTP Code||Description|
|Invalid x-eventbunker-write-key||401||You provided wrong key value or forgotten key in header|
|Body JSON validation failed.||400||Together with json schema validation error message|
|Please use a write key for write requests. Invalid x-eventbunker-write-key||401||If you use a query key or delete key|