-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestrest.http
318 lines (240 loc) · 7.49 KB
/
testrest.http
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
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
### Register example
POST http://127.0.0.1:8000/auth/register/
Content-Type: application/json
{
"username": "ali",
"password": "123456",
"first_name": "Ali",
"last_name": "Mostafa",
"email": "[email protected]",
"is_patient": false,
"is_doctor": true,
"phone": "01098557840",
"age": 35,
"dob": "1989-01-01",
"address": "123 Example St",
"city": "Exampleville",
"gender": "M"
}
###login example
POST http://127.0.0.1:8000/auth/login/
Content-Type: application/json
{
"email": "[email protected]",
"password": "123456"
}
### test example
GET http://127.0.0.1:8000/auth/test/
Content-Type: application/json
### logout example
POST http://127.0.0.1:8000/auth/logout/
Content-Type: application/json
Authorization: Token 3ede88cc1730ff4c59c18a0cfe0d3d07ef457fd9
### get user by id
GET http://127.0.0.1:8000/auth/users/2/
Authorization: Token 74f33cc443b42047a7ae8bd42a462672ac28533c
### update user by id
PATCH http://127.0.0.1:8000/auth/users/2/
Content-Type: application/json
Authorization: Token 74f33cc443b42047a7ae8bd42a462672ac28533c
{
"username": "ali5000",
"first_name": "ali22020",
"last_name": "mostafa",
"age":55,
"phone": "01098557840",
"email": "[email protected]"
}
### rating example
POST http://127.0.0.1:8000/ratings/ratings/
Content-Type: application/json
Authorization: Token 0f3e81bb7b4a4ff91f59b0e3fc9841877dd79204
{
"user": 6,
"doctor": 2,
"rating": 4,
"comment": "Great 11experience with the doctor!"
}
### get rate by id
GET http://127.0.0.1:8000/ratings/ratings/7/
Content-Type: application/json
### update rating example
PUT http://127.0.0.1:8000/ratings/ratings/7/
Content-Type: application/json
{
"doctor": 2,
"user": 1,
"rating": 4,
"comment": "Great xxxexpe45sdasd4rience with the doctor!",
"created_at": "2024-03-12T22:47:52.391623Z"
}
### delete rating example
DELETE http://127.0.0.1:8000/ratings/ratings/1/
### get all patients
GET http://127.0.0.1:8000/auth/patients/
### get all doctors needed
GET http://127.0.0.1:8000/doctors/doctors?p=1&page_size=3&q=ahmed
### get patient by id
GET http://127.0.0.1:8000/auth/users/10/
### get doctor by id
GET http://127.0.0.1:8000/doctors/doctor/2/
### Delete doctor by id
DELETE http://127.0.0.1:8000/doctors/doctor/1/
### Delete patient by id
DELETE http://127.0.0.1:8000/auth/users/1/
### Update users main info by id
PUT http://127.0.0.1:8000/auth/users/2/
Content-Type: application/json
{
"email": "[email protected]",
"phone": "01298557840"
}
### Update doctor profile by id
PUT http://127.0.0.1:8000/doctors/doctor/2/
PUT http://127.0.0.1:8000/doctors/doctor/2/
Content-Type: application/json
{
"specialization": "Cardiology",
"bio": "I has a master degree in cardiology",
"degree": null,
"area": "Cairo",
"fees": 500
}
##################################################
### add schedule
POST http://127.0.0.1:8000/schedules/all_sch/
Content-Type: application/json
{
"doctor":2,
"day":"friday",
"start_time":"10:00",
"end_time":"12:00",
"is_active":false
}
### get all schedules
GET http://127.0.0.1:8000/schedules/all_sch/
### Update schedule by id
PUT http://127.0.0.1:8000/schedules/schedule/4/
Content-Type: application/json
{
"doctor":3,
"day":"sunday",
"start_time":"10:00",
"end_time":"12:00",
"is_active":false
}
### Delete/ delete schedule by id
GET http://127.0.0.1:8000/schedules/schedule/1/
#############################################
### add appointment
POST http://127.0.0.1:8000/appointments/all_app/
Content-Type: application/json
{
"schedule":1,
"user":1,
"doctor":2
}
### get all appointment
GET http://127.0.0.1:8000/schedules/all_app/
### Update appointment by id
PUT http://127.0.0.1:8000/schedules/appointment/1/
Content-Type: application/json
{
"schedule": 1,
"user": 2,
"create_at": "2024-03-12T23:33:52.655234Z",
"is_accepted": true
}
### Delete/ delete appointment by id
DELETE http://127.0.0.1:8000/schedules/appointment/1/
################################33
### rating example
POST http://127.0.0.1:8000/ratings/
Content-Type: application/json
{
"doctor": 2,
"user": 1,
"rating": 4,
"comment": "Great231 expsderience with the doctor!"
}
### update rating example
PUT http://127.0.0.1:8000/ratings/1/
Content-Type: application/json
{
"doctor": 2,
"user": 1,
"rating": 5,
"comment": "Greassst expe454rience with the doctor!"
}
### delete rating example
DELETE http://127.0.0.1:8000/ratings/11/
### get rating by doctor
GET http://127.0.0.1:8000/ratings/doctor/2/?p=1&page_size=3
### get appointment bg doctor
GET http://127.0.0.1:8000/appointments/all_app/doctor/4/?p=1&page_size=3
###get schedules by doctore
GET http://127.0.0.1:8000/schedules/all_sch/doctor/1/
### post schedule for the doctor
POST http://127.0.0.1:8000/schedules/all_sch/doctor/2/
Content-Type: application/json
{
"day":"monday",
"start_time":"11:00",
"end_time":"1:00",
"is_active":false
}
### get app by user
GET http://127.0.0.1:8000/appointments/all_app/user/1/?p=1&page_size=3
############# paymob token
POST https://accept.paymob.com/api/auth/tokens
Content-Type: application/json
{
"api_key": "ZXlKaGJHY2lPaUpJVXpVeE1pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmpiR0Z6Y3lJNklrMWxjbU5vWVc1MElpd2ljSEp2Wm1sc1pWOXdheUk2TmpFeU16ZzNMQ0p1WVcxbElqb2lhVzVwZEdsaGJDSjkuX3B5RFJhM05yUk5CbHRnVDVvM1huVjdQV2dxd2p1cXhlX1A0V3hJZVR1cXE2NFhBa1BRcHRIYVVmVHNRUHEybU93V1BMaXJOLWZIdnEzZWFudGtzTnc="
}
######### paymob payment key
### paymob order token obtained from the previous step
POST https://accept.paymob.com/api/ecommerce/orders
Content-Type: application/json
{
"auth_token": "ZXlKaGJHY2lPaUpJVXpVeE1pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmpiR0Z6Y3lJNklrMWxjbU5vWVc1MElpd2ljSEp2Wm1sc1pWOXdheUk2TmpFeU16ZzNMQ0p3YUdGemFDSTZJakZrWVRFMFl6RTFNMkl4WlRBd1l6VmpZelZoTUdOak1EUmhNbVEwWm1ObU5XTTJPV1l5WkRZeE1tRTBOMk5qT0dFMk56SmxNemcyTW1ObE1qWTNOVGtpTENKbGVIQWlPakUzTVRFd09ESXpPRE45LndDSHhJcnVZWFdEVG1CYkxEVWw1M1J2T3lYR2F0WTNGM09FeVVzSl9NMmJ0cDZLenFzcHRiZEl0cEJIVXZ3ZHBvOWR6SzNyaW83a3pNR0VpVzZwMjR3",
"currency": "EGP",
"amount_cents": 10000,
"items": [
{
"name": "item1",
"amount_cents": 10000,
"description": "item1 description",
"quantity": 1
}
]
}
### paymob payment key
POST https://accept.paymob.com/api/acceptance/payment_keys
Content-Type: application/json
{
"auth_token": "ZXlKaGJHY2lPaUpJVXpVeE1pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmpiR0Z6Y3lJNklrMWxjbU5vWVc1MElpd2ljSEp2Wm1sc1pWOXdheUk2TmpFeU16ZzNMQ0p3YUdGemFDSTZJakZrWVRFMFl6RTFNMkl4WlRBd1l6VmpZelZoTUdOak1EUmhNbVEwWm1ObU5XTTJPV1l5WkRZeE1tRTBOMk5qT0dFMk56SmxNemcyTW1ObE1qWTNOVGtpTENKbGVIQWlPakUzTVRFd09ESXpPRE45LndDSHhJcnVZWFdEVG1CYkxEVWw1M1J2T3lYR2F0WTNGM09FeVVzSl9NMmJ0cDZLenFzcHRiZEl0cEJIVXZ3ZHBvOWR6SzNyaW83a3pNR0VpVzZwMjR3",
"amount_cents": 10000,
"order_id": 194967961,
"billing_data": {
"apartment": "803",
"email": "",
"floor": "42",
},
"currency": "EGP",
"lock_order_when_paid": "false",
"redirect": "http://www.example.com",
"shipping_data": {
"apartment": "803",
"email": "",
"floor": "42",
},
"billing_data": {
"apartment": "803",
"email": "",
"floor": "42",
},
"integration_id": 3033362,
}
#### Stripe payment
POST https://api.stripe.com/v1/payment_intents
Content-Type: application/x-www-form-urlencoded