Entries with tag howto .

Retrieving all available programs via the Publisher API 2011

The end of last year marked the end-of-life and end of support for the 2009 version of the zanox Publisher API. Applications and tools, based on this API had to be migrated to use the newer – the 2011 version. Some helper tools that we have built for you at zanox will not be migrated, however, as we have made same data and functionality available in the newer version of the API.

Update: Please take a look at our new API-Widget. All Publisher Api Methods are available for testing in an easy to use Interface. Visit the Widget here.

Step 1: get your API credentials
To do that, just login into zanox marketplace and under “Links & Tools” click on the Web Services API > Getting Started.

On the Getting Started page, you will see your Connect ID and Secret Key, those are your API credentials. To retrieve the program list, you will only need your Connect ID.

Step 2: retrieve the program list
Insert your Connect ID into the following link (remove the curly brackets) and use it to retrieve the program list.
http://api.zanox.com/xml/2011-03-01/programs?connectid={Your Connect ID}&items=50&page=0

The result will be the first 50 programs and program details from the zanox program list in XML. 50 is the maximum number of items that our API can return in one page. The response will also include the total number of items:

<SearchProgramsResponse xmlns="http://api.zanox.com/namespace/2011-03-01/">
<page>0</page>
<items>50</items>
<total>2508</total>
...
</SearchProgramsResponse>

First page number is zero. To see the next result page use the pagequery parameter in the URL, as highlighted below:
http://api.zanox.com/xml/2011-03-01/programs?connectid={Your Connect ID}&items=50&page=1

You will have to write a small script to iterate through pages to retrieve the full list of programs. The results are available in XML or JSON. The response type is in the URL as highlighted below. This example would return JSON:

http://api.zanox.com/json/2011-03-01/programs?connectid={Your Connect ID}&items=50&page=1

So there you have it!