Custom Webhook

Overview

Send events to northDash with simple HTTP post or get requests.

First, make sure that you have a token and then use one of the methods below. If you want data from this integration to go into a separate table in your DWH, you can ask us for a separate token for it.

Send a Single Event with POST

Let’s say you want to send a single event with a post request that includes the following attributes:

{ 
  "event" : "registration", 
  "user_id" : "12345678", 
  "campaign" : "Hello!!!"
 } 

Include the following header for the request’s contents: Content-Type: application/json

In the POST body, format your event as a raw JSON object. Any JSON data is acceptable:

POST https://www.iknowlogy.net/rest?token=YOUR_TOKEN
Content-Type: application/json

Here’s a cURL example:

curl -H "Content-Type: application/json" --data "{
\"event\":\"registration\",
\"user_id\":\"12345678\",
\"campaign\":\"Hello!!!\"
}" https://www.iknowlogy.net/rest/?token=YOUR_TOKEN

And here’s an example in Python:

import requests
res = requests.post(url="http://www.iknowlogy.net/rest/?token=YOUR_TOKEN",
                    headers={"Content-Type":"application/json"},
                    json={"event":"registration",
                          "user_id":"12345678",
                          "campaign":"Hello!!!"}
                   )


Send Events with GET

You can also send events via HTTP GET requests by embedding your event attributes in the request query string.

Make sure that you URL encode the values of the attributes.

For example:

GET https://www.iknowlogy.net/rest/?token=YOUR_TOKEN&event=registration&user_id=1234567&campaign=Hello%21%21%21


Send Multiple Events

Supported only with POST

Just send as array of JSON’s instead of a single JSON





Did you find this helpful?10