Skip to content

API Calls

Tomasz Tomys edited this page May 9, 2016 · 47 revisions

API Calls

/reset
/authorizations
/doctors

/reset

POST /reset

Reset DB to default state.

/authorizations

POST /authorizations

Params:

{
  email: String  
  password: String
}

Responses:

{  
  login: true
  user: Doctor/Patient/Admin-Entity (see e.g. GET /doctors/{id} ) 
}
422
{  
  login: false
}

/user

GET /user

Params:

{
}

Response:

{  
  id: Int,
  name: String,
  surname: String,
  email: String,
  pesel: String,
  type: String ['patient', 'doctor', 'admin']
  ?specialization: String
}

/doctors

GET /doctors

Params:

{
  ?specialization: String
}

Response:

[ 
    {  
      id: Int,
      name: String,
      surname: String,
      email: String,
      type: 'doctor'
      specialization: String
    }
]

GET /doctors/{id}

Params:

{
  id: Int
}

Responses:

Doctor-Entity
422
{
  error: "Doctor not found"
}

DELETE /doctors/{id}

Params:

{
  id: Int
}

Responses:

[]
422
{
  error: "Doctor not found"
}

PUT /doctors/{id}

Params:

{
  id: Int
}

Body:

  Doctor-Entity

Responses:

[]
422
{
  error: "Doctor not found"
}

POST /doctors

Body:

{
  Doctor-Entity (without id)
}

Responses:

[]

/patients

The same as /doctors, but Patient-Entity is:

    {  
      id: Int,
      name: String,
      surname: String,
      email: String,
      pesel: String,
      type: 'patient'
    }