Here is a sample query:
http://feed.linksynergy.com/target?token=94e973c41fe2c696de23a111b91b6182ae73cf3ee4dddb0eefa0091c266cc5ea&mid=111&height=200&width=100&count=10&url=www.linkshare.com
Name-Value Pairs
Publisher Token [token=94e973c41fe2c696de23a111b91b6182ae73cf3ee4dddb0eefa0091c266cc5ea]
This is the Web services token that is generated on the Web Services page under the Links tab. It is used to authenticate publishers.
Advertiser (MID) [mid=111]
This parameter specifies the advertiser (MID) whose products will populate the ad unit. It is found by clicking Advertiser Info on the advertiser's page on the Publisher Dashboard.
Height [height=200]
This parameter allows you to specify the height of a product image in the ad unit. It is an optional value and must be a whole number, 1,000 or lower.
Width [width=100]
This allows you to specify the width of a product image in the ad unit. It is an optional value and must be a whole number, 1,000 or lower.
Count [count=10]
This is the number of products the query will return. This must be a positive number between 0 and 15.
URL [url=www.linkshare.com]
This parameter is the URL of your Web page, the content of which is used for contextual product selection. It is an optional value. If your URL is omitted, the referral URL will be used. If the referral URL is not available, then the keywords for your category will be used for selection.
XML Samples
The Targeted Merchandiser API will respond to requests with an XML document.
Here is a sample XML schema:
<?xml version="1.0" encoding="UTF-8"?>
<schema
targetNamespace=http://www.linkshare.com/namespaces/targeted-merchandiser-1.0
elementFormDefault="qualified"
xmlns=http://www.w3.org/2001/XMLSchema
xmlns:tns="http://www.linkshare.com/namespaces/targeted-merchandiser-1.0">
<annotation>
<documentation>XML Schema for the response returned by the LinkShare Targeted
Merchandiser API.</documentation>
</annotation>
<element name="result" type="tns:result"></element>
<complexType name="result">
<choice>
<group ref="tns:ProductResultsGroup"></group>
<element name="Errors" type="tns:ErrorsType" maxOccurs="1"minOccurs="0">
</element>
</choice>
</complexType>
<complexType name="ErrorsType">
<sequence>
<element name="ErrorID" type="int">
<annotation>
<documentation>Unique ID for error type</documentation>
</annotation></element>
<element name="ErrorText" type="string">
<annotation>
<documentation>Text describing error</documentation>
</annotation></element>
</sequence>
</complexType>
<group name="ProductResultsGroup">
<sequence>
<element name="TotalMatches" type="int" minOccurs="1"maxOccurs="1">
<annotation>
<documentation>The total number of matching products</documentation>
</annotation>
</element>
<element name="item" type="tns:itemType" minOccurs="0" maxOccurs="15" />
</sequence>
</group>
<complexType name="itemType">
<sequence>
<element name="mid" type="int">
<annotation>
<documentation>Advertiser's unique Merchant ID (MID)</documentation>
</annotation>
</element>
<element name="merchantname" type="string">
<annotation>
<documentation>Advertiser's Name</documentation>
</annotation>
</element>
<element name="sku" type="string">
<annotation>
<documentation>Product SKU</documentation>
</annotation>
</element>
<element name="productname" type="string"></element>
<element name="category" type="tns:categoryType">
<annotation>
<documentation>Product Name</documentation>
</annotation>
</element>
<element name="price" type="tns:priceType">
<annotation>
<documentation>Retail price for the product</documentation>
</annotation>
</element>
<element name="upccode" type="string">
<annotation>
<documentation>UPC for Product</documentation>
</annotation>
</element>
<element name="description" type="tns:descriptionType">
<annotation>
<documentation>Product description</documentation>
</annotation>
</element>
<element name="keywords" type="string">
<annotation>
<documentation>Keywords associated with this product by the
Advertiser</documentation>
</annotation>
</element>
<element name="clickurl" type="string">
<annotation>
<documentation>LinkShare Click URL for this product</documentation>
</annotation>
</element>
<element name="adurl" type="string">
<annotation>
<documentation>URL for the product image, proportionally-scaled scaled fit
within the specfied width and height. The unscaled, origninal image URL if size
not specified.</documentation>
</annotation>
</element>
<element name="impressionurl" type="string">
<annotation>
<documentation>LinkShare ad 1X1 pixel image URL to track the impressions for
this product</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="categoryType">
<sequence>
<element name="primary" type="string">
<annotation>
<documentation>Advertiser-defined primary category</documentation>
</annotation>
</element>
<element name="secondary" type="string">
<annotation>
<documentation>Advertiser-defined secondary category</documentation>
</annotation>
</element>
</sequence>
</complexType>
<complexType name="priceType">
<simpleContent>
<extension base="string">
<attribute name="currency" type="string">
<annotation>
<documentation>Currency code for the currency type of the price (e.g."USD"
for US Dollar)</documentation>
</annotation>
</attribute>
</extension>
</simpleContent>
</complexType>
<complexType name="descriptionType">
<sequence>
<element name="short" type="string">
<annotation>
<documentation>Short product description</documentation>
</annotation>
</element>
<element name="long" type="string">
<annotation>
<documentation>Long product description</documentation>
</annotation>
</element>
</sequence>
</complexType>
</schema>
Query Response
The results are returned to you in XML. The response to a successful query includes the total matches and the results. The response to a failed query will include the appropriate error message. Errors are discussed below.
Here is a sample response:
<source lang="xml">
<?xml version="1.0"?>
<result>
<TotalMatches>25</TotalMatches>
<item>
<mid>1145</mid>
<merchantname>J&R Computer/Music World</merchantname>
<sku>BKN F8V308-12</sku>
<productname>Belkin F8V308 12-Foot PRO Gold Series S-Video
Cable</productname>
<category>
<primary>Video & TV</primary>
<secondary>Video - TV ~~ Accessories ~~ Cables and Connectors</secondary>
</category>
<price currency="USD">6.99</price>
<upccode>722868335253</upccode>
<description>
<short>A top shelf 12 foot shielded S-Video cable with gold-plated
terminator pins / Perfect for high resolution image technologies</short>
<long>Hundreds of Munchkins can't be wrong, at least not when they're
urging travellers to "Follow the yellow brick road" Gold delivers the
signal cleanly and truly every time With this 12-foot Belkin PRO Gold
Series Cable, you can connect camcorders, satellite dish receivers, DVD
players or any video source with S-video (4-pin mini DIN) </long>
</description>
<keywords>Video - TV ~~ Accessories ~~ Cables and Connectors ~~
Cables</keywords>
<clickurl>http://click.linksynergy.com/fs-bin/click?
id=KgGHO0LswUU&offerid=101744.1141877&type=23</click
url><adurl>http://m.adscale.linksynergy.com/product/120x120/1145/1141877
</adurl>
<impressionurl>http://ad.linksynergy.com/show
id=101744.1141877&type=23</impressionurl>
</item>
</result>
</source>
Note: Indentation was added here for readability; the actual XML response will not be indented.
Errors
This element gives you the details of any errors returned. It will exist only if there are one or more errors. This table includes the error messages that can be returned.
|
Message |
Possible Updates |
Error Number |
|
The link provided is formatted incorrectly. |
Please check the link format against the sample in this document, and try again. |
7187041 |
|
No token ID was provided. |
Include token ID and resubmit query. |
7187042 |
|
The token ID is invalid. |
Please check token ID. |
7187043 |
|
The publisher is not joined to this advertiser. |
Try an advertiser you have a relationship with. |
7187044 |
|
No advertiser exists with this MID. |
Make sure that the advertiser MID is correct. |
7187045 |
|
No advertiser ID was provided. |
Please include advertiser ID in query and resubmit. |
7187046 |
|
Targeted Merchandiser API is not enabled for this advertiser. |
Try an advertiser enabled for this API. |
7187047 |
|
You are not enabled to use Targeted Merchandiser API for this advertiser. |
Select another advertiser and resubmit query. |
7187048 |
|
LinkShare system error 85439. |
LinkShare system error. Please try again. |
7187049 |
|
You can only request the top 15 product matches. |
Make sure count parameter is 15 or less. |
7187050 |
