Ingest API

Description

The Encharge Ingest API lets you create/update people and submit events from your app's backend directly to Encharge. The API exposes a single endpoint.
See this documentation as a Postman Collection.
Don't use this API, if you are building an integration with Encharge to be used by our mutual customers. For example, if your product is a form builder and you'd like to send leads to Encharge, use the Rest API. The Ingest API is the wrong tool for the job and will result in poor experience for our mutual users.

Authentication

Get your write key for the Ingest API in Your Account.

Endpoints

post
https://ingest.encharge.io
/v1/
/
Send date fields formatted as ISO 8601 datetime values. For example, 2020-10-27T07:58:19+00:00 or 2020-10-27T07:58:19Z.
Pass the IP of the user (as property ip in the user object) to automatically populate the user country and timezone. Alternatively, you might set the sourceIp as shown above.
You can pass comma-separated tags property in the user object to easily add tags to the user. For example: {"user": { "userId": 123, "tags": "tag1, tag2"}}

Sample Ingest API calls

Below you can find some samples on how to use the Ingest API. While these are using the curl script, you can import them into Postman to get sample snippets for your preferred language/lib.

User registered

A sample call to create the user upon registration. The event has properties describing the user's plan and trial.
1
curl --location --request POST 'https://ingest.encharge.io/v1' \
2
--header 'content-type: application/json' \
3
--header 'X-Encharge-Token: your-write-key' \
4
--data-raw '{
5
"name": "Registered user",
6
"user": {
7
"email": "[email protected]",
8
"userId": "1234567890",
9
"firstName": "Jon",
10
"lastName": "Snow"
11
},
12
"properties": {
13
"plan": "Premium",
14
"trial": {
15
"startDate": "2020-03-06T14:24:03.522Z",
16
"length": 14
17
}
18
}
19
}'
Copied!

Action taken

A sample call about an action that the user performed in your app (created a page). In this case, the user is identified with their userId and the event has no properties.
1
curl --location --request POST 'https://ingest.encharge.io/v1' \
2
--header 'content-type: application/json' \
3
--header 'X-Encharge-Token: your-write-key' \
4
--data-raw '{
5
"name": "Created Page",
6
"user": {
7
"userId": "1234567890"
8
}
9
}'
Copied!

Form submitted

A sample call to record a form submission by a user. The user email is supplied to identify the user and the properties are the form fields.
1
curl --location --request POST 'https://ingest.encharge.io/v1' \
2
--header 'content-type: application/json' \
3
--header 'X-Encharge-Token: your-write-key' \
4
--data-raw '{
5
"name": "Form Submitted",
6
"user": {
7
"email": "[email protected]"
8
},
9
"properties": {
10
"Message": "Hello, I'd like to order some paper."
11
}
12
}'
Copied!
Last modified 3mo ago