POST /login
POST /signin
Qualquer um desses 2 endpoints pode ser usado para realizar login com um dos usuários cadastrados na lista de "Users"
https://api-time-stamp.herokuapp.com
POST /login
{
"email": "[email protected]",
"password": "intrutor@$123456"
}
Caso dê tudo certo, a resposta será assim:
FORMATO DA RESPOSTA - STATUS 200
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6Im0xQGludHJ1dG9yLmNvbSIsImlhdCI6MTY2MjQyNzgzOCwiZXhwIjoxNjYyNDMxNDM4LCJzdWIiOiIzIn0.yPOWfkHfR1qQl5R0gtUJGZCgj_R4vVgNmFhwieMACG0",
"user": {
"email": "[email protected]",
"name": "Instrutor M1",
"module": 1,
"isAdmin": true,
"id": 3
}
}
Caso o e-mail esteja errado
FORMATO DA RESPOSTA - STATUS 400
{
"Cannot find user"
}
Caso a senha esteja errado
FORMATO DA RESPOSTA - STATUS 400
{
"Incorrect password"
}
GET /videos
Retorna todos os videos criados, por todos os usuarios
[
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 2,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 1,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 1
}
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 2,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 2,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 2
}
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 2,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 2
}
]
GET /videos?userId=:userId
Retorna todos os videos criados pelo usuario sem necessidade de autorização
[
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 2,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 1
}
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 2,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 2
}
]
GET /videos?moduleId=3&&sprintId=2
[
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 2,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 1
}
]
A partir daqui, todas as rotas necessitam de autenticação
Rotas que necessitam de autorização deve ser informado no cabeçalho da requisição o campo "Authorization", dessa forma:
Authorization: Bearer {token}
POST /videos
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 1,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
]
}
FORMATO DA RESPOSTA - STATUS 201
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 1,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "05/09/22",
"marks": [
{
"id": "1",
"time_video": "02:30",
"title": "react-js222"
},
{
"id": 2,
"time_video": "04:30",
"title": "json-server"
}
],
"id": 1
}
PUT /videos/:id
{
"marks": [
{
"id": "1",
"time_video": "02:50",
"title": "react-js232"
},
{
"id": 2,
"time_video": "05:10",
"title": "json-server"
}
]
}
Caso dê tudo certo, irá retornar
FORMATO DA RESPOSTA - STATUS 200
{
"url": "https://demos-kenzie-academy-brasil.s3.amazonaws.com/mar22/m3/Sprint_1/GMT20220718-123537_Recording_1920x1080.mp4",
"sprintId": 1,
"day": "segunda",
"extra": false,
"moduleId": 3,
"userId": 3,
"created_at": "18/07/22",
"updated_at": "06/09/22",
"marks": [
{
"id": "1",
"time_video": "02:50",
"title": "react-js232"
},
{
"id": 2,
"time_video": "05:10",
"title": "json-server"
}
],
"id": 1
}
DELETE /videos/:id
{}
Caso dê tudo certo, irá retornar
FORMATO DA RESPOSTA - STATUS 200
{}