External Data Feeds

External Data Feeds

Personalize messages with information from outside Airship using External Data Feeds.

An External Data Feed is a connection from Airship to an external API. Airship uses the response from the external API to populate variables in your messages. External Data Feeds provide a flexible and proactive way to personalize messages with information that isn’t stored in Airship.

For example, you might use data feeds to send your audience weather updates based on their current location or send users a list of products that they might be interested in.

Add Data Feeds to Airship

You can now set up External Data Feeds in Settings » APIs & Integrations » External Data Feeds. When you set up a feed, you provide the URL that Airship will fetch personalization information from and request headers that Airship needs to communicate with the feed. You can also set a number of Object Locations, making it easier to reference properties in the feed response.

Your feed URL and request headers can include variables, providing flexibility to fetch data specific to a message, campaign, or individual audience members. Use square brackets in your feed URL ([[var]]) for values that you want to set at the message or campaign level, and standard HandlebarsHandlebars is Airship’s templating language for personalization. Handlebars expressions use double curly braces wrapped around a content template, ranging from a simple variable, e.g., {{first_name}} to complex evaluations of personalization data. ({{var}}) for audience variables — attributes, custom event properties, etc.

For example, if you might have a feed for which you set the category at the message level but also personalize for each member of your audience, your URL might look like this: https://api.example.com/[[category]]?{{user_id}}

Use Data Feeds to Personalize Messages

Use the Data Feed helper in our Visual Editor to reference feeds in templates and email and Message Center messages:

In any other message, you can add a #feed block to reference your data feed. You can use properties from your data feed in conjunction with other personalization sources, like attributes or custom event properties, helping you construct messages that resonate with every member of your audience.

{{#feed "featured_products" region="us" as |result|}}
Hi {{first_name}},

Based on your history, we think you'd be interested in:
  {{#each (limit result.products 2) as |product|}}
    {{product.name}}: {{product.price}}
    https://example.com/us/products/{{urlEncode product.slug}}/
    Our regular deals — https://example.com/us/products/featured/
Sign up to learn about featured products and deals!

In both cases, you can set variables and the error behavior for the feed in the Delivery step in the dashboard composers. Error behavior determines how Airship handles a message if the data feed fails.

For more information: