Help Center

Webhook Connection code examples

The Webhook connection allows you to pass BlueConic data to webhooks of external marketing automation platforms and import data returned. The Webhook connection also allows you to define incoming webhooks to BlueConic so external marketing automation platforms can pass data into BlueConic. This page shows examples of outgoing and incoming webhook code requests.

Examples of outgoing webhook requests

Here are a few configuration examples to get you started. Click a service to see its settings.

Quickbase

Connect BlueConic to your platform of choice via Quickbase.

Request Method POST
Request URL The webhook URL generated by Quickbase. Something like: https://myApp.quickbase.com/db/bmehtz
Request Headers
Field Name Field Value
Content-Type application/json
Request Body
{
    "email_address": "{{email}}",
    "visits": "{{visits}}"
}
You can send as many profile properties as you want in this JSON format, and configure Quickbase (formerly Cloudpipes) to pick them up.

The Quickbase (Cloudpipes) configuration will look something like this:How to use the BlueConic Webhook Connectionn with Cloudpipes

FullContact

Enrich your contact information using FullContact.

Request Method GET
Request URL https://api.fullcontact.com/v2/person.json?email={{{email.0}}}
Request Headers
Field Name Field Value
X-FullContact-APIKey your API key
Response Mapping
Response Field Profile Property
fullName Name
$.organizations[?(@.current)].name Company
$.organizations[?(@.current)].title Job Title
IFTTT

Connect BlueConic to your platform of choice via IFTTT! Create a webhooks applet in IFTTT as follows:

  1. Select New applet from your user menu.
  2. Click +this.
  3. Search for the service Webhooks and click it.
  4. Click the trigger Receive a web request.
  5. Enter an event name, e.g. "bc_email_changed" and click Create trigger.
  6. Click +that.
  7. Search for the service Email and click it.
  8. Click Send me an email.
  9. Click Create action.
  10. Click Finish.
  11. Click the Webhooks logo in the top left of the applet.
  12. Click Settings.
  13. Copy the URL that looks like https://maker.ifttt.com/use/aJ2FeMm214Lj1wLsTT2-Mrs5hQT3_m1TFT-52DjJOr7 - you will need this to configure the Webhook connection in BlueConic.

In BlueConic, create a Webhook connection with these settings:

Request Method POST
Request URL The webhook URL generated by IFTTT. Something like: https://maker.ifttt.com/use/aJ2FeMm214Lj1wLsTT2-Mrs5hQT3_m1TFT-52DjJOr7
Request Headers
Field Name Field Value
Content-Type application/json
Request Body
{
    "value1": "{{email}}",
    "value2": "{{visits}}",
    "value3": "",
}
The IFTTT "Send me an email" webhook only allows for 3 values to be defined in the request body.
Slack

Have BlueConic chat you up using the Slack API.

Request Method POST
Request URL https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX
Request Body
{
    "text": "{{#surname}}{{firstname.0}} {{surname.0}}{{/surname}} visited the product overview!\n"
}
Request Headers
Field Name Field Value
Content-Type application/json
Zapier

Make BlueConic trigger a Zapier webhook Zap! Click Make a new Zap, select type Webhooks and select Catch Hook.

Request Method POST
Request URL In Zapier, click Set up webhook and copy the generated custom webhook URL to the clipboard. Something like: https://hooks.zapier.com/hooks/catch/1234567/f8f22dgg/
Request Headers
Field Name Field Value
Content-Type application/json
Request Body
{
    "email_address": "{{email}}",
    "number_of_visits": "{{visits}}"
}
You can send as many profile properties as you want in this JSON format, and configure the Zapier webhook Zap to pick them up.

Examples of incoming webhook requests

The webhook connection can trigger a request and send BlueConic data to external applications.
Here is a list of all possible data that can be sent including examples.

Profile properties

{
"id" : {{id}},
"Name" : {{name}},
"Last_name" : {{surname}},
"Email" : {{email}},
"Phone_number" : {{phone.0}} //The first value for the property (nth value),
"Phone_number_2" : {{phone.1}} //The second value for the property (nth value)
}

 

Lifecycle information

{
//Array of lifecycle objects the profile is in
"All_lifecycles" : {{lifecycles}},
//Array of all lifecycle names the profile is in
"All_lifecycle_names" : {{lifecycle_names}},
//Array of all lifecycle ids the profile is in
"All_lifecycle_ids" : {{lifecycle_ids}},
//Array of all stage names the profile is in
"All_lifecycle_stage_names" : {{stage_names}},
//Array of all stage id's the profile is in
"All_lifecycle_stage_ids" : {{stage_ids}},
//Array of all names of the lifecycles and stages the profile is in
"All_lifecycle_names_stages" : {{lifecycle_stage_names}}
}

 

Segment information

{
//Array of all segments the profile is in
"All_segment_names" : {{segments}},
//Array of all segment ids the profile is in
"All_segment_ids" : {{segments_ids}}
}

 

Timeline events

Both front-end and timeline events can be sent to the external application. A prefix is used when including. events in the request body to reduce potential conflicts between event names andies.

Example event:

{
"id" : 124,
"order_value" : 1234,
"order_date" : "1-1-2000"
"products" : [{
"id" : 374856,
"name" : "socks"
},
{
"id" : 1241245,
"name" : "shoes"
}],
"stores" : [{
"id" : 1982749124,
"address" : "someaddress"
},
{
"id" : 0917241lks,
"address" : "streety1"
}]
}

 

Example request body:

{
//Complete event object including sub-events
"Order_event" : {{event}},
//Order id property
"Order_id" : {{event.id}},
//Array of product objects within the order
"Products" : {{event.products}},
//The first product within the order event (nth value)
"First_product" : {{event.products.0}},
//The name of the first product within the order event (nth value)
"First_product_name" : {{event.products.0.name}},
//The address of the second store within the order event (nth value)
"Second_store_address" : {{eventevent.stores.1.address}}
}

 

Helper blocks

Sometimes the external application likes to receive data in a different format, like stringified JSON, hashed data, or something else. To accommodate for this, data can be encapsulated with helper blocks to transform the data to the desired format.

{
//Normal profile id
"id" : {{id}},
//Array of segment names as stringified JSON
"Segments_as_JSON" : {{#JSON}}{{segments}}{{/JSON}},
//Date of birth property as datetime string
"DoB_as_datetime" : {{#DATETIME}}{{date_of_birth}}{{/DATETIME}},
//Email property base64 encoded
"Email_as_Base64" : {{#BASE64}}{{email}}{{/BASE64}},
//Email property URI encoded
"Email_as_URI" : {{#URIENCODE}}{{email}}{{/URIENCODE}},
//Email property Sha256 hashed
"Email_sha" : {{#SHA256}}{{email}}{{/SHA256}},
//Email property MD5 hashed
"Email_md5" : {{#MD5}}{{email}}{{/MD5}},
}

 

The helper blocks also work with the newly supported timeline events.

{
//Normal profile id
"id" : {{id}},
//Complete order event as stringified JSON
"Order_as_JSON" : {{#JSON}}{{e.Order}}{{/JSON}},
//Order date as datetime string
"Order_date" : {{#DATETIME}}{{e.Order.order_date}}{{/DATETIME}}
}

 

 

Was this article helpful?
0 out of 0 found this helpful