-
Notifications
You must be signed in to change notification settings - Fork 50
/
sample.json
259 lines (259 loc) · 10.2 KB
/
sample.json
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
{
"name": "Sample REST API",
"url": "http://api.sample.com",
"version": "1.0",
"copyright": "2015",
"description": "Calamum is a simple ruby build program to generate a REST API documentation from a YAML file definition",
"authentication": "You authenticate to the Stripe API by providing one of your API keys in the request.<br> You can manage your API keys from your account. You can have multiple API keys active at one time. Your API keys carry many privileges, so be sure to keep them secret!",
"errors": {
"http_errors":[
{"code": 200, "text": "OK", "description": "Success"},
{"code": 304, "text": "Not Modified", "description": "There was no new data to return."},
{"code": 400, "text": "Bad Request", "description": "The request was invalid or cannot be otherwise served"}
],
"api_errors":[
{"code": 32, "text": "Could not authenticate you", "description": "Your call could not be completed as dialed"},
{"code": 34, "text":"Sorry, that page does not exist", "description": "Corresponds with an HTTP 404 - the specified resource was not found."}
]
},
"resources": {
"user": [
{
"action": "GET",
"uri": "/users",
"description": "Retrieve all <br> the registered users.",
"headers": {
"Accept": "application/vnd.example.v1",
"Content-Type": "application/json"
},
"params": {
"page": {
"type": "integer",
"description": "Page to show",
"required": true
},
"limit": {
"type": "integer",
"description": "Amount of results (max: 100)",
"required": true
},
"query": {
"type": "string",
"description": "Text to search users",
"required": false
}
},
"response": {
"data": [
{
"id": 207119551,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"state": "active",
"note": null,
"created_at": "2013-03-26T15:42:36-04:00",
"updated_at": "2013-03-26T15:42:36-04:00"
},
{
"id": 209871202,
"first_name": "Bob",
"last_name": "Norman",
"email": "[email protected]",
"state": "active",
"note": "See my profile at http://58745954.io",
"created_at": "2013-03-30T19:21:00-04:00",
"updated_at": "2013-03-30T19:21:00-04:00"
}
],
"total": 1050
}
},
{
"action": "GET",
"uri": "/users/:id",
"description": "Receive a single user.",
"params": {
"id": {
"type": "integer",
"description": "ID of the user's profile",
"required": true
}
},
"response": {
"id": 207119551,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"state": "active",
"note": null,
"created_at": "2013-03-26T15:42:36-04:00",
"updated_at": "2013-03-26T15:42:36-04:00"
}
},
{
"action": "POST",
"uri": "/users",
"description": "Create a new user.",
"params": {
"email": {
"type": "string",
"description": "The primary e-mail of user",
"required": true
},
"first_name": {
"type": "string",
"description": "The name of the user",
"required": true
},
"last_name": {
"type": "string",
"description": "The user's last name",
"required": true
},
"note": {
"type": "string",
"description": "Additional note for user",
"required": false
}
},
"request": {
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe"
},
"response": {
"id": 207119551,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"state": "active",
"note": null,
"created_at": "2013-03-26T15:42:36-04:00",
"updated_at": "2013-03-26T15:42:36-04:00"
}
},
{
"action": "PUT",
"uri": "/users/:id",
"description": "Modify an existing user.",
"params": {
"id": {
"type": "integer",
"description": "ID of the user's profile",
"required": true
},
"first_name": {
"type": "string",
"description": "The name of the user",
"required": false
},
"last_name": {
"type": "string",
"description": "The user's last name",
"required": false
},
"note": {
"type": "string",
"description": "Additional note for user",
"required": false
}
},
"request": {
"id": 207119551,
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe",
"note": "Note has been updated"
},
"response": {
"id": 207119551,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"state": "active",
"note": "Note has been updated",
"created_at": "2013-03-26T15:42:36-04:00",
"updated_at": "2013-03-26T15:50:36-04:00"
}
},
{
"action": "DELETE",
"uri": "/users/:id",
"description": "Remove a user from the database.",
"params": {
"id": {
"type": "integer",
"description": "ID of the user's profile",
"required": true
}
},
"response": {
"id": 207119551
}
}
],
"article": [
{
"action": "GET",
"uri": "/blogs/:id/articles",
"description": "Receive a list of all articles for given blog.",
"params": {
"id": {
"type": "integer",
"description": "A unique numeric identifier for the blog containing the article",
"required": true
},
"page": {
"type": "integer",
"description": "Page to show",
"required": true
},
"limit": {
"type": "integer",
"description": "Amount of results (max: 50)",
"required": true
}
},
"response": {
"data": [
{
"id": 989034056,
"blog_id": 241253187,
"author": "John",
"title": "Some crazy article I'm coming up with",
"body": "I have no idea what to write about, but it's going to rock!",
"tags": "Mystery",
"published_at": null
},
{
"id": 134645308,
"blog_id": 241253187,
"author": "Dennis",
"title": "Get on the train now",
"body": "Do you have an IPod yet?",
"tags": "Announcing, Notes",
"published_at": "2008-07-31T20:00:00-04:00"
}
],
"total": 310
}
},
{
"action": "GET",
"uri": "/blogs/:id/articles/count",
"description": "Get a count of all articles from a certain blog.",
"params": {
"id": {
"type": "integer",
"description": "A unique numeric identifier for the blog containing the article",
"required": true
}
},
"response": {
"total": 310
}
}
]
}
}