GeTS API » History » Version 12
Никита Давыдовский, 12/19/2013 12:52 PM
| 1 | 1 | Кирилл Кулаков | h1. GeTS API |
|---|---|---|---|
| 2 | |||
| 3 | API based on HTTP protocol and YMapsML language. |
||
| 4 | 2 | Никита Артемов | |
| 5 | 4 | Никита Давыдовский | {{toc}} |
| 6 | 2 | Никита Артемов | |
| 7 | 4 | Никита Давыдовский | h2. Points |
| 8 | 2 | Никита Артемов | |
| 9 | 4 | Никита Давыдовский | h3. Add point |
| 10 | 2 | Никита Артемов | |
| 11 | 7 | Кирилл Кулаков | Adds one or several points into database. |
| 12 | |||
| 13 | 8 | Никита Давыдовский | *Request should be http://kappa.cs.karelia.ru/~davydovs/gets/addPoints.php* |
| 14 | |||
| 15 | 7 | Кирилл Кулаков | Request: |
| 16 | <pre> |
||
| 17 | <request token="%token%" isPublic="%true/false%" channel="%channel%"> |
||
| 18 | <point> |
||
| 19 | <!-- points in Yandex format --> |
||
| 20 | </point> |
||
| 21 | <request> |
||
| 22 | </pre> |
||
| 23 | |||
| 24 | Params: |
||
| 25 | * %token% - user's token (see function *login*) |
||
| 26 | * %true/false% - true if point should be in public space, otherwise - false |
||
| 27 | * %channel% - the name of user's channel or name of category channel |
||
| 28 | * list of points |
||
| 29 | |||
| 30 | Response: |
||
| 31 | <pre> |
||
| 32 | <response> |
||
| 33 | %message% |
||
| 34 | %error% |
||
| 35 | <response> |
||
| 36 | 6 | Никита Давыдовский | </pre> |
| 37 | |||
| 38 | 4 | Никита Давыдовский | h3. Remove point |
| 39 | 1 | Кирилл Кулаков | |
| 40 | h3. Load points |
||
| 41 | 8 | Никита Давыдовский | |
| 42 | 10 | Никита Давыдовский | Loads points for circle defined by given: category, radius, latitude and longitude; or radius, latitude and longitude; or category. |
| 43 | 8 | Никита Давыдовский | |
| 44 | 12 | Никита Давыдовский | *Request should be http://oss.fruct.org/projects/gets/service/loadPoints.php* |
| 45 | 8 | Никита Давыдовский | |
| 46 | 1 | Кирилл Кулаков | Request: |
| 47 | <pre> |
||
| 48 | <request> |
||
| 49 | 10 | Никита Давыдовский | <params> |
| 50 | 12 | Никита Давыдовский | <auth_token>...</auth_token> |
| 51 | 10 | Никита Давыдовский | <latitude>...</latitude> |
| 52 | <longitude>...</longitude> |
||
| 53 | <radius>...</radius> |
||
| 54 | <category_name>...</category_name> |
||
| 55 | </params> |
||
| 56 | </request> |
||
| 57 | 1 | Кирилл Кулаков | </pre> |
| 58 | |||
| 59 | 12 | Никита Давыдовский | _auth_token_ - auth token string _(optional)_ |
| 60 | 10 | Никита Давыдовский | _latitude_ - float value |
| 61 | _longitude_ - float value |
||
| 62 | 1 | Кирилл Кулаков | _radius_ - float non-negative value |
| 63 | _category_name_ - name of category string |
||
| 64 | 10 | Никита Давыдовский | |
| 65 | 12 | Никита Давыдовский | Points can be retrieved by: only _category_name_, or _latitude_ and _longitude_ and _radius_, or combination of both previous possibilities. |
| 66 | |||
| 67 | 1 | Кирилл Кулаков | Response: |
| 68 | <pre> |
||
| 69 | <response> |
||
| 70 | 10 | Никита Давыдовский | <status> |
| 71 | <code>...</code> |
||
| 72 | <message>...</message> |
||
| 73 | </status> |
||
| 74 | <content> |
||
| 75 | %list of points in kml format% |
||
| 76 | </content> |
||
| 77 | </response> |
||
| 78 | 8 | Никита Давыдовский | </pre> |
| 79 | 1 | Кирилл Кулаков | |
| 80 | 4 | Никита Давыдовский | h3. Update point |
| 81 | |||
| 82 | 1 | Кирилл Кулаков | h2. Tracks |
| 83 | 4 | Никита Давыдовский | |
| 84 | h3. Add track |
||
| 85 | |||
| 86 | h3. Load track |
||
| 87 | |||
| 88 | h3. Update track's info |
||
| 89 | |||
| 90 | h3. Remove track |
||
| 91 | 5 | Никита Давыдовский | |
| 92 | h2. Category |
||
| 93 | |||
| 94 | 1 | Кирилл Кулаков | h3. addCategory |
| 95 | |||
| 96 | h3. getCategory |
||
| 97 | 12 | Никита Давыдовский | |
| 98 | Method is returning list of point's categories available in GeTS service. |
||
| 99 | |||
| 100 | *Request should be http://oss.fruct.org/projects/gets/service/getCategories.php* |
||
| 101 | |||
| 102 | Request: |
||
| 103 | <pre> |
||
| 104 | <request> |
||
| 105 | <params> |
||
| 106 | <auth_token>...</auth_token> |
||
| 107 | </params> |
||
| 108 | </request> |
||
| 109 | </pre> |
||
| 110 | |||
| 111 | _auth_token_ - auth token string _(optional)_ |
||
| 112 | |||
| 113 | Response: |
||
| 114 | <pre> |
||
| 115 | <response> |
||
| 116 | <status> |
||
| 117 | <code>...</code> |
||
| 118 | <message>...</message> |
||
| 119 | </status> |
||
| 120 | <content> |
||
| 121 | <categories> |
||
| 122 | <category> |
||
| 123 | <id>...</id> |
||
| 124 | <name>...</name> |
||
| 125 | <description>...</description> |
||
| 126 | <url>...</url> |
||
| 127 | </category> |
||
| 128 | </categories> |
||
| 129 | </content> |
||
| 130 | </response> |
||
| 131 | </pre> |
||
| 132 | |||
| 133 | Tag categories contains list of categories placed in tags category. |
||
| 134 | Each tag category contains tags: |
||
| 135 | |||
| 136 | _id_ - identifier of category (positive integer) |
||
| 137 | _name_ - category's name (string) |
||
| 138 | _description_ - category's description (string) |
||
| 139 | _url_ - category's url (string) |
||
| 140 | 4 | Никита Давыдовский | |
| 141 | h2. Users |
||
| 142 | |||
| 143 | h3. Registration |
||
| 144 | |||
| 145 | h3. Authorization |
||
| 146 | 9 | Никита Давыдовский | |
| 147 | Authorize user with given login and password. |
||
| 148 | In response service will send auth token. |
||
| 149 | |||
| 150 | *Request should be GETS_SERVICE_URL/login.php* |
||
| 151 | |||
| 152 | Request: |
||
| 153 | <pre> |
||
| 154 | <request> |
||
| 155 | <params> |
||
| 156 | <login>...</login> |
||
| 157 | <password>...</password> |
||
| 158 | </params> |
||
| 159 | </request> |
||
| 160 | </pre> |
||
| 161 | |||
| 162 | _login_ - login name string |
||
| 163 | 1 | Кирилл Кулаков | _password_ - password string |
| 164 | 9 | Никита Давыдовский | |
| 165 | Response: |
||
| 166 | <pre> |
||
| 167 | <response> |
||
| 168 | <status> |
||
| 169 | 10 | Никита Давыдовский | <code>...</code> |
| 170 | 9 | Никита Давыдовский | <message>...</message> |
| 171 | </status> |
||
| 172 | <content> |
||
| 173 | <auth_token>...</auth_token> |
||
| 174 | </content> |
||
| 175 | </response> |
||
| 176 | </pre> |
||
| 177 | |||
| 178 | _auth_token_ - token which will be used in further GeTS transactions |
||
| 179 | |||
| 180 | 4 | Никита Давыдовский | h3. Quit session |
| 181 | 1 | Кирилл Кулаков | |
| 182 | 7 | Кирилл Кулаков | h3. Remove user |