customisable counter
API: Feeds / API / Knowledge Base - Trafficspaces Support

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

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

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

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

Delete an existing feed


  • URL - http://<subdomain>.trafficspaces.com/resources/feeds/<feed_id>.<format>
  • Method - DELETE
  • Parameters - None
  • Response
    • Status - 200, if successful.

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>&lt;!--#config timefmt="%e%m%Y%H%m%S" --&gt; &lt;script language="JavaScript" src="http://ad.doubleclick.net/adj/www.mywebsite.com/boxe;tile=1;dcopt=ist;sz=728x90;ord=&lt;!--#echo var="DATE_LOCAL"--&gt;?" type="text/javascript"&gt;&lt;/script&gt; &lt;noscript&gt; &lt;a href="http://ad.doubleclick.net/jump/www.mywebsite.com/boxe;tile=1;sz=728x90;ord=&lt;!--#echo var="DATE_LOCAL"--&gt;?" target="_blank"&gt; &lt;img src="http://ad.doubleclick.net/ad/www.mywebsite.com/boxe;tile=1;sz=728x90;ord=&lt;!--#echo var="DATE_LOCAL"--&gt;?" width="728" height="90" border="0" alt=""&gt; &lt;/a&gt; &lt;/noscript&gt;</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>

Recent Discussions

25 Apr, 2012 05:25 PM
08 May, 2012 08:34 PM
02 May, 2012 11:13 PM