API

LocationBox API

Add Service Area

AddServiceAreaToUserRegion service creates special area for user based on parameters below.

AddServiceAreaToUserRegion request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddServiceAreaToUserRegion&Typ=output_format&RegionName=regionname
&Latitude=latitude&Longitude=longitude&NetworkType=networktype&Duration(Distance)=duration(distance)


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (AddServiceAreToUserRegion)
Typ: Response format. (XML or JSON)
Id: ID of region.
Name: Name of region.
Latitude: Latitude of service area center point.
Longitude: Longitude of service area center point.
String1...String9: Available parameters for user data in string format.
Number1...Number9: Available parameters for user data in number format.
Network Type:
1 - Pedestrian (Distance)
2 - Pedestrian (Duration)
3 - Short (Distance)
4 - Fast (Duration)
Distance or Duration:
NetworkType = 1 & 3 : Distance (max value: 3000 metres)
NetworkType = 2 & 4 : Duration (max value: 3.5 minute)

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddServiceAreaToUserRegion&Typ=XML&Name=ServiceArea&Latitude=40.95154&Longitude=29.06991&NetworkType=3&Distance=2000

The response will be as following:

<response>
 <transactionid>LBS_38182810</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <id>604</id>
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddServiceAreaToUserRegion&Typ=JSON&RegionName=ServiceArea&Latitude=40.95154&Longitude=29.06991&NetworkType=3&Distance=2000

The response will be as following:

{ "transactionid": "LBS_38182848", "status": 0, "id": "606" }

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.