External Data Feeds references

A push request property specifying which External Data Feeds should be invoked and with what parameters in order to support personalization from feed content.

Feed references object

An object used to indicate that an external data feed should be invoked, the name of the feed to invoke, and the way in which to invoke it. You can only include a feed if you include a templates object in the payload or set the personalization option to true.

Jump to examples ↓

OBJECT PROPERTIES
  • defaults object

    Default parameter values for your feed. These values override any defaults you set for your feed in the Airship Dashboard.

  • feeds array[object]REQUIRED

    An array of feeds that you want to use to personalize your message.

Used in:

Examples

Example push external data feeds request

POST /api/push HTTP/1.1
Authorization: Basic <master authorization string>
Accept: application/vnd.urbanairship+json; version=3
Content-Type: application/json

 {
    "device_types": ["ios"],
    "audience": { "tag": "earlyBirds" },
    "notification": {
       "alert": "{{#feed \"featured_product\"}}Hello, {{user}}, could I interest you in {{product_name}} today?{{/feed}}"
    },
    "options": {
       "personalization": true
    },
    "feed_references": {
       "feeds": [
          {
             "name": "featured_product"
          }
       ],
       "defaults": {
          "featured_product": {
             "category": "featured"
          }
       }
    }
 }
HTTP/1.1 202 Accepted
Content-Type: application/vnd.urbanairship+json; version=3
Content-Length: 123
Data-Attribute: push_ids

{
    "ok": true,
    "operation_id": "5e7852b0-6909-4e60-a73f-4d6b92d94c80",
    "push_ids": [
       "bf28d158-fefe-475a-9c2a-ed4f69cc891e"
    ]
}   

Example feed references object

{
   "feed_references": {
      "feeds": [
         {
            "name": "featured_product",
            "params": {
               "sub_category": "shoes"
            },
            "on_error": "continue"
         }
      ],
      "defaults": {
         "featured_product": {
            "category": "featured"
         }
      }
   }
}