Sending to a target audience or segment via the Urban Airship API

Sending specific messages and content to a targeted audience is a great way to add value to your application as well as to increase engagement with your audience. Urban Airship's APIs allows you to target these segments in various ways.

Tags

If your application is setting tags within your app (either based on a user's content preference or behavior) you can use that tag to send a notification to only those users who have that particular tag.

Push to a tag with no tag group specified:

{
    "audience" : {
        "tag" : "Giants Fans"
    }
}

 

Additionally, you can set tags to devices via an API request to specified device identifiers and then send to those devices using those tags.

Push to a tag with a tag group specified:

{
   "audience": {
      "tag": "platinum-member",
      "group": "loyalty"
   }
}

 

Lists

We also provide a way to upload formatted Static Lists to use for segmentation. This allows you to use and create segmentation based on user info in your CRM/data warehouse. 

Push to a static list:

{
   "audience": {
      "static_list": "subscriptions"
   }
} 

 

Segments

Additionally, you can create Segments combining Tags and Lists with simple boolean logic. Once created, you can then select and send to all users who are included in that segment. To push to a segment via the API, you'll need the Segment ID, which can be found using the Segment Listing.

Push to a Segment. You must know the segment-id for the target Segment:

{
    "audience" : {
        "segment" : "<segment-id>"
    }
}

 

Related Content