Push Data to Airkit from External Systems Push Data to Airkit from External Systems

Push Data to Airkit from External Systems

Ismaen Aboubakare Ismaen Aboubakare

Inbound Requests with App APIs

There is also the ability to set up an API to allow Airkit to receive custom payloads where you can create journeys, modify existing journeys, or even get information back from journeys.  For steps on configuring inbound requests with App APIs, see Creating an API for your Airkit App

Inbound Requests with Subscriptions (web hooks)

Understanding Subscription and Events

Subscriptions (webhooks) are a mechanism to send data when triggered by an event in an application. Within an Airkit application, you can set up subscriptions with the Airkit's first party integrations such as Twilio, Zendesk, Salesforce, Google, and Stripe. For example if you use the Salesforce Subscription, you can start a journey when a the status of a lead is updated or if a record is created. 

Setting up a Subscription 

In this example, we'll be setting up a subscription to Salesforce whenever a Lead is added.

  1. Before creating a subscription, set up a connection to Salesforce and then add the integration to your Airkit Application. Once connected, go to Configuration Builder and add the Salesforce adapter in Integrations. Click on +New and then Adapters, and select Salesforce

    mceclip7.png

  2. Select the Credential associated with Salesforce that you would like to use and Save. This will enable your app to use the Salesforce integrations when creating a Subscription. 

    integrations.png

  3. Go to Connection Builder and click on '+' to add a Salesforce subscription. 
    mceclip12.png
  4. Select a webhook category. For this example, we'll be starting a journey when a new record is added. 

    mceclip13.png

  5. Choose an Object Type. This example will be using the Lead object type. 

    mceclip8.png

After selecting the Object Type, you can define what happens after a lead is added by configuring the journey mapping.


Configuring the Journey Mapping

If you have created an API for your Airkit App, then the journey mapping configuration may look familiar. 

Sample Payload

This is a sample so you can use to know how to build your request. After expanding the Sample Payload, you can hit the Play button to see what that payload would look like. 

Mapping

mceclip0.png

The mapping section is where you can specify what happens once your subscription receives an event. For example, when a lead gets added into salesforce, you can:

  • Start a new journey
  • Replace a current journey
  • Abort a journey if a match is found
  • Lookup and use an existing journey

Start Parameters
start-parameters.png

Start parameters is where you can pass any type of data that is available from your subscription to the journey to session.start. Start parameters are only applicable when your Journey Behavior is 'Start or Create a new Journey'. 

Journey Identifier Expression
mceclip2.png

The journey identifier expression is where you can map an identifier on a session from a piece of data out of the payload or connection namespace. For example, if there was a specific Salesforce ID that came out of the request payload, you could then use that Salesforce ID as the journey identifier. You are given the options of what type the identifier is as well -- Text, Journey ID, or Phone. 

Journey Event Payload

mceclip3.png
Journey event payload is where you can pass data from your subscription into the subscription event namespace.

Response
This is where you can define what your subscription will return after the actions are executed. 

How Publishing an App subscribes and unsubscribes from an external web hook

When publishing an app, the subscription (web hook) is set on the external system. So when creating the subscription, the subscription has not actually been registered yet until the app has been published. Alternatively, when the app is unpublished, the web hook is unset from the external system. 

Further Reading

 

Add comment

Article is closed for comments.