-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
256 lines (256 loc) · 7.6 KB
/
openapi.yaml
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
openapi: 3.0.0
info:
title: 'PHP Fake User Avatar Api'
version: '1'
paths:
/api/login:
post:
summary: Login
description: 'Login a user and generate JWT token'
operationId: c7798e20b4c32275b766e54e334f3c81
requestBody:
content:
application/json:
schema:
properties:
email:
type: string
password:
type: string
type: object
example:
email: mohammad@joubeh.com
password: '123456'
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
token: { type: string }
type: object
example:
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTZ9.SLZRXQeFa64LGhAetQ-accbiNNa20bPaWoIbV9T0jx4
'400':
description: 'Invalid email or password'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'email or password is not valid'
/api/register:
post:
summary: Register
description: 'Register a user and generate JWT token'
operationId: e206a767e0d89b11fe2795ff1db52f90
requestBody:
content:
application/json:
schema:
properties:
name:
type: string
email:
type: string
password:
type: string
type: object
example:
name: mohammad
email: mohammad@joubeh.com
password: '123456'
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
token: { type: string }
type: object
example:
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTZ9.SLZRXQeFa64LGhAetQ-accbiNNa20bPaWoIbV9T0jx4
'400':
description: 'Email already exists'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'email already exists'
/api/get-fake-users:
get:
summary: 'Get some fake user'
description: 'Retrieve a list of 10-20 fake user information, including avatars if available'
operationId: a85a8446b7eca8889c4b56dc7492d45c
parameters:
-
name: APIKEY
in: header
description: 'Api Key'
required: true
responses:
'200':
description: OK
'400':
description: 'No valid key provided'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'No valid key provided'
/api/get-random-fake-user:
get:
summary: 'Get a random fake user'
description: "Retrieve a random fake user's information, including the avatar if available"
operationId: 6a800b2ac818a46846698751cbd1d627
parameters:
-
name: APIKEY
in: header
description: 'Api Key'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
id: { type: integer }
first_name: { type: string }
last_name: { type: string }
email: { type: string }
avatar_url: { type: string }
created_at: { type: string }
updated_at: { type: string }
type: object
example:
id: 61
first_name: Creola
last_name: Rodriguez
email: jakubowski.flo@yahoo.com
avatar_url: 'https:\/\/via.placeholder.com\/360x360.png\/0055aa?text=person+ut'
created_at: '2023-08-08T06:38:24.000000Z'
updated_at: '2023-08-08T06:38:24.000000Z'
'400':
description: 'No valid key provided'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'No valid key provided'
/api/get-keys:
get:
summary: 'Get api keys'
description: 'Retrieve a list of API keys associated with the authenticated user'
operationId: 8df34ccf9e33f12242ada250c9e5d106
parameters:
-
name: Authorization
in: header
description: 'Auth token'
required: true
responses:
'200':
description: OK
'400':
description: 'Not authorized'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'Not authorized'
/api/create-key:
post:
summary: 'Create Api Key'
description: 'Create a new API key for the authenticated user'
operationId: cc3497d4a56370850b7cd473ee215a58
parameters:
-
name: Authorization
in: header
description: 'Auth token'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
id: { type: integer }
user_id: { type: integer }
api_key: { type: string }
updated_at: { type: string }
created_at: { type: string }
type: object
example:
user_id: 16
api_key: 16_64d20e314b5cd
updated_at: '2023-08-08T09:43:13.000000Z'
created_at: '2023-08-08T09:43:13.000000Z'
id: 27
'400':
description: 'Not authorized'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'Not authorized'
'/api/delete-key/{key}':
delete:
summary: 'Delete Api Key'
description: 'Delete the specified API key belonging to the authenticated user'
operationId: 4214d7ae616565f78801791b5d12874a
parameters:
-
name: key
in: path
required: true
schema:
type: string
-
name: Authorization
in: header
description: 'Auth token'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'Key deleted'
'400':
description: 'Not authorized'
content:
application/json:
schema:
properties:
message: { type: string }
type: object
example:
message: 'Not authorized'