# API
CoviDok API accepts and sends JSON objects. The basic response structure is composed of three fields, as seen below;
{
"version" : "1"
"status": "OK/ERR"
"body" : "Description/data"
}
The "response" field contains the actual content of the answer, while "status" indicates if the request was successful (value is either ERR or OK).
Error codes coming soon.
# Accepted calls
## Auth
### POST /api/Auth/login
Login authentication. Requires account login info, returns a session ID and the ientity of the logged in entity.
|Type|JSON|
|-----|-----|
|Request|{
"email" : string,
"password": string
}|
|Response|{
"id" : SessionID,
"firstName": x.Firstname,
"lastName": x.Lastname,
"role": "Doc/Ast/Par"
}|
### POST /api/Auth/register
Registration call. Returns with the type and ID of the created entity.
|Type|JSON|
|-----|-----|
|Request|{
"firstName": string,
"lastName": string,
"email": string,
"password": string,
"role": "Doc/Ast/Par"
}|
|Response|{
"role": "Doc/ast/Par",
"ID": string}|
### POST /api/Auth/child
Adds a child to a parent. A parent can only add children to its own account (Parent is determined from session IDs).
|Type|JSON|
|-----|-----|
|Request|{
"id": sessionID,
"firstName": string,
"lastName": string,
"birthDate": string,
"socSecNum": string
}|
|Response|{
"ChildID": Child.Id
}|
## Doc
### GET /api/Doc
Lists all registered doctors in the system. Might be filterable in the future.
|Type|JSON|
|-----|-----|
|Request|{
"id": sessionID
}|
|Response|{[[doc.Firstname, doc.Lastname, doc.Id], ...]}
### GET /api/Doc/{id}/assistants
Lists assistants for a specific doctor.
|Type|JSON|
|-----|-----|
|Request|{
"id": sessionID
}|
|Response|{[
"firstName": Assistant.Firstname,
"lastName" : Assistant.Lastname,
"id" : Assistant.Id], ...
}|
### GET /api/Doc/{id}/children
Lists childern with onging or finished cases assigned to a doctor.
|Type|JSON|
|-----|-----|
|Request|{
"id": sessionID
}|
|Response|{[
"firstName": Child.Firstname,
"lastName" : Child.Lastname,
"id" : Child.Id], ...
}|
## Case
### POST /api/Case/{id}/certreq
Posts a request for health certification. Must be related to a closed Task (represented by TaskID).
|Type|JSON|
|-----|-----|
|Request|{
"id": SessionID,
}|
|Response|{
"certID": string
}|
### GET /api/Case/{id}/certreq
Check status of health certification. Must be related to a closed Task (represented by TaskID).
|Type|JSON|
|-----|-----|
|Request|{
"id": SessionID,
}|