Api Authentication

Register

POST /api/v1/auth/register HTTP/1.1
Content-Type: application/json
Content-Length: 113
Host: localhost:8080

{
  "firstname" : "Juan",
  "lastname" : "Carlos",
  "email" : "jcarlos@gmail.com",
  "password" : "admin"
}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 167

{
  "token" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJqY2FybG9zQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NSwiZXhwIjoxNjkwMjAzNzk1fQ.w_Nec7uXrGObhQfz3VtxeIcNIuuwBH4d82PnnVwICHM"
}

Authentication

POST /api/v1/auth/authentication HTTP/1.1
Content-Type: application/json
Content-Length: 62
Host: localhost:8080

{
  "email" : "jcarlos@gmail.com",
  "password" : "admin"
}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 167

{
  "token" : "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJqY2FybG9zQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NSwiZXhwIjoxNjkwMjAzNzk1fQ.w_Nec7uXrGObhQfz3VtxeIcNIuuwBH4d82PnnVwICHM"
}

Patients

Get all patient

GET /api/v1/patient HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwZWRyZXJhQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NiwiZXhwIjoxNjkwMjAzNzk2fQ.uUs1QpN8qhHddelO3gU-PNwmcE052GJcN0ahOvIcUQY
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 512

[ {
  "id" : "5d40e95e-bd42-43a9-8b0e-228b14287743",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
}, {
  "id" : "4e06c549-54a3-4416-8f69-1b6d288e5424",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
}, {
  "id" : "2a397b20-9d08-474a-a670-306a03ba8d9d",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
} ]

Get patient by id

GET /api/v1/patient/9bc28702-826b-4d60-b4c5-015f24484d6d HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwZWRyZXJhQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NiwiZXhwIjoxNjkwMjAzNzk2fQ.uUs1QpN8qhHddelO3gU-PNwmcE052GJcN0ahOvIcUQY
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 168

{
  "id" : "9bc28702-826b-4d60-b4c5-015f24484d6d",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
}

Create patient

POST /api/v1/patient HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwZWRyZXJhQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NiwiZXhwIjoxNjkwMjAzNzk2fQ.uUs1QpN8qhHddelO3gU-PNwmcE052GJcN0ahOvIcUQY
Content-Length: 168
Host: localhost:8080

{
  "id" : "c9118cbb-576b-48aa-9fde-81baabfb72f5",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 168

{
  "id" : "c9118cbb-576b-48aa-9fde-81baabfb72f5",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
}

Update patient

PUT /api/v1/patient/66a8a6d3-9b07-4b53-98a7-6121a07dc4be HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwZWRyZXJhQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NiwiZXhwIjoxNjkwMjAzNzk2fQ.uUs1QpN8qhHddelO3gU-PNwmcE052GJcN0ahOvIcUQY
Content-Length: 168
Host: localhost:8080

{
  "id" : "66a8a6d3-9b07-4b53-98a7-6121a07dc4be",
  "name" : "Juan",
  "lastName" : "Perez",
  "email" : "grg@gmail.com",
  "cellphoneNumber" : "+542616320489"
}
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 45

El paciente se editó correctamente en la BDD

Delete patient by id

DELETE /api/v1/patient/a0e0a6e5-5b76-4e39-8842-33120204d1d8 HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwZWRyZXJhQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NiwiZXhwIjoxNjkwMjAzNzk2fQ.uUs1QpN8qhHddelO3gU-PNwmcE052GJcN0ahOvIcUQY
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 44

El paciente se borró exitosamente de la BDD

Delete all patients

DELETE /api/v1/patient HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwZWRyZXJhQGdtYWlsLmNvbSIsImlhdCI6MTY5MDIwMjM1NiwiZXhwIjoxNjkwMjAzNzk2fQ.uUs1QpN8qhHddelO3gU-PNwmcE052GJcN0ahOvIcUQY
Host: localhost:8080
HTTP/1.1 200 OK
Content-Type: text/plain;charset=UTF-8
Content-Length: 43

Se eliminaron todos los pacientes de la BDD