Estudos RocketSeat
Create new session
Ex:
method: POST
url: http://localhost:3333/sessions
{
"email": "[email protected]",
"password": "mypassword"
}
Authorization bearer YOUR_AUTH_TOKEN_HERE
Create new user
Ex:
method: POST
url: http://localhost:3333/users
{
"name": "My name",
"email": "[email protected]",
"password": "mypassword",
}
Update user
Ex:
method: PUT
url: http://localhost:3333/users
{
"name": "My name",
"oldPassword": "myOldPassword",
"password": "myNewPassword",
"passwordConfirm": "myNewPassword"
}
Store new file
Authorization bearer YOUR_AUTH_TOKEN_HERE
Ex:
method: POST
url: http://localhost:3333/files
Multipart form Ex:
{
"file": "avatar.jpg",
}
Request all providers
Authorization bearer YOUR_AUTH_TOKEN_HERE
Ex:
method: GET
url: http://localhost:3333/providers
Authorization bearer YOUR_AUTH_TOKEN_HERE
List all availables dates for new appointment
Ex:
method: GET
url: http://localhost:3333/providers/:providerId/available?date=1579442903184
timestamp date format
{
"providerId": 1
"date": 1579442903184,
}
Authorization bearer YOUR_AUTH_TOKEN_HERE
Create new appointment
Ex:
method: POST
url: http://localhost:3333/appointments
{
"provider_id": 1,
"date": "2020-01-19T18:00:00-03:00"
}
List all appointment
Ex:
method: GET
url: http://localhost:3333/appointments?page=1
{
"page": 1
}
Canceled one appointment
Ex:
method: DELETE
url: http://localhost:3333/appointments/:id
{
"id": 1
}
Authorization bearer YOUR_AUTH_TOKEN_HERE
List all schedules for providers
Ex:
method: GET
url: http://localhost:3333/schedules?date=2020-01-18T00%3A00%3A00-03%3A00
{
"date": 2020-01-18T00:00:00-03:00,
}
Authorization bearer YOUR_AUTH_TOKEN_HERE
List all notifications for providers
Ex:
method: GET
url: http://localhost:3333/notifications
Update one notification
Ex:
method: PUT
url: http://localhost:3333/notifications/:id
{
"id": 5e236b3e3ecfb906e1a0ab83,
}