-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.http
executable file
·128 lines (100 loc) · 3.9 KB
/
api.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
POST http://localhost:3333/categories
content-Type: application/json
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDcxNDA2NTEsImV4cCI6MTcwNzE0MTU1MSwic3ViIjoiNGVlNTVkOGEtZjQ5Ni00MGQyLWEwM2ItZjljN2M3NDk3NGI2In0.0VQzLp3dQ_LUDFctt-ECgebP8I3jRliq7v1kp0ZU_FQ
{
"name": "name",
"description": "descricao test2"
}
####
GET http://localhost:3333/categories
content-Type: application/json
####
POST http://localhost:3333/categories/import
content-Type: application/json
{
"name": "specification test",
"description": "description test"
}
####
POST http://localhost:3333/specifications
content-Type: application/json
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFkbWluQHJlbnR4LmNvbSIsImlhdCI6MTcwNjQzMTQ5NCwiZXhwIjoxNzA5MDIzNDk0LCJzdWIiOiI0ZWU1NWQ4YS1mNDk2LTQwZDItYTAzYi1mOWM3Yzc0OTc0YjYifQ.5VCQRsM4e83vALG9dwm3t9MnHia0ekMn2ysyL15L2vI
{
"name": "specification test",
"description": "description test"
}
####
POST http://localhost:3333/users
Content-Type: application/json
{
"name": "admin",
"email": "[email protected]",
"password": "admin",
"driver_license": "123456"
}
####
POST http://localhost:3333/sessions
Content-Type: application/json
{
"email": "[email protected]",
"password": "admin"
}
####
PATCH http://localhost:3333/users/avatar
# Content-Type: application/json
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2OTgzOTY5NjMsImV4cCI6MTY5ODQ4MzM2Mywic3ViIjoiNjI0NWZmOGYtMTRjNS00MWNhLWIwNmYtMzFjNTVkNWMxYzE4In0.DBrEbO4FNbrTDtizQv6A6dvdh-XxWMlSawtC6pVVlF0
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="avatar"; filename="ava.jpg"
Content-Type: image/jpeg
< C:\Users\ERILDO FRANCISCO\Desktop\ava.jpg
------WebKitFormBoundary7MA4YWxkTrZu0gW--
###
POST http://localhost:3333/cars
Content-Type: application/json
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDY5MDgwMjgsImV4cCI6MTcwNjkwODkyOCwic3ViIjoiZTY1MTg5MGUtZTIwNC00MDE4LTgzNzUtODQwYmMyMWRhOGNjIn0.2Ic5s6J296IC1G_yTrMvhgviQhFdr4UjHGwSXn0pAUM
{
"name": "Audi A4",
"description": "carro bonito",
"daily_rate": "15000",
"license_plate": "DEF-1234",
"fine_amount": "3000",
"brand": "Audi",
"category_id": "5ec5465f-27ff-49fd-bcf7-78c29ce6f5f6"
}
###
GET http://localhost:3333/cars/available?
content-Type: application/json
###
POST http://localhost:3333/rentals
Content-Type: application/json
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDY5MDgwMjgsImV4cCI6MTcwNjkwODkyOCwic3ViIjoiZTY1MTg5MGUtZTIwNC00MDE4LTgzNzUtODQwYmMyMWRhOGNjIn0.2Ic5s6J296IC1G_yTrMvhgviQhFdr4UjHGwSXn0pAUM
{
"spected_return_date": "2024-02-03T22:10:00.295Z",
"car_id": "3c94cbe0-f7b1-4ec9-96d6-74f67006f7ff"
}
###
GET http://localhost:3333/rentals/user
Content-Type: application/json
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDYxNzk1MTIsImV4cCI6MTcwNjI2NTkxMiwic3ViIjoiZTY1MTg5MGUtZTIwNC00MDE4LTgzNzUtODQwYmMyMWRhOGNjIn0.x7KgldsrnaTGexQ2kjQlAF80gQ75Cot6ZfTb6lrZmgI
###
POST http://localhost:3333/rentals/devolution/1f2e6bc0-5e89-4f0e-b821-67010ee184e4
Authorization: token eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3MDYxNzk1MTIsImV4cCI6MTcwNjI2NTkxMiwic3ViIjoiZTY1MTg5MGUtZTIwNC00MDE4LTgzNzUtODQwYmMyMWRhOGNjIn0.x7KgldsrnaTGexQ2kjQlAF80gQ75Cot6ZfTb6lrZmgI
###
POST http://localhost:3333/refresh-token
Content-Type: application/json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6ImFkbWluQHJlbnR4LmNvbSIsImlhdCI6MTcwNjQzMTQ2OSwiZXhwIjoxNzA5MDIzNDY5LCJzdWIiOiI0ZWU1NWQ4YS1mNDk2LTQwZDItYTAzYi1mOWM3Yzc0OTc0YjYifQ.Drcgk9-mJE0PsgjpZq6KF4r3zmefWgRNmcz8kePksAs"
}
###
POST http://localhost:3333/password/forgot
Content-Type: application/json
{
"email": "[email protected]"
}
###
POST http://localhost:3333/password/reset?token=7a671bae-288a-4957-a6ee-65af794025df
Content-Type: application/json
{
"password": "12345678"
}