Project

General

Profile

GeTS API » History » Revision 12

Revision 11 (Никита Давыдовский, 12/01/2013 09:58 PM) → Revision 12/13 (Никита Давыдовский, 12/19/2013 12:52 PM)

h1. GeTS API 

 API based on HTTP protocol and YMapsML language. 

 {{toc}} 

 h2. Points 

 h3. Add point 

 Adds one or several points into database. 

 *Request should be http://kappa.cs.karelia.ru/~davydovs/gets/addPoints.php* 

 Request: 
 <pre> 
 <request token="%token%" isPublic="%true/false%" channel="%channel%"> 
   <point> 
     <!-- points in Yandex format --> 
   </point> 
 <request> 
 </pre> 

 Params: 
 * %token% - user's token (see function *login*) 
 * %true/false% - true if point should be in public space, otherwise - false 
 * %channel% - the name of user's channel or name of category channel 
 * list of points 

 Response: 
 <pre> 
 <response> 
 %message% 
 %error% 
 <response> 
 </pre> 

 h3. Remove point 

 h3. Load points 

 Loads points for circle defined by given: category, radius, latitude and longitude; or radius, latitude and longitude; or category. 

 *Request should be http://oss.fruct.org/projects/gets/service/loadPoints.php* GETS_SERVICE_URL/loadPoints.php* 

 Request: 
 <pre> 
 <request> 
   <params> 
     <auth_token>...</auth_token>  
     
     <latitude>...</latitude> 
     <longitude>...</longitude> 
     <radius>...</radius> 
     <category_name>...</category_name> 
   </params> 
 </request> 
 </pre> 

 _auth_token_ - auth token string _(optional)_ 
 _latitude_ - float value 
 _longitude_ - float value 
 _radius_ - float non-negative value 
 _category_name_ - name of category string 

 Points can be retrieved by: only _category_name_, or _latitude_ and _longitude_ and _radius_, or combination of both previous possibilities. 

 Response: 
 <pre> 
 <response> 
   <status> 
     &lt;code&gt;...&lt;/code&gt; 
     <message>...</message> 
   </status> 
   <content> 
     %list of points in kml format% 
   </content>  
 </response> 
 </pre> 

 h3. Update point 

 h2. Tracks 

 h3. Add track 

 h3. Load track 

 h3. Update track's info 

 h3. Remove track 

 h2. Category 

 h3. addCategory 

 h3. getCategory 

 Method is returning list of point's categories available in GeTS service. 

 *Request should be http://oss.fruct.org/projects/gets/service/getCategories.php* 

 Request: 
 <pre> 
 <request> 
   <params> 
     <auth_token>...</auth_token>  
   </params> 
 </request> 
 </pre> 

 _auth_token_ - auth token string _(optional)_ 

 Response: 
 <pre> 
 <response> 
   <status> 
     &lt;code&gt;...&lt;/code&gt; 
     <message>...</message> 
   </status> 
   <content> 
     <categories> 
       <category> 
         <id>...</id> 
         <name>...</name> 
         <description>...</description> 
         <url>...</url> 
       </category> 
     </categories> 
   </content>  
 </response> 
 </pre> 

 Tag categories contains list of categories placed in tags category. 
 Each tag category contains tags: 

 _id_ - identifier of category (positive integer) 
 _name_ - category's name (string)  
 _description_ - category's description (string) 
 _url_ - category's url (string) 

 h2. Users 

 h3. Registration 

 h3. Authorization 

 Authorize user with given login and password. 
 In response service will send auth token. 

 *Request should be GETS_SERVICE_URL/login.php* 

 Request: 
 <pre> 
 <request> 
   <params> 
     <login>...</login> 
     <password>...</password> 
   </params> 
 </request> 
 </pre> 

 _login_ - login name string 
 _password_ - password string 

 Response: 
 <pre> 
 <response> 
   <status> 
     &lt;code&gt;...&lt;/code&gt; 
     <message>...</message> 
   </status> 
   <content> 
     <auth_token>...</auth_token> 
   </content>  
 </response> 
 </pre> 

 _auth_token_ - token which will be used in further GeTS transactions 

 h3. Quit session 

 h3. Remove user