API: Feeds
A Feed resource describes the attributes of a 3rd party ad source (i.e. an ad server or ad network) from which ads can be retrieved when self-service or directly sold ads are not available.
Supported Methods
| URI | GET | POST | PUT | DELETE |
|---|---|---|---|---|
| /resources/feeds/ | List | Create | - | - |
| /resources/feeds/<feed_id>.<format> | Read | - | Update | Delete |
List feeds
- URL -
http://<subdomain>.trafficspaces.com/resources/feeds/ - Method -
GET - Parameters -
- page - (unsigned, optional) an integer value that specifies which page of results to fetch, starting at 1. Default: 1. Minimum: 1.
- pagesize - (unsigned, optional) how many results to fetch in each request. Default: 25. Maximum: 100
- Response
- Status -
200, if successful. - Body - A collection of up to pagesize feeds in the requested format
- Status -
Read a feed
- URL -
http://<subdomain>.trafficspaces.com/resources/feeds/<feed_id>.<format> - Method -
GET - Parameters - None
- Response
- Status -
200, if successful. - Body - The requested feed in the requested format
- Status -
Create a new feed
- URL -
http://<subdomain>.trafficspaces.com/resources/feeds/ - Method -
POST - Parameters - XML or JSON data. See the Attributes below
- Response
- Status -
201, if successful. - Body - The created feed in the requested format
- Headers
- Location - A relative URL for the newly created feeds
- Status -
Update an existing feed
- URL -
http://<subdomain>.trafficspaces.com/resources/feeds/<feed_id>.<format> - Method -
PUT - Parameters - XML or JSON data. See the Attributes below
- Response
- Status -
200, if successful. - Body - The updated feed in the requested format
- Status -
Delete an existing feed
- URL -
http://<subdomain>.trafficspaces.com/resources/feeds/<feed_id>.<format> - Method -
DELETE - Parameters - None
- Response
- Status -
200, if successful.
- Status -
Attributes
- feed - (object, rwa)
- id - (string, r) the alphanumeric unique identifier
- name - (string, rwa) the display name in the ad store.
- width - (unsigned, rw) the display width of the ad feed.
- height - (unsigned, rw) the display height of the ad feed.
- channel - (string, rwa, optional) the code that denotes the default category / channel of the ad feed. For the full list of category codes, download the category configuration from your ad store.
- provider - (string, rwa) the code that denotes
the type of ad feed. Valid values include
- default - Generic ad feed
- ad_tag - (string, rwa) the code that describes or
implements the ad call to the 3rd party ad server. There are three
types of ad tag
- html - these include Javascript tags and valid HTML tag. Such tags must be prefixed with < character
- http - these are absolute HTTP URLs to any external resource. Such tags must be prefixed with either http:// or https://
- api - these are specifications of how to make an API call to a 3rd party HTTP service. Such tags must be be a valid JSON object with at valid values for at least the url and method keys.
- realm - (string, r) the subdomain name of the ad store
- creation_date - (datetime, r) the date on which the feed was created.
- last_modified_date - (datetime, r) the date on which the feed was last modified.
- linked_user - (object, rw)
- id - (string, rw) the alphanumeric unique identifier of the user that created the feed
- name - (string, r) the username of the user that created the feed
Examples
Feed - JSON
{
"id": "150aab80",
"name": "My House Ad",
"width": 728,
"height": 90,
"channel": "",
"provider": "generic",
"ad_tag": "http://www.mywebsite.com/defaultad.jpg",
"realm": "demo",
"creation_date": "1970-01-01T00:00:00",
"last_modified_date": "1970-01-01T00:00:00",
"linked_user": {
"id": "0937111d0e6b33150a0e6f66",
"name": "admin@mywebsite.com"
}
}
Feed - XML
<?xml version="1.0" encoding="UTF-8"?>
<feed>
<id>150a6666</id>
<name>My Doubleclick Feed</name>
<width>728</width>
<height>90</height>
<channel>sports</channel>
<provider>generic</provider>
<ad_tag><!--#config timefmt="%e%m%Y%H%m%S" --> <script language="JavaScript" src="http://ad.doubleclick.net/adj/www.mywebsite.com/boxe;tile=1;dcopt=ist;sz=728x90;ord=<!--#echo var="DATE_LOCAL"-->?" type="text/javascript"></script> <noscript> <a href="http://ad.doubleclick.net/jump/www.mywebsite.com/boxe;tile=1;sz=728x90;ord=<!--#echo var="DATE_LOCAL"-->?" target="_blank"> <img src="http://ad.doubleclick.net/ad/www.mywebsite.com/boxe;tile=1;sz=728x90;ord=<!--#echo var="DATE_LOCAL"-->?" width="728" height="90" border="0" alt=""> </a> </noscript></ad_tag>
<realm>demo</realm>
<creation_date>1970-01-01T00:00:00</creation_date>
<last_modified_date>1970-01-01T00:00:00</last_modified_date>
<linked_user>
<id>0937111d0e6b33150a0e6f66</id>
<name>admin@mywebsite.com</name>
</linked_user>
</feed>