Content API
From api.bview.com
Contents |
Introduction
URL
The content API will be accessible through the following URL: http://www.bview.co.uk/app/frontend/ContentApi<QUERY-STRING>
Request parameters
NOTE: BView applies UTF-8 encoding to request parameter values.
| Parameter name | Required | Description |
| key | Yes | Your unique API key given to you by BView |
| listingId | One of mlUrn and listingId is required | A comma-separated list of BView IDs for the businesses you wish to retrieve the content for. We have two ID types, one is a 7 digit number, the other a 24 character String. You may use either as long as all in the list are the same format. |
| mlUrn | One of mlUrn and listingId is required | A comma-separated list of Market Locations URNs for the businesses you wish to retrieve content for. |
One of listingId and mlUrn must be specified, otherwise an INVALID_REQUEST error will be returned.
Output
The response will be an XML document that complies with the schema at http://www.bview.co.uk/xsd/content_api.xsd. The content API output has the following structure:
<bview-content>
<language></language>
<datum></datum>
<listings>
<listing>
…
</listing>
</listings>
</bview-content>
There are 0 to many listing nodes under the listings node. A listing node may contain the following elements:
| Element | Description |
| id | A unique ID for this listing. |
| ml-urn | The Market Locations ID for this listing. |
| description | A description of the listing. |
| description-title | A title for the description of the listing. |
| products | This will contain 1 to 4 brief Strings describing the products / services offered by the listing. |
| address | |
| address > addr1 | Lines 1, 2 and 3 of the street address of the listing. |
| address > addr2 | |
| address > addr3 | |
| address > city | City. |
| address > province | County. |
| address > postal-code | Postcode |
| country | Country code (two letter version, i.e. GB) |
| latitude | The latitude of the business in WGS84 format. |
| longitude | The longitude of the business in WGS84 format. |
| phone | phone number |
| website | Web address |
| voucher (0 to many) | This contains all the active promotions for the listing. The voucher is in the same format as the voucher element described above in the promotions API. |
| image (0 to many) | This contains all the images for the listing. This will have the attributes url and url-thumbnail (a 90x90 cropped thumbnail). It may also contain a title describing the
image and a link back to the page containing the image on BView (the business page). |
| review (0 to many) | This contains all the reviews for the listing. A review contains the following elements: |
| review > id | A unique ID for the review. |
| review > link | A link back to the review on BView. |
| review > title | The title of the review. |
| review > user | The user who wrote the review (assuming it was not anonymous). A user contains an ID, a name and a link to that user’s profile on BView. |
| review > rating-overall | The overall decimal rating out of 5 given by the reviewer. |
| review > rating-quality | The decimal rating out of 5 given by the reviewer for quality. |
| review > rating-reliability | The decimal rating out of 5 given by the reviewer for reliability. |
| review > rating-value | The decimal rating out of 5 given by the reviewer for value. |
| review > pros [deprecated] | The entire text for the review (note this is deprecated and will soon be called text). |
| review > cons [deprecated] | Always empty, soon to be removed from the API. |
| review > date | The date the review was written, with three attributes, month (January = 1, February = 2 etc), day and year |
| review > image (0 to 3) | 3 |
Errors
If there is an error processing the request, the listings node (for the content API) or vouchers node (for the promotion API) will be replaced by an error-code element containing either INVALID_REQUEST or AUTHENTICATION_ERROR (if the key was not valid).
Samples
Request for two listings
<?xml version="1.0" encoding="UTF-8"?>
<bview-content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.bview.co.uk/xsd/content_api.xsd">
<language>en</language>
<datum>WGS84</datum>
<listings>
<listing>
<id>2392205</id>
<name>CurvyU</name>
<address>
<addr1>Unit 3</addr1>
<addr2>Bensons Court</addr2>
<addr3>Nelson Street</addr3>
<city>Chepstow</city>
<province>Monmouthshire</province>
<postal-code>NP16 5HT</postal-code>
</address>
<country>GB</country>
<latitude>51.64213133887068</latitude>
<longitude>-2.673813126763205</longitude>
<phone>01291 630346</phone>
<website>http://www.curvyu.co.uk</website>
<review>
<id>00034659</id>
<link>http://www.bview.co.uk/r/00034659</link>
<title>Plus Size Ladies Fashion</title>
<rating-overall>4.33</rating-overall>
<rating-quality>4.0</rating-quality>
<rating-reliability>4.0</rating-reliability>
<rating-value>5.0</rating-value>
<pros>Pros: Good Selection, Great Prices</pros>
<date month="3" day="9" year="2009"/>
</review>
<voucher>
<id>UFrn0soEGltjTjDDAvFrv7SO</id>
<voucherType>SME_VOUCHER</voucherType>
<link>http://www.bview.co.uk/listing/2392205/CurvyU-in-NP16</link>
<directLink>http://www.bview.co.uk/app/frontend/SmeVoucher?pid=UFrn0soEGltjTjDDAvFrv7SO&lid=0IP9m25SfQQxJhiWwsw_cMsv
</directLink>
<title>10% OFF Your First Order</title>
<text>Limited to one per Customer.
Just Add TQU6T8 during checkout
</text>
<savingType>10% off</savingType>
<image url="http://www.bview.co.uk/static/ugc/images/promotion/e-/e-wAjm_hP4erjd9I9wSwCKG4.jpg"
url-thumbnail="http://www.bview.co.uk/static/ugc/images/promotion/e-/tn_e-wAjm_hP4erjd9I9wSwCKG4.jpg"></image>
</voucher>
</listing>
<listing>
<id>2384528</id>
<name>TJ Hughes</name>
<address>
<addr1>10 Cole Street</addr1>
<city>Scunthorpe</city>
<province>Lincolnshire</province>
<postal-code>DN15 6QZ</postal-code>
</address>
<country>GB</country>
<latitude>53.59126969873895</latitude>
<longitude>-0.6468143531511761</longitude>
<phone>0845 605 0515</phone>
<website>http://www.tjhughes.co.uk</website>
<review>
<id>00022766</id>
<link>http://www.bview.co.uk/r/00022766</link>
<title>All rounder</title>
<user>
<id>JB6R9b8PlpM41ucE3hNTt-qo</id>
<name>Kym D</name>
<link>http://www.bview.co.uk/app/frontend/UserProfile?id=JB6R9b8PlpM41ucE3hNTt-qo</link>
</user>
<rating-overall>4.67</rating-overall>
<rating-quality>5.0</rating-quality>
<rating-reliability>5.0</rating-reliability>
<rating-value>4.0</rating-value>
<pros>Pros: TJ Hughes is one of those stores that really performes and delivers everything that it sets out to.
IT's a real mix of items and everything is so beautifully laid out that it really is a pleasure to browse.
For those who are tired after - theya lso have a fantastic cafe that serves cheap but cheerful and tasty grub!
If you do visit, be prepared to spend a couple of hours wandering round - we went in 'just to look' and came
out having spent a substational amount of time and money!
</pros>
<date month="8" day="27" year="2008"/>
<image url="http://www.bview.co.uk/static/ugc/images/reviews/0J/srk950K5v7bm0GNKR_vIRHyC.jpg"
url-thumbnail="http://www.bview.co.uk/static/ugc/images/reviews/0J/srk950K5v7bm0GNKR_vIRHyC_tn.jpg">
<link>http://www.bview.co.uk/r/00022766</link>
</image>
</review>
</listing>
</listings>
</bview-content>
Invalid request
<?xml version="1.0" encoding="UTF-8"?>
<bview-content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.bview.co.uk/xsd/content_api.xsd">
<language>en</language>
<datum>WGS84</datum>
<error>
<error-code>INVALID_REQUEST</error-code>
</error>
</bview-content>
