API

LocationBox API

On Route

On Route Service gives information about location is on route or not based on criterias which you can find below.

A On Route request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=OnRoute&Typ=output_format
&Latitude=latitude&Longitude=longitude&PathId=pathid&Distance=distance



Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (OnRoute)
Typ: Response format. (XML or JSON)
Latitude: Latitude of location.
Longitude: Longitude of location.
PathId: PathID of route. (Check out for routing.)
Distance: The distance of the area bounding for route control result.

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=OnRoute&Typ=XML
&Latitude=40.9815&Longitude=29.0967&PathId=3500529&Distance=10000


The response will be as following:

<response>
 <transactionid>LBS_37517422</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <result>1</result>
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=OnRoute&Typ=JSON
&Latitude=40.9815&Longitude=29.0967&PathId=3500529&Distance=10000


The response will be as following:


{ { "transactionid": "LBS_37517433", "status": 0, "result": true }

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

result:
0: Not On Route
1: On Route

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.