-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapiary.apib
72 lines (66 loc) · 1.56 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
HOST: http://api.extremmy.com/
--- eXtremmy API ---
---
В случае возникновения любой ошибки ожидается application/json
обект с полями error (идентификатор), message (сообщение для логов),
userMessage (опциональное сообщение для пользователя).
---
--
Споты
--
GET /spots/list{?limit,offset}
> Accept: application/json
> If-Modified-Since: Mon, 3 Jun 2013 00:00:00 GMT
< 304
+++++
< 503
< Content-Type: application/json
{
"error": 401,
"message": "Unknown error.",
"userMessage": "Unknown error. Please try again later."
}
+++++
< 200
< Content-Type: application/json
< Last-Modified: Mon, 3 Jun 2013 00:00:00 GMT
[
{
"ID": 1,
"name": "Orient Jumping",
"coordinate": [54.069073,-10.340239],
"sports": ["skydiving", "wakeboarding"],
"rating": 3
}
]
GET /spots/description/{id}/
> Accept: text/html
> If-Modified-Since: Mon, 3 Jun 2013 00:00:00 GMT
< 304
+++++
< 200
< Content-Type: text/html
<p>
Several paragraphs in light HTML markup
</p>
POST /spots/
> Content-Type: application/json
> Accept: application/json
{
"name": "My new point",
"coordinate": [55.990154,37.409945],
"url": "http://www.extremmy.com",
"sports": ["skydiving"],
"rating": 3
}
< 401
< Content-Type: application/json
{
"error": 401,
"message": "Unauthorized user trying to add spot.",
"userMessage": "Please sign in."
}
+++++
< 200
< Content-Type: application/json
{ "ID": 42 }