Developer API - POI Engine
Synopsis
Search for points in the testbed (from Timbuktu)
http://www.nakdreality.com/search?lat=16.77&lon=-3.02&layer=nakdrealitytestbed
Add a point with only a title to the testbed (ensure a newline after "var_title"):
wget -qO- http://www.nakdreality.com/insert --post-data='user=test&pass=test&layer=nakdrealitytestbed&data="var_title"
"Hello Local World!"'
Delete a point on the testbed
http://www.nakdreality.com/delete?point_id=1&user=test&pass=test&layer=nakdrealitytestbed
Description
In addition to the user-interface for adding POI data, the POI engine has the following developer API consisting of simple web requests. Search and Delete can be performed with GET requests, and Insert can be performed with a POST request - demonstrated using the wget command-line utility from Unix - but you can make these calls with your favourite language instead.
Adding dataDeleting data
Searching data
Adding data:
Service URL:http://www.nakdreality.com/insert?
CGI parameters:
user=[YOUR SIGNUP EMAIL ADDRESS]
&pass=[YOUR PASSWORD]
&layer=[YOUR LAYER NAME]
&data=[CSV DATA FORMAT]
The data parameter uses the CSV text format, with the first line consisting of optional text field-names, and subsequent lines consisting of corresponding values for those fields.
There is a current size limit of 10M for any one insert command, so larger inserts should be cut into smaller chunks of 10M each.
We use Layar's format for the data content, to make it easier for developers targeting this popular augmented reality application for the iPhone and Android phones.
The 10 possible Layar data field-names are as follows:int_point_id, var_title, var_line_2, var_line_3, var_line_4, var_image, dec_latitude, dec_longitude, var_actions_label_1, var_actions_uri_1
Where:
int_point_id is a string. E.g., 1 = {A unique id for the POI within the layer, this is used to track the POI's when refreshing the list.} Typically this is best left out, because it will be filled automatically with an incrementing number.
var_title is a string of 60 characters (will be wrapped on two lines). E.g., Best restaurant in town = { The first line in Layar's Brief Info Widget (or "BIW" which is the bottom panel of information in Layar's AR view). }
var_line_2 is a string of 35 characters (no wrapping). E.g., Govindas Restaurant = { The second line in the BIW. }
var_line_3 is a string 35 characters (no wrapping). E.g., Soho Street = { The third line in the BIW. }
var_line_4 is a string 35 characters (no wrapping). E.g., London = { The fourth line in the BIW. }
var_image is a URL = { The location of the image to be displayed inside the BIW. If the image is too large, it will be resized to fit within a bounding box of 100x75 pixels, preserving aspect ratio. Pass null if empty. }
dec_latitude is an integer. E.g., 52.366260 = { The decimal GPS coordinate value for the POI with up to 6 decimal places. }
dec_longitude is an integer. E.g., -4.882420 = { The decimal GPS coordinate value for the POI with up to 6 decimal places. Can be negative. }
var_actions_label_1 is a call to action. E.g., See homepage = { A URI is invoked (see var_actions_uri_1 below) when the user clicks on this call to action. For Layar, 2 extra call to actions already exist: 'Take me there' and 'Lock in view' which fills up the screen. }
var_actions_uri_1 is a URL = { Possible URIs are "tel:", "sms:", "mailto:", "http://", "https://", "audio://", "video://" and custom app schemes. The specific client application for the URI will be launched. Except for the http://, https://, audio:// and video:// URIs which are displayed directly in the Layar app. }
The output from a successful insert consists of an XML file with a list of comma-delimited 'point_id' values created by the insert. For example after inserting 4 points simultaneously, the output might look like:
<?xml version="1.0" encoding="utf-8"?>
<nakdreality>
<status>success</status>
<ids>14,15,16,17</ids>
</nakdreality>
Insert Examples
E.g. to add a point with only a title to the testbed (ensure a newline after "var_title"):
wget -qO- http://www.nakdreality.com/insert --post-data='user=test&pass=test&layer=nakdrealitytestbed&data="var_title"
"Hello Local World!"'
E.g. to add a full point of data, without a specific ID:
wget -qO- http://www.nakdreality.com/insert --post-data='user=[YOUR E-MAIL]&pass=[YOUR PASSWORD]&layer=[YOUR LAYER NAME]&data="var_title","var_line_2","var_image","dec_latitude","dec_longitude","var_actions_uri_1"
"Test Imported Title","Imported text line 2","http://www.lightrod.org/light_rod_logo.png",50,0,"http://www.lightrod.org"'
E.g. To add four points containing just titles:
wget -qO- http://www.nakdreality.com/insert --post-data='user=[YOUR E-MAIL]&pass=[YOUR PASSWORD]&layer=[YOUR LAYER NAME]&data="var_title"
"1st point"
"2nd point"
"3rd point"
"4th point"'
Deleting data:
Service URL:http://www.nakdreality.com/delete?
CGI parameters:
user=[YOUR E-MAIL]
&pass=[YOUR PASSWORD]
&layer=[YOUR LAYER NAME]
Delete Example
E.g. to delete a point on the testbed
wget -qO- http://www.nakdreality.com/delete --post-data="point_id=1&user=test&pass=test&layer=nakdrealitytestbed"
Updating data consists of deleting a point, and then adding the modified point.
Searching data:
Service URL:http://www.nakdreality.com/search?
CGI parameters:
lat=[YOUR LATITUDE]
&lon=[YOUR LONGITUDE]
&layer=[YOUR LAYER NAME]
&start=0 (optional number of results to start at e.g. "10" will skip the first 10 results.)
&show=20 (optional number of results to show, otherwise 10 will be shown by default)
http://www.nakdreality.com/search?
Which returns a "Layar" format JSON array, which includes point IDs.
Search Example
E.g. Searching the testbed:
http://www.nakdreality.com/search
?lat=0
&lon=0
&layer=nakdrealitytestbed
