API

LocationBox API

Add User Region

Add User Region Service add special region that user wanted on database based on criterias which you can find below.

AddUserRegion request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegion&Typ=output_format&Id=regionid&Name=regionname
&Type=regiontype&Coors=coors


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (AddUserRegion)
Typ: Response format. (XML or JSON)
Id: ID of region.
Name: Name of region.
Type: Type of region.
String1...String9(optional): Available parameters for user data in string format.
Number1...Number9(optional): Available parameters for user data in number format.
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&Id=1&Name=SampleRegion
&Type=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&Id=1&Name=SampleRegion
&Type=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.

Add User Regions (Batch)

Add User Regions Service add multible special regions that user wanted on database based on criterias which you can find below.

AddUserRegions request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegions&Typ=output_format&DataType=data_type_format&Data=post_data


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (AddUserRegions)
Typ: Response format. (XML or JSON)
DataType: Data type format. (XML or JSON)
Data: Data to be posted.

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegions&Typ=output_format&DataType=XML&Data=post_data


Data to be posted should be like the following example.

<?xml version="1.0"?>
<userregions>
 <userregion>
  <id>1</id>
  <name>NameOfLine</name>
  <type>0</type>
  <coors>29.0606,40.9889,29.1609,40.9858,29.1624,40.9453,29.0606,40.9889</coors>
  <string1>StringValue</string1>
  <string2>StringValue</string2>
  <string3>StringValue</string3>
  <string4>StringValue</string4>
  <string5>StringValue</string5>
  <string6>StringValue</string6>
  <string7>StringValue</string7>
  <string8>StringValue</string8>
  <string9>StringValue</string9>
  <number1>4</number1>
  <number2>3</number2>
  <number3>0</number3>
  <number4>0</number4>
  <number5>0</number5>
  <number6>0</number6>
  <number7>0</number7>
  <number8>0</number8>
  <number9>0</number9>
 </userregion>
 <userregion>
  <id>2</id>
  <name>NameOfLine</name>
  <type>0</type>
  <coors>29.0606,40.9889,29.1609,40.9858,29.1624,40.9453,29.0606,40.9889</coors>
  <string1>StringValue</string1>
  <string2>StringValue</string2>
  <string3>StringValue</string3>
  <string4>StringValue</string4>
  <string5>StringValue</string5>
  <string6>StringValue</string6>
  <string7>StringValue</string7>
  <string8>StringValue</string8>
  <string9>StringValue</string9>
  <number1>4</number1>
  <number2>3</number2>
  <number3>0</number3>
  <number4>0</number4>
  <number5>0</number5>
  <number6>0</number6>
  <number7>0</number7>
  <number8>0</number8>
  <number9>0</number9>
 </userregion>
</userregions>

The response will be as following:

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

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegions&Typ=output_format&DataType=JSON&Data=post_data


Data to be posted should be like the following example.

{"userregions": [
    {
      "id": "1",
      "name": "NameOfRegion",
      "type": 99,
      "string1": "",
      "string2": "",
      "string3": "",
      "string4": "",
      "string5": "",
      "string6": "",
      "string7": "",
      "string8": "",
      "string9": "",
      "number1": 0,
      "number2": 0,
      "number3": 0,
      "number4": 0,
      "number5": 0,
      "number6": 0,
      "number7": 0,
      "number8": 0,
      "number9": 0,
      "coors": "29.0606,40.9889,29.1609,40.9858,29.1624,40.9453,29.0792,40.9631,29.0606,40.9889"
    },
    {
      "id": "2",
      "name": "NameOfRegion",
      "type": 99,
      "string1": "",
      "string2": "",
      "string3": "",
      "string4": "",
      "string5": "",
      "string6": "",
      "string7": "",
      "string8": "",
      "string9": "",
      "number1": 0,
      "number2": 0,
      "number3": 0,
      "number4": 0,
      "number5": 0,
      "number6": 0,
      "number7": 0,
      "number8": 0,
      "number9": 0,
      "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_41589", "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.

Add User Region By Union

Add User Region By Union Service add all special regions in one region that user wanted on database based on criterias which you can find below.

AddUserRegion request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=AddUserRegionByUnion&Typ=output_format&Id=regionid&Name=regionname
&Type=regiontype&IdList=regionidlist&Coors=coors


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (AddUserRegionByUnion)
Typ: Response format. (XML or JSON)
Id: ID of regions in the Idlist parameter.
Name: Name of region.
Type: Type of region.
IdList: List of FromType parameter (IL or ILCE or MAHALLE) ID's which get union.
FromType: You can just use IL, ILCE,MAHALLE for this parameter.
String1...String9 (optional): Available parameters for user data in string format.
Number1...Number9 (optional): Available parameters for user data in number format.
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=AddUserRegionByUnion&Typ=XML&Id=1&Name=SampleRegion
&Type=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=AddUserRegionByUnion&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.

Get User Region

Get User Region Service get special region that user wanted on map based on criterias which you can find below.

GetUserRegion request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GetUserRegion&Typ=output_format&Id=regionid&WithCoors=coordinates


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (GetUserRegion)
Typ: Response format. (XML or JSON)
Id: ID of region.
WithCoors: If value is 1, region coordinates data can be seen on response.

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GetUserRegion&Typ=XML&Id=1&WithCoors=1

The response will be as following:

<response>
 <transactionid>LBS_37538710</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <regionlist>
 <userregion>
  <id>1</id>
  <name>SampleRegion</name>
  <type>4</type>
  <string1>S1</string1>
  <string2>S2</string2>
  <string3/>
  <string4/>
  <string5/>
  <string6/>
  <string7/>
  <string8/>
  <string9/>
  <number1>111</number1>
  <number2>777</number2>
  <number3>0</number3>
  <number4>0</number4>
  <number5>0</number5>
  <number6>0</number6>
  <number7>0</number7>
  <number8>0</number8>
  <number9>0</number9>
  <latitude>40.9710025422803</latitude>
  <longitude>29.1195495847177</longitude>
 <extent>
  <minlatitude>0</minlatitude>
  <minlongitude>0</minlongitude>
  <maxlatitude>0</maxlatitude>
  <maxlongitude>0</maxlongitude>
 </extent>
 <coors> 29.0606,40.9889,29.1609,40.9858,29.1624,40.9453,29.0792,40.9631,...</coors>
 </userregion>
 </regionlist>
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=GetUserRegion&Typ=JSON&Id=1&WithCoors=1

The response will be as following:


{ "transactionid": "LBS_60616949", "status": 0, "regionlist": [ { "id": "2318", "name": "Test", "type": 99, "string1": "", "string2": "", "string3": "", "string4": "", "string5": "", "string6": "", "string7": "", "string8": "", "string9": "", "number1": 0, "number2": 0, "number3": 0, "number4": 0, "number5": 0, "number6": 0, "number7": 0, "number8": 0, "number9": 0, "latitude": 41.1009851346066, "longitude": 29.1004003817029, "extent": { "minlatitude": 41.0821399799999, "minlongitude": 29.0715508799948, "maxlatitude": 41.123025989998, "maxlongitude": 29.1270538800041 }, "coors": "29.0818501199999,41.0821399799999,29.1186219600006,41.0866559999995,29.1222568800016,41.088032999999,...,41.0821399799999" } ] }

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.

Remove User Region

Remove User Region Service remove special region that user wanted on database based on criterias which you can find below.

RemoveUserRegion request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=RemoveUserRegion&Typ=output_format&Id=regionid


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (RemoveUserRegion)
Typ: Response format. (XML or JSON)
Id: ID of region.

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=RemoveUserRegion&Typ=XML&Id=1

The response will be as following:

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

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=RemoveUserRegion&Typ=JSON&Id=1

The response will be as following:


{ "transactionid": "LBS_37572454", "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.

User Region List

User Region List Service lists special regions that user wanted on database based on criterias which you can find below.

UserRegionList request must look like this:

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=UserRegionList&Typ=output_format&WhereClause=whereclause&Detailed=detailed


Request Parameters


Key: LocationBox user key. (Register for user key)
Cmd: LocationBox service name. (UserRegionList)
Typ: Response format. (XML or JSON)
PointId (optional): UserRegion List interacting UserPoint Id.
Latitude (optional): UserRegion List interacting point of latitude.
Longitude (optional): UserRegion List interacting point of longitude.
Detailed (optional): Values greater than zero return the region list of the query in full detail. (Default value 0)
WhereClause (optional): Where clause in UserRegion List fields. Note: whereclause is requires single quotes around text values like this (country = 'USA')

Response Parameters


XML Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=UserRegionList&Typ=XML&WhereClause=&Detailed=5

The response will be as following:

<response>
 <transactionid>LBS_311312</transactionid>
 <status>0</status>
 <errno />
 <errdesc />
 <items>
 <item>
  <id>1</id>
  <name>Sample</name>
  <type>4</type>
 <extent>
  <minlatitude>40.9453</minlatitude>
  <minlongitude>29.0606</minlongitude>
  <maxlatitude>40.9889</maxlatitude>
  <maxlongitude>29.1624</maxlongitude>
 </extent>
 </item>
 <item>
  <id>2</id>
  <name>Sample2</name>
  <type>4</type>
 <extent>
  <minlatitude>40.1499535063903</minlatitude>
  <minlongitude>26.4262958130633</minlongitude>
  <maxlatitude>40.1502449094385</maxlatitude>
  <maxlongitude>26.4266551505644</maxlongitude>
 </extent>
 </item>
 <item>
  <id>3</id>
  <name>Sample3</name>
  <type>4</type>
 <extent>
  <minlatitude>40.150060771316</minlatitude>
  <minlongitude>26.4262743600781</minlongitude>
  <maxlatitude>40.1501984279707</maxlongitude>
  <maxlongitude>26.4267248727662</maxlongitude>
 </extent>
 </item>
 </items>
</response>

JSON Response

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

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

http://www.locationbox.com.tr/locationbox/services?Key=key&Cmd=UserRegionList&Typ=JSON&WhereClause=&Detailed=5

The response will be as following:


{ "transactionid": "LBS_37572902", "status": 0, "items": [ { "id": "1", "name": "Sample", "type": 4, "extent": { "minlatitude": 40.9453, "minlongitude": 29.0606, "maxlatitude": 40.9889, "maxlongitude": 29.1624 } }, { "id": "2", "name": "Sample2", "type": 4, "extent": { "minlatitude": 40.1499535063903, "minlongitude": 26.4262958130633, "maxlatitude": 40.1502449094385, "maxlongitude": 26.4266551505644 } }, { "id": "3", "name": "Sample3", "type": 4, "extent": { "minlatitude": 40.150060771316, "minlongitude": 26.4262743600781, "maxlatitude": 40.1501984279707, "maxlongitude": 26.4267248727662 } } } ] }

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.