API

LocationBox API

Campaign List

Campaign List Service gives campaign list with location and discount percentage based on criterias which you can find below.

A Campaign List request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=CampCampaignList&Typ=output_format
&Category=category



Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (CampCampaignList)
Typ: Response format. (XML or JSON)
Category: Category specification of Campaign.

Category Values

Elektronik
Giyim
Kozmetik
Market

Response Parameters


XML Response

response returns in XML format when the Typ parameter is set as "XML".

Below is an example for a POI Search request which is expected to return a response in XML format .

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=CampCampaignList&Typ=XML&
Category=Giyim&PoiId=1200005164


The response will be as following:

<response>
 <transactionid>LBS_196</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <items>
  <campaign>
   <id>343</id>
   <name>%40 indirim Takm elbise 199</name>
   <description>%40 indirim Takm elbise 199</description>
   <category>Giyim</category>
   <hot>1</hot>
   <startdate>2012-07-11 00:00:00</startdate>
   <enddate>2012-08-01 00:00:00</enddate>
   <brandid>596</brandid>
   <brandname>KILI</brandname>
   <productname>Takm Elbise</productname>
   <producttitle/>
   <productdetails/>
   <productpayment/>
   <productlistprice>0.0</productlistprice>
   <productprice>199.0</productprice>
   <discountpercent>40.0</discountpercent>
   <stockamount>0</stockamount>
   <imageurl1>
   http://www.locationbox.com.tr/images_camp/camp_343_1.jpg
   </imageurl1>
   </imageurl2>
   </imageurl3>
   <count>203</count>
  </campaign>

   ...

  </campaign>
 </items>
</response>

JSON Response

POI Search response returns in JSON format when the Typ parameter is set as "JSON".

Below is an example for a Campaign request which is expected to return a response in JSON format .

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=CampCampaignList&Typ=JSON&
Category=Giyim&PoiId=1200005164


The response will be as following:


{ "transactionid": "LBS_37476989", "status": 0, "items": [ { "id": 343, "name": "%40 indirim Takm elbise 199", "description": "%40 indirim Takm elbise 199", "category": "Giyim", "hot": "true", "startdate": "2012-07-11 00:00:00", "enddate": "2012-08-01 00:00:00", "brandid": 596, "brandname": "KILI", "productname": "Takm Elbise", "producttitle": "", "productdetails": "", "productpayment": "", "productlistprice": "0.0", "productprice": "199.0", "discountpercent": "40.0", "stockamount": "0", "imageurl1": "http://www.locationbox.com.tr/images_camp/camp_343_1.jpg", "imageurl2": "", "imageurl3": "", "imageurl4": "", "imageurl5": "", "count": 203 },

...

{ "id": 429, "name": "ekerlik", "description": "ekerlik", "category": "Market", "hot": "true", "startdate": "2012-07-17 00:00:00", "enddate": "2012-07-19 00:00:00", "brandid": 85, "brandname": "A101", "productname": "ekerlik", "producttitle": "ekerlik", "productdetails": "", "productpayment": "", "productlistprice": "1.95", "productprice": "1.95", "discountpercent": "0.0", "stockamount": "0", "imageurl1": "http://www.locationbox.com.tr/images_camp/camp_429_1.jpg", "imageurl2": "", "imageurl3": "", "imageurl4": "", "imageurl5": "", "count": 860 } ] }


transactionid: The id of response given by LocationBox Service. Every response can be tracked using transactionid when necessary.
status: Response format. (XML or JSON)

Status Codes
0 -- Success
1 -- Fail

errno: Error code
errdesc: Error definition

Error Codes
10001 Error processing your request. Please try again soon.
Cmd parameter is misspelled/not found.
10011 Error processing your request. Please check the Cmd parameter.
Cmd is not specified.
10012 Error processing your request. Please check the Key parameter.
Key is not specified.
10013 Error processing your request. Please check the Key parameter.
Key is invalid.
20012 No data found.