Splio Webhook Connector - Web Push & Push App

📘

Provided by: Splio & Partner
Connector type: Destination
Third-party system: Channels
Required license or add-on: : "Marketing Automation"

Sending Web push using Splio Webhook

You can use webhooks to trigger web push messages from other platforms as a part of your campaigns.

Webhooks provide a way to access public APIs and services outside of Splio. We treat webhooks like messages: when someone reaches a webhook in your campaign, we’ll execute the webhook, sending a request to an external API.

In this case, we’ll show you how to use webhooks to send web push messages.

A web push notification targets people on your website. If a person is not on your website, they won’t see the notification until they return (and are identified). Because you can’t guarantee when a person will return to your website, you may want to explore “time-to-live” settings for notifications in your outside service, so that your notification expires if a person does not return to your site (and receive the notification) within a reasonable period of time.

In general, people need to opt in to receive push notifications, and behaviors for push notifications may vary by browser and the platform you use to send web push notifications. Whether you manage push preferences in an external platform or in Splio, you should make sure that you don’t send messages to people who have opted out (or have not opted in).

Send web push using OneSignal

Before you can send a notification through OneSignal, you must have a value that maps people across platforms. We suggest that you map people’s external user IDs in OneSignal to people in your contact database —either directly to id or another contact field. For this example, we assume that contact.id matches the external user ID in OneSignal.

To send a notification, you need both your OneSignal API key and your App ID.

In the Workflow for your Automation:

  1. Add a Call a webhook to your Automation.

  2. Set a Webhook name for easier reading Push to OneSignal

  3. Set the Webhook URL to https://onesignal.com/api/v1/notifications.

  4. Click Add header. Enter Authorization for the Key and basic <your API key> for the Value.

  5. Enter the payload for your web push message. The example below contains required fields based on Web push to a person with any type of web browser identified by an external user ID, but your payload may vary based how you identify people, your audience’s language, and the type(s) of browser you want to send notifications to. See OneSignal’s documentation for more information.

    {
        "app_id": "your-app-id",
        "include_aliases":{
            "external_id": ["{{contact.id}}"]
        },
        // select the platform
        "target_channel": "push",
        "isAnyWeb": true,
        "contents": {
            // English-based message, though you can test for your audience's language with liquid
            "en": "Your web push goes here"
        },
        "headings": {
            // English-based heading, though you can test for your audience's language with liquid
            "en": "Web push title"
        }
    }
    
  6. When you activate your campaign, your webhook will send web push notifications through OneSignal.

Send web push with Airship

To send web push notifications with Airship, you must:

  • integrate the Airship SDK in your website.
  • have your Airship App Key and Master Secret. You can find both in the Airship dashboard.
  • use the named_user feature in Airship.
  • create a custom field in Splio called airship_named_user that matches the Airship named user value. When you set up your webhook, you’ll use {{ contact.custom_fields["airship_named_user"] }} to make sure that your in-app message reaches the right person.

In the Workflow for your automation campaign:

  1. Add a Call a webhook to your Automation.

  2. Set a Webhook name for easier reading Push to Airship

  3. Set the URL to https://go.airship.com/api/push.

  4. Click Add header. Enter Authorization for the Key and basic <base64-encoded credentials> for the Value. You can go here and enter your credentials in the format appKey:masterSecret to get your Base64-encoded authorization credentials.

  5. Click Add Header again and enter Content-Type for the Name and application/vnd.urbanairship+json; version=3; for the Value.

  6. Provide the payload for your web push message. The example below has the basic information required by Airship’s API, but the notification.web object can be much more complex. See Airship’s documentation to learn more.

    {
        "audience": {
            // push to the specific user you want to message
            "named_user": "{{ contact.custom_fields["airship_named_user"] }}"
        },
        "device_types": ["web"],
        "notification": {
            "web": {
                "alert": "Your web push goes here"
            }
        }
    }
    
  7. When you activate your campaign, your webhook will send web push notifications through Airship.


Send in-app messages using Splio Webhook

You can use webhooks to send in-app messages through other platforms. Webhooks provide a way to access public APIs and services outside of Splio. We treat webhooks like messages: when someone reaches a webhook in your campaign, we’ll execute the webhook, accessing an external API. In this case, we’ll show you how to use webhooks to send in-app messages.

An in-app message is a message that targets a person currently using your app or website. In-app messages reach people after they open your app, helping you communicate with engaged members of your audience without bombarding them with notifications outside your app.

Use a webhook to launch Appcues Flows

Appcues Flows are product tours or another series of in-app messages. If you set up your Appcues Flow to target an audience of Specific Users—a group of users bearing one or more properties—you can use a Splio webhook in your campaign to apply properties to people in Appcues, making them eligible to experience your Appcues Flow when they return to your site or app.

Before you get started, you’ll need your Appcues API credentials. People in your Splio contact database must have a Custom field or Identifier that maps to a person in your Appcues account so that you can associate people in Splio with the right Appcues users.

To set up a webhook that triggers an Appcues Flow in your automation campaign:

  1. Add a Call a webhook to your Automation.

  2. Set a Webhook name for easier reading Push to Appcues

  3. Set the URL to https://api.appcues.com/v1/accounts/{account id}/users/{{contact.custom_fields["<appcues_cf>"]}}/activity where:

    • {account id} is your account ID in Appcues.
    • <appcues_cf> is the custom field that maps to your users’ identifiers in Appcues.
  4. Make sure the method is set to POST.

  5. Click Add Header and enter Authorization for the name and bearer <your_appcues_api_key> for the value. Click here to find your Appcues API key

  6. Enter your payload. The property_name and property_value in the example payload below represent the name of the property and the value of the property that trigger your flow in Appcues.

    {
        "profile_update": {
            "property_name": "property_value"
        }
    }
    
  7. Click Save Changes. When you activate your campaign, your webhook will expose tours to people who progress to the webhook in your campaign.

Use a webhook to start Chameleon tours

Chameleon tours work like in-app messages, but, unlike other in-app messages, you don’t send a tour or experience: you trigger it. Your tour should be set up to trigger based on a the presence of one or more properties. Our webhook will set a property on a person in a campaign, causing the tour to appear for that person.

To set an property on a person in Chameleon, you need to know their uid. You can store this value on a contact custom field in Splio. Or, if contact in Splio have an id value that matches the uid values in Chameleon, you can use {{contact.id}} in your payload.

Before you begin, you must have:

  • mapped people from Splio to users in Chameleon.
  • a tour or experience that is triggered by a custom user property.
  • your Chameleon API token.

In the workflow for your automation campaign:

  1. Add a Call a webhook to your Automation.

  2. Set a Webhook name for easier reading Push to Chameleon

  3. Set the URL to https://api.trychameleon.com/v3/observe/hooks/profiles.

  4. Make sure the method is set to POST.

  5. Click Add Header and enter X-Account-Secret for the Key and enter your Chameleon API token for the value. Click here to find or generate your Chameleon API token.

  6. Enter your payload. In this case, because you’re setting a custom property on a user to trigger a tour or experience, the payload is relatively simple.

    {
        "uid": "{{ contact.custom_fields["chameleon-uid"] }}", // chameleon-uid is an example
                                                     // set the property that maps to 
                                                     // your Chameleon UID
        "experience-triggering-property": "experience-triggering-value"
    }
    
  7. When you activate your campaign, your webhook will trigger tours and experiences for people who reach the webhook in your campaign.

Send in-app messages with Airship

To take advantage of Airship’s in-app messaging solution in Splio, you must:

  • integrate the Airship SDK in your app.
  • have your Airship App Key and Master Secret. You can find both in the Airship dashboard.
  • use the named_user feature in Airship.
  • create a custom field in Splio called airship_named_user that matches the Airship named user value. When you set up your webhook, you’ll use {{ contact.custom_fields["airship_named_user"] }} to make sure that your in-app message reaches the right person.

In the Workflow for your automation campaign:

  1. Add a Call a webhook to your Automation.

  2. Set a Webhook name for easier reading Push to Airship

  3. Set the URL to https://go.airship.com/api/push.

  4. Click Add header. Enter Authorization for the Name and basic <base64-encoded credentials> for the Value. You can go here and enter your credentials in the format appKey:masterSecret to get your Base64-encoded authorization credentials.

  5. Click Add Header again and enter Content-Type for the Key and application/vnd.urbanairship+json; version=3; for the Value.

  6. Provide the payload for your in-app message. The example below has the basic information required by Airship’s API, but the in-app object can be much more complex. See Airship’s documentation to learn more. In our example, we have a contact custom field mapped directly to a airship_named_user in Airship.

    {
        "audience": {
            // push to the specific user you want to message
            "named_user": "{{ contact.custom_fields["airship_named_user"] }}"
        },
        // set the device types your audience might have
        "device_types": ["ios", "android"],
        "in-app": {
            "alert": "Your in-app message goes here",
            "display_type": "banner"
        }
    }
    
  7. When you activate your campaign, your webhook will send in-app messages through Airship.