Introduction
The TrackTik API and its cloud driven back end were designed so you can retrieve information yourself as a developed integration solution, modify existing data, or create new data. But it can also POST/call-out data to a third-party system as part of a real-time triggers and actions based integration. The service that permits this is called: Events Subscriptions.
An Events Subscription is a call-out service that you create and configure yourself. A standard configuration usually consists of the following parts:
- Data entity/endpoint - REQUIRED
- Trigger (create, update, API action) - REQUIRED
- Filter (like =, :not, :in parameters of API GET calls) - OPTIONAL
- Inclusions list (relation lists, on demand fields) - OPTIONAL
- Regional context (all regions or portion of a regional tree) - REQUIRED
- Webhook access and authorization (URL, secret header name, secret, error notification email address) - REQUIRED
Basic Configuration
The most basic of configurations will be the below, which is an example of a subscription that sends information about new employees to a third-party system, say an HR system, when they are created:
[POST] /events-subscriptions
{
"customId" : "customId of your choosing like ABC-123",
"name" : "A bit more descriptive text about the purpouse of this subscription",
"events" : [
"entity:employees:created"
],
"contextFilters": {
"filters": [
{
"tag": "context.region.3",
"includeChildren": true
}
]
},
"url" : "https://your.webhook.url/path/path",
"secretHeaderName" : "TrackTik-subscription-secret-without-spaces",
"secret" : "B2C60113ECB7 etc.",
"failureEmail" : "(optional) An email address you'd like to monitor errors at"
}
This subscription will work like this:
- For data entity "employees"
- Triggered by event "created"
- And only for employees that belong to any region in the tree who's top node has id of 3
- Obtain the same JSON response as when one does a [GET] /employees
- And send hat JSON response to url https://your.webhook.url/path/path
- With authentication header parameters of secretHeaderName, and secret
- And should any errors occur, communicate this error to email address failureEmail
- The language parameter isn't being defined, so it will default to EN-US
Features
In addition to being able to define the when and what of a call-out, you'll also be able to work with the /events-subscriptions endpoint to view status, logs and more.
For more information see our more detailed technical documentation.