Api-functions » History » Version 2
Никита Артемов, 04/11/2013 01:31 PM
| 1 | 1 | Никита Давыдовский | h1. Функции API |
|---|---|---|---|
| 2 | |||
| 3 | {{TOC}} |
||
| 4 | |||
| 5 | h2. registerUser |
||
| 6 | |||
| 7 | *Request* |
||
| 8 | <pre> |
||
| 9 | { |
||
| 10 | 2 | Никита Артемов | request:{ |
| 11 | "email": {"type":"string"}, |
||
| 12 | "login": {"type":"string"}, |
||
| 13 | "password":{"type":"string"} |
||
| 14 | } |
||
| 15 | 1 | Никита Давыдовский | } |
| 16 | </pre> |
||
| 17 | |||
| 18 | *Response* |
||
| 19 | <pre> |
||
| 20 | { |
||
| 21 | 2 | Никита Артемов | response:{ |
| 22 | "user_id": {"type":"string"} |
||
| 23 | |||
| 24 | 1 | Никита Давыдовский | } |
| 25 | </pre> |
||
| 26 | |||
| 27 | h2. authorization |
||
| 28 | |||
| 29 | *Request* |
||
| 30 | <pre> |
||
| 31 | { |
||
| 32 | 2 | Никита Артемов | request:{ |
| 33 | "login": {"type":"string"}, |
||
| 34 | "password":{"type":"string"} |
||
| 35 | } |
||
| 36 | 1 | Никита Давыдовский | } |
| 37 | </pre> |
||
| 38 | |||
| 39 | *Response* |
||
| 40 | <pre> |
||
| 41 | { |
||
| 42 | 2 | Никита Артемов | response:{ |
| 43 | "token": {"type":"string"} |
||
| 44 | } |
||
| 45 | 1 | Никита Давыдовский | } |
| 46 | </pre> |
||
| 47 | |||
| 48 | h2. getPoints |
||
| 49 | |||
| 50 | *Request* |
||
| 51 | <pre> |
||
| 52 | { |
||
| 53 | 2 | Никита Артемов | request:{ |
| 54 | "latitude": {"type":"number"}, |
||
| 55 | "longitude":{"type":"number"}, |
||
| 56 | "radius":{"type":"number"}, |
||
| 57 | "token":{"type":"string"} |
||
| 58 | } |
||
| 59 | 1 | Никита Давыдовский | } |
| 60 | </pre> |
||
| 61 | |||
| 62 | *Response* |
||
| 63 | <pre> |
||
| 64 | { |
||
| 65 | 2 | Никита Артемов | response:{ |
| 66 | "points": {"type":"array"} |
||
| 67 | } |
||
| 68 | 1 | Никита Давыдовский | } |
| 69 | </pre> |
||
| 70 | |||
| 71 | h2. getRoutes |
||
| 72 | |||
| 73 | *Request* |
||
| 74 | <pre> |
||
| 75 | { |
||
| 76 | 2 | Никита Артемов | request:{ |
| 77 | "points": {"type":"array"}, |
||
| 78 | "token":{"type":"string"} |
||
| 79 | } |
||
| 80 | 1 | Никита Давыдовский | } |
| 81 | </pre> |
||
| 82 | |||
| 83 | *Response* |
||
| 84 | <pre> |
||
| 85 | { |
||
| 86 | 2 | Никита Артемов | response:{ |
| 87 | "routes": {"type":"array"} |
||
| 88 | } |
||
| 89 | 1 | Никита Давыдовский | } |
| 90 | </pre> |
||
| 91 | |||
| 92 | h2. addPoint |
||
| 93 | |||
| 94 | *Request* |
||
| 95 | <pre> |
||
| 96 | { |
||
| 97 | 2 | Никита Артемов | request:{ |
| 98 | "title": {"type":"string"}, |
||
| 99 | "url": {"type":"string"}, |
||
| 100 | "latitude": {"type":"number"}, |
||
| 101 | "longitude":{"type":"number"}, |
||
| 102 | "token":{"type":"string"} |
||
| 103 | } |
||
| 104 | 1 | Никита Давыдовский | } |
| 105 | </pre> |
||
| 106 | |||
| 107 | *Response* |
||
| 108 | <pre> |
||
| 109 | { |
||
| 110 | 2 | Никита Артемов | response:{ |
| 111 | "point_id": {"type":"number"} |
||
| 112 | } |
||
| 113 | 1 | Никита Давыдовский | } |
| 114 | </pre> |
||
| 115 | |||
| 116 | h2. addRoute |
||
| 117 | |||
| 118 | *Request* |
||
| 119 | <pre> |
||
| 120 | { |
||
| 121 | 2 | Никита Артемов | request:{ |
| 122 | "title": {"type":"string"}, |
||
| 123 | "url": {"type":"string"}, |
||
| 124 | "points": {"type":"array"}, |
||
| 125 | "token":{"type":"string"} |
||
| 126 | } |
||
| 127 | 1 | Никита Давыдовский | } |
| 128 | </pre> |
||
| 129 | |||
| 130 | *Response* |
||
| 131 | <pre> |
||
| 132 | { |
||
| 133 | 2 | Никита Артемов | response:{ |
| 134 | "route_id": {"type":"number"} |
||
| 135 | } |
||
| 136 | 1 | Никита Давыдовский | } |
| 137 | </pre> |
||
| 138 | |||
| 139 | h2. search |
||
| 140 | |||
| 141 | *Request* |
||
| 142 | <pre> |
||
| 143 | { |
||
| 144 | 2 | Никита Артемов | request:{ |
| 145 | "title": {"type":"string"}, |
||
| 146 | "token":{"type":"string"} |
||
| 147 | } |
||
| 148 | 1 | Никита Давыдовский | } |
| 149 | </pre> |
||
| 150 | |||
| 151 | *Response* |
||
| 152 | <pre> |
||
| 153 | { |
||
| 154 | 2 | Никита Артемов | response:{ |
| 155 | "points": {"type":"array"}, |
||
| 156 | "routes": {"type":"array"} |
||
| 157 | } |
||
| 158 | 1 | Никита Давыдовский | } |
| 159 | </pre> |
||
| 160 | |||
| 161 | h2. logout |
||
| 162 | |||
| 163 | *Request* |
||
| 164 | <pre> |
||
| 165 | { |
||
| 166 | 2 | Никита Артемов | request:{ |
| 167 | "user_id": {"type":"number"}, |
||
| 168 | "token":{"type":"string"} |
||
| 169 | } |
||
| 170 | 1 | Никита Давыдовский | } |
| 171 | </pre> |
||
| 172 | |||
| 173 | *Response* |
||
| 174 | <pre> |
||
| 175 | 2 | Никита Артемов | { |
| 176 | response:{ |
||
| 177 | } |
||
| 178 | 1 | Никита Давыдовский | } |
| 179 | </pre> |