Accessing Approved Content

Along with the vehicle data the API also gives you access to the latest news, events and special offers.

The API for this section has a wider variety of filtering abilities, these will be covered later on.

To start with, you will need to pick what content to fetch. This will determine the start point of your request.

content_type is explained below

Available Data

The API has data on the following:

NOTE: All content types have their content_type listed next to them within ().

Accessing the Data

Once you have decided what content type you want, you can start to manipulate the results by adding more parameters to the URL structure.

Data is returned with the most recent article first.

Listing All

Typically the URL will be something like:

http://your_token.imwww.co.uk/content_type/all.xml

This will return everything that is available for the content_type you have specified.

Limiting How Many Results Are Returned

Over time the list of everything will become substantial, so it is advisable to restrict the number of results the API will return. There is no need for you to have hundreds of articles when you only want the last 10!

There are two ways to do this; pagination or limits.

Pagination

Here you specify page_number and per_page parameters. Say you want to return the second page with 15 results on a page; you would something like this:

http://your_token.imwww.co.uk/content_type/page/2/per_page/15.xml

This gives you great flexibility and lets you pull data from anywhere within the available data.

Limits

If you simply want the last 10 articles then pagination is probably excessive. Instead you can use a limit.

http://your_token.imwww.co.uk/content_type/limit/10.xml

Minimal Data

With listings like those mentioned above a large amount of data is transferred around. As with vehicles you can the use minimal parameter.

http://your_token.imwww.co.uk/content_type/all/minimal.xml

The information returned from a minimal call for all approved content is:

If you need to fetch more data about any item returned, you can use the permalink value returned to get everything about that particular article.

Details

If you have used the minimal parameter or you know the unique identifier for the article you are looking for you can use the details parameter and return all the details about that particular article.

http://your_token.imwww.co.uk/content_type/details/unique_ident.xml

unique_ident can either be id or url.

Like the vehicles you can fetch details about more than one article at the same time; simply pass along more than one unique_ident.

http://your_token.imwww.co.uk/content_type/details/unique_ident_a/unique_ident_b.xml

Less and More

If you are doing something a little bit more complicated (say synchronising your websites database with the API) then these are very useful.

By simply passing along less followed by a numeric identifier (id in the results) you will get everything that is less than or equal to that value.

http://your_token.imwww.co.uk/content_type/less/id.xml

More will return all articles greater than or equal to.

http://your_token.imwww.co.uk/content_type/greater/id.xml

If you need any more functionality please feel free to contact us on 07805 800 326 and see if we can help.