-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapiary.apib
More file actions
173 lines (126 loc) · 3.78 KB
/
apiary.apib
File metadata and controls
173 lines (126 loc) · 3.78 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
FORMAT: 1A
HOST: http://agenda12.apiblueprint.org/
# Agenda
Agenda is a simple API allowing consumers to schedule meeting on-line
# Group User
Resource operations related to a user in the API.
## User-Key [/v1/user/getkey{?username,password}]
+ Parameters
- username : `root` (string, required) - User Name
- password : `pass` (required)
### Get User Key [GET]
get a security key for operations later
+ Response 200 (application/json)
{
"key":"1e3576bt",
"permissions":["user","admin"]
}
# Group Users
Resources related to a users in the API.
## Users Collection [/v1/users{?key}]
+ Parameters
- key : `1e3576bt` (string, required)
### List all Users [GET]
+ Response 200 (application/json)
[
{
"id":1,
"username":"zhang3",
"password":"zhang",
"email":"zhang3@mail2.sysu.edu.cn"
},{
"id":2,
"username":"li4",
"password":"li",
"email":"li4@mail2.sysu.edu.cn"
}
]
### Create a New User [POST]
+ Request (application/json)
{
"username":"zhang3",
"password":"zhang",
"email":"zhang3@mail2.sysu.edu.cn"
}
+ Response 201 (application/json)
+ Headers
Location: /users/1
+ Body
{
"id": 1,
"username":"zhang3",
"password":"zhang",
"email":"zhang3@mail2.sysu.edu.cn"
}
### Get User by ID [GET /v1/users/{id}]
+ Parameters
- id : `1` (int, required) - User Name
+ Response 200 (application/json)
{
"id" : 1,
"username":"zhang3",
"password":"zhang",
"email":"zhang3@mail2.sysu.edu.cn"
}
# Group Meetings
## Questions Collection [/questions]
### List All Questions [GET]
+ Response 200 (application/json)
[
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 2048
}, {
"choice": "Python",
"votes": 1024
}, {
"choice": "Objective-C",
"votes": 512
}, {
"choice": "Ruby",
"votes": 256
}
]
}
]
### Create a New Question [POST]
You may create your own question using this action. It takes a JSON
object containing a question and a collection of answers in the
form of choices.
+ Request (application/json)
{
"question": "Favourite programming language?",
"choices": [
"Swift",
"Python",
"Objective-C",
"Ruby"
]
}
+ Response 201 (application/json)
+ Headers
Location: /questions/2
+ Body
{
"question": "Favourite programming language?",
"published_at": "2015-08-05T08:40:51.620Z",
"choices": [
{
"choice": "Swift",
"votes": 0
}, {
"choice": "Python",
"votes": 0
}, {
"choice": "Objective-C",
"votes": 0
}, {
"choice": "Ruby",
"votes": 0
}
]
}