Urban Airship has a feature where we will monitor an RSS or Atom feed and send a push notification when a new entry is published. We allow you to set up a template to extract items from the feed to dynamically generate push notifications with content from the new entry. You can easily set this up from the interface at https://go.urbanairship.com/ , but this API allows you to programmatically create them.
All endpoints here are authenticated with the Application Key and Application Master Secret. For security reasons, do NOT embed the Application Master Secret within an application that is distributed.
All URLs here are based at https://go.urbanairship.com/ (e.g., https://go.urbanairship.com/api/feeds/).
New: RSS to Push now supports the full push payload; formerly, it was just for full broadcasts.
Perform an HTTP POST to /api/feeds/ with a content-type of application/json/ and a body with JSON data containing information about your request.
We only require two things be present in the data: the feed URL you wish to follow and your feed template.
We recommend checking the template with our feeds interface to see exactly how it performs.
If, when a feed item comes in, the resulting payload is too long, we will automatically truncate it to fit.
Example POST:
{
"feed_url": "http://example.com/atom.xml",
"template": {
"aps": {
"badge": 1,
"sound": "cat.caf",
"alert": "New item from some place! {{ title }}"
}
},
"broadcast": true
}
The response will include information about the feed, including the URL where you can access it.
Example response:
{
"url": "https://go.urbanairship.com/api/feeds/<feed_id>/",
"id": "<feed_id>",
"last_checked": null,
"feed_url": "http://example.com/atom.xml",
"template": {
"aps": {
"badge": 1,
"sound": "cat.caf",
"alert": "New item from some place! {{ title }}"
}
},
"broadcast": true
}
Perform an HTTP GET to /api/feeds/ to get a list of feed items. A successful response will have an HTTP 200 status code and the body will be JSON data with a list of your feeds.
Example response:
[
{
"url": "https://go.urbanairship.com/api/feeds/<feed_id>/",
"template": {
"aps": {
"badge": 1,
"alert": "New item from Somewhere - {{ title }}"
}
},
"id": "<feed_id>",
"last_checked": "2010-03-08 22:52:21",
"feed_url": "<your_feed_url>",
"broadcast": true
},
{
"url": "https://go.urbanairship.com/api/feeds/<feed_id>/",
"template": {
"aps": {
"badge": 1,
"alert": "New update from Someplace! - {{ title }}"
},
"tags": ["some", "tag"]
},
"id": "<feed_id>",
"last_checked": "2010-03-08 21:52:21",
"feed_url": "<your_feed_url>",
"broadcast": false
}
]
You can then see the detailed information about a single feed by following its link in the response, or by going to it directly.
last_checked contains the last time we saw a new entry for this feed. The time zone is UTC.
An HTTP GET to /api/feeds/<feed_id>/ will return information about that particular feed. A successful response will have an HTTP status code of 200 and the body will be JSON data with a dictionary containing information about your feed.
Example response:
{
"url": "https://go.urbanairship.com/api/feeds/<feed_id>/",
"template": {
"aps": {
"badge": 1,
"alert": "New update from Someplace! - {{ title }}"
}
},
"id": "<feed_id>",
"last_checked": "2010-03-08 21:52:21",
"feed_url": "<your_feed_url>",
"broadcast": true
}
last_checked contains the last time we saw a new entry for this feed. The time zone is UTC.
To update an existing feed, perform an HTTP PUT to its URL with the updated information. You must include both the feed_url and template. A successful response will have an HTTP 200 status code. If “broadcast” is not included in the payload, it will be set to false.
To remove an existing feed, perform an HTTP DELETE to its URL. The response will have an HTTP status code of 204.