forked from HibatApp/hibat-backend
/
apis.yaml
270 lines (260 loc) · 6.85 KB
/
apis.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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
openapi: 3.0.1
info:
title: Hibat App API
description: This API is designed for both Web and Mobile app.
version: 1.0.0
servers:
- url: https://staging.hibatapp.com/api/v1/
- url: https://localhost/hibat-app/api/v1/
tags:
- name: home
paths:
/home:
get:
tags:
- home
summary: Get home page data
parameters:
- name: lang
in: query
schema:
type: string
maxLength: 2
example: en
default: en
pattern: ^[a-z]{2}$
responses:
200:
description: Successful response
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
sliders:
maxItems: 5
type: array
items:
additionalProperties: false
anyOf:
- $ref: "#/components/schemas/slider"
/user:
put:
security:
- bearerAuth: []
tags:
- user
summary: Update user info
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
required:
- fullName
properties:
fullName:
type: string
maxLength: 50
pattern: ^.{3,50}$
example:
fullName: "John Doe"
additionalProperties: false
responses:
200:
description: Success
400:
description: Missing data
401:
description: This request need's a valid user token
get:
security:
- bearerAuth: []
tags:
- user
summary: Get user info
responses:
200:
description: Successful response
content:
application/json:
schema:
type: object
401:
description: Wrong login info
post:
tags:
- user
summary: User sign up
operationId: userSingUp
requestBody:
required: true
content:
"application/x-www-form-urlencoded":
schema:
additionalProperties: false
type: object
properties:
fullName:
type: string
maxLength: 50
pattern: ^.{1,50}$
example: John Doe
countryId:
type: integer
format: int32
minimum: 1
maximum: 200
example: 10
mobile:
type: string
maxLength: 14
pattern: ^[0-9]{8,14}$
example: "00111222000000"
password:
type: string
minLength: 8
maxLength: 50
pattern: ^.{8,50}$
example: "Ab@123*/"
required:
- fullName
- countryId
- mobile
- password
responses:
200:
description: Success
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
otpToken:
type: string
pattern: ^[0-9a-z]{32}$
maxLength: 32
example: "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"
400:
description: missing data
422:
description: mobile number already exists
452:
description: this app is not available in this country yet
patch:
tags:
- user
description: Signin a user
summary: User sign in
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
additionalProperties: false
required:
- countryId
- mobile
- password
properties:
countryId:
type: integer
minimum: 1
maximum: 200
format: int32
mobile:
type: string
minLength: 8
maxLength: 32
pattern: ^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$
password:
type: string
minLength: 8
maxLength: 250
pattern: ^.{8,50}$
example:
countryId: 1
mobile: "096123456789"
password: "12345678test"
responses:
200:
description: Success
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
token:
maxLength: 32
type: string
pattern: ^[0-9a-z]{32}$
400:
description: Missing data
401:
description: Wrong login info
422:
description: This account has been disabled
/wishlist/{productId}:
delete:
security:
- bearerAuth: []
tags:
- wishlist
summary: Deletes a from Wishlist
description: "Delete from Wishlist"
parameters:
- name: "productId"
in: path
required: true
schema:
type: integer
maximum: 999999
minimum: 0
format: int32
responses:
"200":
description: "success"
"401":
description: "This request need's a valid user token"
"404":
description: "No such item"
components:
responses:
notFound:
description: Item not found
content:
application/json:
schema:
additionalProperties: false
type: object
properties:
code:
type: integer
example: 404
format: int32
maximum: 404
minimum: 404
message:
type: string
example: Item not found
maxLength: 250
pattern: ^[0-9A-Za-z\. ]+$
schemas:
slider:
additionalProperties: false
type: object
properties:
picUrl:
type: string
example: "https://www.domain.com/path/photo.png"
pattern: ^[0-9a-z:/\.]+$
maxLength: 250
securitySchemes:
bearerAuth:
type: http
scheme: bearer