API

LocationBox API

Add User Region

AddUserRegion request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegion&Typ=output_format&RegionId=regionid&RegionName=regionname
&RegionType=regiontype&Coors=coors


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (AddUserRegion)
Typ: Response format. (XML or JSON)
RegionId: ID of region.
RegionName: Name of region.
RegionType: Type of region.
Coors: Coordinates of region corners.

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegion&Typ=XML&RegionId=1&RegionName=SampleRegion
&RegionType=4&Coors=29.0606,40.9889,29.1609,40.9858,29.1624,40.9453,29.0792,40.9631,29.0606,40.9889


The response will be as following:

<response>
 <transactionid>LBS_37538770</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegion&Typ=JSON&RegionId=1&RegionName=SampleRegion
&RegionType=4&Coors=29.0606,40.9889,29.1609,40.9858,29.1624,40.9453,29.0792,40.9631,29.0606,40.9889


The response will be as following:


{ "transactionid": "LBS_37538773", "status": 0 }

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.