IDICare

API Documentation1.0.0

Authentication
post
/auth/registerRegister of an administrator.

Parameters

Name
Description

Auth

json

body

The register of a Authenticator resource
Example
{
	"fullname": "Sílvia Abreu",
	"email": "silvia.abreu@sketchpixel.com",
	"password": "password"
} 

Responses

Code
Description

201

User registration successful
Example
{"message":"User registration successful"} 

500

Register not validate because duplicate entry
Example
{
    "message": "Duplicate entry",
    "details": "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry silvia.abreu@sketchpixel.com for key email_UNIQUE"
} 
post
/auth/activateActivate login to an administrator.

Parameters

Name
Description

Activation

json

body

Activate a Authenticator resource
Example
{
	"hash": "cbfbec9b1f763d8bf8e35653d4280f99318e11b8"
} 

Responses

Code
Description

201

User activation successful
Example
{
    "message": "User activation successful"
} 
post
/auth/password/requestPassword request.

Parameters

Name
Description

Request

json

body

Request password
Example
{
	"email": "silvia.abreu@sketchpixel.com"
} 

Responses

Code
Description

201

Password request successfully
Example
{
    "message": "User password request successful"
} 
post
/auth/password/recoverRecover password.

Parameters

Name
Description

Recover

json

body

Recover password
Example
{
	"hash": "0c722b2b7ef8e1dd4ffbff1b8537c0eccc60a265",
	"password": "novapass"
} 

Responses

Code
Description

201

Password recover successfully
Example
{
    "message": "User password change successful"
} 
get
/auth/loginLogin

Parameters

Name
Description

Authorization * required

string

header

Basic Authentication
Example
Basic base64("<email>:<password>")
Basic eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Responses

Code
Description

200

Login successful
Example
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4"
} 
Users
get
/userRetrieves User Authenticated

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Responses

Code
Description

200

Retrieves authenticated user
Example
{
    "uid": "5ac7346160468",
    "fullname": "Sílvia Abreu",
    "email": "silvia.abreu@teste.com"
} 
get
/users/{user_id}/Retrieves a User resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Id to identify user

Responses

Code
Description

200

User retrieve
Example
{
    "uid": "5ac7346160468",
    "fullname": "Sílvia Abreu",
    "email": "silvia.abreu@teste.com"
} 
put
/users/{user_id}/Replaces a User resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

user

json

body

The updated User resource.
Example
{
    "fullname": "Teste  Abreu",
    "email": "silvia.abreu@teste.com"
} 

Responses

Code
Description

200

User updated
Example
{"message":"User update successful"} 
Users»Notifications
get
/users/{user_uid}/notifications/Retrieves all type notifications of a user

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

Size

integer

parameters

Select the size to create the collection of notifications of a user.
Example
?size=10 

Offset

integer

parameters

Select the offset to create the collection of notifications of a user.
Example
?offset=0 

Type

integer

parameters

Select the type of notiffication
Example
?type=2  (1- SMS; 2- Email ; 3- Push) 

Responses

Code
Description

200

Retrieves all notifications of a user by type
Example
"[
    {
        "user_id": "1",
        "type": "2",
        "email": "tetet@mkregwkjjakr"
},
{
        "user_id": "1",
        "type": "2",
        "email": "Espanha@spain.es"
},
{
        "user_id": "1",
        "type": "2",
        "email": "gmamaskn@spain.es"
},
{
        "user_id": "1",
        "type": "2",
        "email": "email@servidor.pt"
}
]" 
post
/users/{user_uid}/notificationsCreates a notification for a user

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

notification SMS

json

body

Creates a SMS notification for a user
Example
{
	"type": 1,
	"country" : "England",
	"phone" : "888777666"
} 

notification Email

json

body

Creates a Email notification for a user
Example
{
	"type": 2,
	"email" : "email@servidor.pt"
} 

notification Push

json

body

Creates a Push notification for a user
Example
{
	"type": 3,
	"code" : "11E772TT883833"
} 

Responses

Code
Description

201

Creates a sucessufuly notifications
Example
{"message":"Success"} 
Users»Messages Notifications
get
/users/{user_uid}/messagesRetrieves all messages notifications of a user

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

Size

integer

parameters

Select the size to create the collection of notifications of a watch.
Example
?size=3 

Offset

integer

parameters

Select the offset to create the collection of notifications of a watch.
Example
?offset=0 

Responses

Code
Description

200

Retrieves all messages notifications of a user
Example
"[
    {
    "id": "4",
    "message": "Message to send",
    "reading_time": null
    },
    {
    "id": "6",
    "message": "Send a message to user",
    "reading_time": null
    },
    {
    "id": "7",
    "message": "Send a notifications to arthur-clay",
    "reading_time": null
    }
]" 
get
/users/{user_uid}/messages/{message_id}Retrieves a message notification of a user

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

message_id * required

integer

path

Id to identify the message notification

Responses

Code
Description

200

Retrieves a specific message notification of a user
Example
"{
    "id": "5",
    "message": "Send a message to user",
    "reading_time": null
}" 
post
/users/{user_uid}/messagesCreates a message notification for a user

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

message notification * required

json

body

Creates a message notification for a user
Example
{
	"message" : "Message to send"
} 

Responses

Code
Description

201

Creates a sucessufuly message notifications
Example
"{
    "id": "9",
    "message": "Message notification to send to the user",
    "reading_time": null
}" 
put
/users/{user_uid}/messages/{message_id}/readUpdates the reading time of a message notification

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

message_id * required

integer

path

Id to identify the message notification

Responses

Code
Description

200

Updates de reading time sucessufuly of a message notification.
Example
"{
    "id": "9",
    "message": "Message notification to send to the user",
    "reading_time": "2018-05-11T09:36:00+01:00"
}" 
Users»Warnings
get
/users/{user_uid}/warningsRetrieves all Warnings of a user

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

size

integer

parameters

Select the size to create the collection of readings
Example
?size=3 

offset

integer

parameters

Select the offset to create the collection of readings
Example
?offset=2 

Responses

Code
Description

200

Retrieves all warnings of a user
Example
[
    {
    "id": "3",
    "type": "4",
    "priority": "2",
    "title": "Information",
    "message": "Alterations on temperature",
    "args": "",
    "create_time": "2018-06-07T09:44:31+01:00",
    "reading_time": null,
    "user_id": "1"
    },
    {
    "id": "1",
    "type": "5",
    "priority": "1",
    "title": "Atention",
    "message": "Alterations on your blood pressure",
    "args": "",
    "create_time": "2018-06-07T09:12:23+01:00",
    "reading_time": null,
    "user_id": "1"
    }
] 
get
/users/{user_uid}/warnings/{warning_id}Retrieves a Warning

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

warning_id * required

integer

path

Unique identifier of warning

Responses

Code
Description

200

Retrieves a specific warning
Example
{
    "id": "1",
    "type": "5",
    "priority" :"1",
    "title": "Atention",
    "message": "Alterations on your blood pressure",
    "args": "",
    "create_time": "2018-06-07T09:12:23+01:00",
    "reading_time": null,
    "user_id": "1"
} 
post
/users/{user_uid}/warningsRegister a Warning resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

Warning * required

json

body

Create a Warning
Example
{
    "type": 4,
    "priority": 2,
    "title":"Information",
    "message":"Alterations on temperature", 
    "args": ""
} 

Responses

Code
Description

201

Creates a warning
Example
{
    "id": "4",
    "type": "2",
    "priority": "3",
    "title": "Information",
    "message": "Alterations on temperature",
    "args": "You must control your temperature.",
    "create_time": "2018-06-07T15:05:40+01:00",
    "reading_time": null,
    "user_id": "1"
} 
put
/users/{user_uid}/warnings/{warning_id}Update a Warning resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

warning_id * required

integer

path

Unique identifier of warning

Warning * required

json

body

Update the warning
Example
{
  "reading_time": "2018-06-08T16:00:00+01:00"
} 

Responses

Code
Description

200

Updates the reading time of a warning
Example
{
    "id": "4",
    "type": "2",
    "priority": "3",
    "title": "Information",
    "message": "Alterations on temperature",
    "args": "You must control your temperature.",
    "create_time": "2018-06-07T15:05:41+01:00",
    "reading_time": "2018-06-08T15:40:00+01:00",
    "user_id": "1"
} 
delete
/users/{user_uid}/warnings/{warning_id}Deletes a Warning resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

warning_id * required

integer

path

Unique identifier of warning

Responses

Code
Description

200

Deletes a specific warning
Example
{
    "message": "Warning deleted"
} 
Watches
get
/users/{user_uid}/watches/Retrieves the collection of Watches resources by User.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Size

integer

parameters

Select the size of collection of watches
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of watches
Example
?offset=2 

user_uid * required

integer

path

Unique identifier of a user

Responses

Code
Description

200

Retrieves all watches associated to a user
Example
[
    {
        "id": "1",
        "watch_uid": "5ab8cafbb3adb",
        "status": "1",
        "profile_id": "1",
        "profile_name": "António Carlos Pereira"
    },
    {
        "id": "2",
        "watch_uid": "Testes Imei",
        "status": "1",
        "profile_id": "2",
        "profile_name": "Manuel Silva"
    }
] 
get
/users/{user_uid}/watches/{watch_id}Retrieves a Watch resource by User.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Responses

Code
Description

200

Retrieves a watch associated to the user
Example
{
    "id": "2",
    "watch_uid": "Testes Imei",
    "status": "1",
    "profile_id": "2",
    "profile_name": "Manuel Silva"
} 
post
/users/{user_uid}/watchesCreates an association between a Watch and an User.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique Identifier to identify user

Watch

json

body

Data to insert to create association
Example
{ 
	"watch_uid": "Id ùnico",
	"profile_name": "Timóteo"
} 

Responses

Code
Description

201

Watch associated sucefull to a user
Example
{
    "id": "14",
    "watch_uid": "Id ùnico",
    "status": "1",
    "profile_id": "14",
    "profile_name": "Timóteo"
} 

400

Watch already associated
Example
{
    "message": "Watch already associated"
} 
put
/users/{user_uid}/watches/{watch_id}Replaces Status of a Watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique Identifier to identify user

watch_id * required

integer

path

Id to identify watch

status

json

body

Status of the watch
Example
{
	"status": 1
} 

Responses

Code
Description

200

Virtual Watch update sucefull
Example
{
    "id": "14",
    "watch_uid": "Id ùnico",
    "status": "1",
    "profile_id": "14",
    "profile_name": "Timóteo"
} 
Watches»Readings
get
/users/{user_uid}/watches/{watch_id}/readings/lastsRetrieves last readings from a watch.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Responses

Code
Description

200

Retrieves the collection of the last readings
Example
[
{
    "type_id": "3",
    "type": "Body Temperature",
    "reading_time": "2018-04-13T15:20:00+01:00",
    "id": "12",
    "min": "38",
    "max": "40",
    "avg": "39",
    "std_dev": "2"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:20:00+01:00",
    "id": "9",
    "min": "60",
    "max": "90",
    "avg": "75",
    "std_dev": "1"
},
{
    "type_id": "4",
    "type": "Oxygen Level",
    "reading_time": "2018-04-13T14:20:00+01:00",
    "id": "15",
    "min": "60",
    "max": "90",
    "avg": "75",
    "std_dev": "1"
},
{
    "type_id": "2",
    "type": "Heart Pressure",
    "reading_time": "2018-04-15T23:30:00+01:00",
    "id": "29",
    "min": "9.5",
    "max": "15.1"
},
{
    "type_id": "5",
    "type": "Position",
    "reading_time": "2018-04-13T14:50:00+01:00",
    "id": "6",
    "latitude": "41.5533040",
    "longitude": "-8.4358740"
}
] 
get
/users/{user_uid}/watches/{watch_id}/readings/{type_id}Retrieves all readings from a watch by type.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

type_id * required

integer

path

Unique identifier to identify type of reading

size

integer

parameters

Select the size to create the collection of readings
Example
?size=3 

offset

integer

parameters

Select the offset to create the collection of readings
Example
?offset=2 

Responses

Code
Description

200

Retrieves the collection of a type of readings
Example
[
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:20:00+01:00",
    "id": "9",
    "min": "60",
    "max": "90",
    "avg": "75",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:10:00+01:00",
    "id": "8",
    "min": "75",
    "max": "90",
    "avg": "82.5",
    "std_dev": "2"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:00:00+01:00",
    "id": "7",
    "min": "70",
    "max": "90",
    "avg": "80",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-11T19:00:00+01:00",
    "id": "17",
    "min": "60",
    "max": "80",
    "avg": "70",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-11T18:00:00+01:00",
    "id": "18",
    "min": "80",
    "max": "90",
    "avg": "85",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-11T14:00:00+01:00",
    "id": "19",
    "min": "60",
    "max": "80",
    "avg": "70",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-03-01T18:00:00+01:00",
    "id": "16",
    "min": "60",
    "max": "90",
    "avg": "75",
    "std_dev": "1"
}
] 
get
/users/{user_uid}/watches/{watch_id}/readings/{type_id}/interval/Retrieves all readings from a watch by type and between two dates.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

type_id * required

integer

path

Unique identifier to identify type of reading

start

datetime

parameters

Select the start date to get the collection of readings
Example
?start=2018-08-29T00:00:00+00:00 

end

datetime

parameters

Select the end date to get the collection of readings
Example
?end=2018-08-29T23:59:59+00:00 

Responses

Code
Description

200

Retrieves the collection of a type of readings
Example
[
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:20:00+01:00",
    "id": "9",
    "min": "60",
    "max": "90",
    "avg": "75",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:10:00+01:00",
    "id": "8",
    "min": "75",
    "max": "90",
    "avg": "82.5",
    "std_dev": "2"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-13T14:00:00+01:00",
    "id": "7",
    "min": "70",
    "max": "90",
    "avg": "80",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-11T19:00:00+01:00",
    "id": "17",
    "min": "60",
    "max": "80",
    "avg": "70",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-11T18:00:00+01:00",
    "id": "18",
    "min": "80",
    "max": "90",
    "avg": "85",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-04-11T14:00:00+01:00",
    "id": "19",
    "min": "60",
    "max": "80",
    "avg": "70",
    "std_dev": "1"
},
{
    "type_id": "1",
    "type": "Heart Rate",
    "reading_time": "2018-03-01T18:00:00+01:00",
    "id": "16",
    "min": "60",
    "max": "90",
    "avg": "75",
    "std_dev": "1"
}
] 
post
/users/{user_uid}/watches/{watch_id}/readingsCreates a reading by a virtual watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

reading

json

body

Creates a watch reading
Example
{"type_id":"1","reading_time":"2018-08-22T17:25:00+01:00","min":"57.5","max":"75.5","avg":"64.5","std_dev":"62.6","last":"65.25","samples":"5"} 

reading by Blood Pressure

json

body

Creates a watch reading of Type Blood Pressure
Example
{"type_id":"2","reading_time":"2018-08-22T17:35:00+01:00","min_min":"80","min_max":"80","min_avg":"80","min_std_dev":"80","min_last":"80","max_min":"120","max_max":"120","max_avg":"120","max_std_dev":"120","max_last":"120","samples":"5"} 

reading by Position

json

body

Creates a watch reading of Type Position
Example
{"type_id":"5","reading_time":"2018-08-22T17:45:00+01:00","latitude":"41.561642","longitude":"-8.430225"} 

Responses

Code
Description

201

Creates a watch reading sucessufly
Example
{"message":"Success"} 
post
/watches/readingsCreates a Reading

Parameters

Name
Description

reading by Blood Pressure

json

body

Creates a watch reading of Type Blood Pressure
Example
{"imei":"device-001","type_id":"2","reading_time":"2018-08-22T17:35:00+01:00","min_min":"80","min_max":"80","min_avg":"80","min_std_dev":"80","min_last":"80","max_min":"120","max_max":"120","max_avg":"120","max_std_dev":"120","max_last":"120","samples":"5"}  

reading

json

body

Creates a watch reading of Type different of Position and Blood Rate
Example
{"imei":"device-001","type_id":"1","reading_time":"2018-08-22T17:25:00+01:00","min":"57.5","max":"75.5","avg":"64.5","std_dev":"62.6","last":"65.25","samples":"5"} 

reading by Position

json

body

Creates a watch reading of Type Position
Example
{"imei":"device-001","type_id":"5","reading_time":"2018-08-22T17:45:00+01:00","latitude":"41.561642","longitude":"-8.430225"} 

Responses

Code
Description

201

Creates a watch reading sucessufly
Example
{"message":"Success"} 
Watches»Notifications
get
/users/{user_uid}/watches/{watch_id}/notifications/Retrieves all notifications by watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of notifications of a watch.
Example
?size=3 

Offset

integer

parameters

Select the offset to create the collection of notifications of a watch.
Example
?offset=0 

Responses

Code
Description

200

Retrieves all notifications of a watch
Example
"[
    {
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "1",
    "code": "11E772TT883833"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "2",
    "code": "Teste notificacao"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "3",
    "code": "uuewr94385jksdj"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "4",
    "code": "134256376347"
}
]" 
post
/users/{user_uid}/watches/{watch_id}/notificationsCreates a notification for a watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

watch notification

json

body

Creates a notification for a watch
Example
{
	"type": 3,
	"active": 1,
	"code" : "11E772TT883833"
} 

Responses

Code
Description

201

Create a notification successfully
Example
{"message":"Success"} 
put
/users/{user_uid}/watches/{watch_id}/notifications/{notification_id}Updates status of a notification for a watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify virtual watch

notification_id * required

integer

path

Id to identify notification

Active * required

integer

body

Status of notification (0 - Inactive; 1- Active)
Example
{
	"active": 0
} 

Responses

Code
Description

200

Updates status of notification
Example
{
    "id": "3",
    "type": "3",
    "code": "123ejhr435351ll",
    "active": "0",
    "watch_id": "1"
} 
get
/watches/{IMEI}/notifications/Retrieves all notifications by watch through IMEI

Parameters

Name
Description

IMEI * required

string

path

IMEI to identify the watch

Responses

Code
Description

200

Retrieves all notifications of a watch through IMEI
Example
[
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "1",
    "code": "11E772TT883833"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "2",
    "code": "jwdjkhasjhjas"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "3",
    "code": "123ejhr435351ll"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "4",
    "code": "teste com imei"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "5",
    "code": "teste com imei"
},
{
    "watch_id": "1",
    "active": "1",
    "type": "3",
    "id": "6",
    "code": "dsjhjhgjhdjkghdjkghl"
}
] 
post
/watches/{IMEI}/notificationsCreates a notification for a watch through IMEI

Parameters

Name
Description

IMEI * required

string

path

IMEI to identify the watch

watch notification * required

json

body

Creates a notification for a watch
Example
{
	"type": 3,
	"active": 1,
	"code" : "11E772TT883833"
} 

Responses

Code
Description

201

Create a notification successfully
Example
{"message":"Success"} 
put
/watches/{IMEI}/notifications/{notification_id}Update status of a notification for a watch through IMEI

Parameters

Name
Description

IMEI * required

string

path

IMEI to identify the watch

notification_id * required

integer

path

Id to identify notification

Active * required

integer

body

Status of notification (0 - Inactive; 1- Active)
Example
{
	"active": 0
} 

Responses

Code
Description

200

Updates status of notification through IMEI
Example
{
    "id": "3",
    "type": "3",
    "code": "123ejhr435351ll",
    "active": "0",
    "watch_id": "1"
} 
Watches»Messages Notifications
get
/users/{user_uid}/watches/{watch_id}/messagesRetrieves all messages notifications of a watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify virtual watch

Size

integer

parameters

Select the size to create the collection of notifications of a watch.
Example
?size=3 

Offset

integer

parameters

Select the offset to create the collection of notifications of a watch.
Example
?offset=0 

Responses

Code
Description

200

Retrieves all messages notifications of a watch
Example
"[
{
    "id": "1",
    "message": "teste sem reading_time",
    "reading_time": "2018-05-11T14:59:46+01:00"
},
{
    "id": "2",
    "message": "Send message through a watch",
    "reading_time": null
},
{
    "id": "3",
    "message": "Send new message",
    "reading_time": "2018-05-11T13:31:21+01:00"
}
]" 
get
/users/{user_uid}/watches/{watch_id}/messages/{message_id}Retrieves a message notification of a watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify virtual watch

message_id * required

integer

path

Id to identify the message notification

Responses

Code
Description

200

Retrieves a specific message notification of a watch
Example
{
    "id": "1",
    "message": "teste sem reading_time",
    "reading_time": "2018-05-11T14:59:46+01:00"
}" 
post
/users/{user_uid}/watches/{watch_id}/messagesCreates a message notification for a watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify virtual watch

message notification * required

json

body

Creates a message notification for a watch
Example
{
	"message" : "Message to send"
} 

Responses

Code
Description

201

Creates a sucessufuly message notifications
Example
"{
    "id": "9",
    "message": "Message notification to send to the user",
    "reading_time": null
} 
put
/users/{user_uid}/watches/{watch_id}/messages/{message_id}/readUpdates the reading time of a message notification

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify virtual watch

message_id * required

integer

path

Id to identify the message notification

Responses

Code
Description

200

Updates de reading time sucessufuly of a message notification.
Example
{
    "id": "9",
    "message": "Message notification to send to the user",
    "reading_time": "2018-05-11T09:36:00+01:00"
} 
get
/watches/{IMEI}/messagesRetrieves all notifications through the IMEI

Parameters

Name
Description

IMEI * required

string

path

IMEI to identify the watch

Size

integer

parameters

Select the size to create the collection of notifications of a watch.
Example
?size=3 

Offset

integer

parameters

Select the offset to create the collection of notifications of a watch.
Example
?offset=0 

Responses

Code
Description

200

Retrieves all messages notifications through the IMEI
Example
"[
{
    "id": "1",
    "message": "teste sem reading_time",
    "reading_time": "2018-05-11T14:59:46+01:00"
},
{
    "id": "2",
    "message": "Send message through a watch",
    "reading_time": null
},
{
    "id": "3",
    "message": "Send new message",
    "reading_time": "2018-05-11T13:31:21+01:00"
}
]" 
get
/watches/{IMEI}/messages/{message_id}Retrieves a message notification of a watch through IMEI

Parameters

Name
Description

IMEI * required

string

path

IMEI to identify the watch

message_id * required

integer

path

Id to identify the message notification

Responses

Code
Description

200

Retrieves a specific message notification of a watch through IMEI
Example
{
    "id": "1",
    "message": "teste sem reading_time",
    "reading_time": "2018-05-11T14:59:46+01:00"
} 
put
/watches/{IMEI}/messages/{message_id}/readUpdates the reading time of a message notification through IMEI

Parameters

Name
Description

IMEI * required

string

path

IMEI to identify the watch

message_id * required

integer

path

Id to identify the message notification

Responses

Code
Description

200

Updates de reading time sucessufuly of a message notification through IMEI
Example
{
    "id": "2",
    "message": "Send message through a watch",
    "reading_time": "2018-05-11T18:30:28+01:00"
} 
Profile
get
/users/{user_uid}/watches/{watch_id}/profileRetrieves the Profile of a Watch.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify the user

watch_id * required

integer

path

Id to identify watch

Responses

Code
Description

200

Retrieves profile sucefull
Example
{
    "id": "1",
    "name": "António Carlos Pereira",
    "blood_type": "O+",
    "contacts": [
        {
            "id": "4",
            "type": "email",
            "contact": "teste@testes.com"
        },
        {
            "id": "5",
            "type": "phone",
            "contact": "998899999"
        },
        {
            "id": "8",
            "type": "address",
            "contact": "S. Andrews Street 126"
        }
    ],
    "relation": [
        {
            "id": "2",
            "name": "Manuel Jeitoso",
            "relation": "other",
            "contacts": [
                {
                    "id": "6",
                    "type": "phone",
                    "contact": "259xxxxxx"
                }
            ]
        },
        {
            "id": "3",
            "name": "Sara",
            "relation": "mother",
            "contacts": [
                {
                    "id": "18",
                    "type": "phone",
                    "contact": "998877667"
                },
                {
                    "id": "19",
                    "type": "email",
                    "contact": "son@teste.pt"
                },
                {
                    "id": "20",
                    "type": "address",
                    "contact": "Rua Luís da Silva Barros 30 2ºdrt"
                }
            ]
        }
    ],
    "ssnumbers": null,
    "diseases": [
        {
            "id": "2",
            "name_id": "6",
            "name": "Reumatismo",
            "comments": "teste"
        },
        {
            "id": "5",
            "name_id": "6",
            "name": "Reumatismo",
            "comments": "teste"
        },
        {
            "id": "6",
            "name_id": "6",
            "name": "Reumatismo",
            "comments": "teste"
        }
    ],
    "insurances": [
        {
            "id": "2",
            "name": "Tranquilidade Seguros",
            "number": "999 999 999 999",
            "expire_date": "2018-12-31"
}
]
} 
put
/users/{user_uid}/watches/{watch_id}/profileReplaces a Profile resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify the user

watch_id * required

integer

path

Id to identify watch

Profile

json

body

The new profile resource
Example
{
	"name": "António Carlos Pereira",
	"blood_type": "O+"
} 

Responses

Code
Description

200

Update profile sucefull
Example
{
    "id": "1",
    "name": "António Carlos Pereira",
    "blood_type": "O+"
} 
Profile»Contacts
get
/users/{user_uid}/watches/{watch_id}/profile/contacts/Retrieves the collection of Contacts

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size of collection of contacts of a profile
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of contacts of a profile
Example
?offset=2 

Responses

Code
Description

200

Get all contacts of profile sucefull
Example
[
    {
        "id": "3",
        "type": "phone",
        "contact": "964444444"
    },
    {
        "id": "4",
        "type": "email",
        "contact": "teste@testes.com"
    },
    {
        "id": "5",
        "type": "phone",
        "contact": "998899999"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/profile/contacts/{contact_id}Retrieves Contact by Id

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

contact_id * required

integer

path

Id to identify contact

Responses

Code
Description

200

Gets sucefully a Contact
Example
{
    "id": "3",
    "type": "phone",
    "contact": "964444444"
} 
post
/users/{user_uid}/watches/{watch_id}/profile/contactsCreate a Contact resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

contact

json

body

The new contact resource
Example
{
	"type": "phone",
	"contact": "998877665"
} 

Responses

Code
Description

201

Create a contact sucefull
Example
{
    "id": "14",
    "type": "phone",
    "contact": "998877665"
} 
put
/users/{user_uid}/watches/{watch_id}/profile/contacts/{contact_id}Replaces a Contact resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

contact_id * required

integer

path

Id to identify contact

contact

json

body

Replace contact resource
Example
{
	"type": "address",
	"contact": "S. Andrews Street 123"
} 

Responses

Code
Description

200

Update contact of a profile sucefull
Example
{
    "id": "8",
    "type": "address",
    "contact": "S. Andrews Street 126"
} 
delete
/users/{user_uid}/watches/{watch_id}/profile/contacts/{contact_id}Removes a Contact resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Unique identifier to identify user

contact_id * required

integer

path

Unique identifier to identify user

Responses

Code
Description

200

Delete a contact of a profile sucefull
Example
{
    "message": "Contact deleted"
} 
Profile»Relations
get
/users/{user_uid}/watches/{watch_id}/profile/relations/Retrieves all relations associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size of collection of relations associated to a profile.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of relations associated to a profile.
Example
?offset=2 

Responses

Code
Description

200

All Relations associated to a Profile
Example
[
    {
        "id": "6",
        "name": "Pedro Castro",
        "relation": "doctor"
    },
    {
        "id": "7",
        "name": "Ana Matos",
        "relation": "other"
    },
    {
        "id": "8",
        "name": "Luís Pereira",
        "relation": "son"
    },
    {
        "id": "9",
        "name": "António Cardoso",
        "relation": "doctor"
    }
] 
post
/users/{user_uid}/watches/{watch_id}/profile/relationsAssociates a relation to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Relation

json

body

New relation resource associated to the profile
Example
{
	"name": "António Cardoso",
	"relation": "doctor"
} 

Responses

Code
Description

201

Creates a new relation to a profile
Example
{
    "id": "9",
    "name": "António Cardoso",
    "relation": "doctor"
} 
put
/users/{user_uid}/watches/{watch_id}/profile/relations/{relation_id}Updates data from a relation associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

relation_id * required

integer

path

Id to identify relation

Relation

json

body

New relation resource associated to the profile
Example
{
	"name": "António da Silva Cardoso",
	"relation": "doctor"
} 

Responses

Code
Description

200

Updates the relation associated to a profile
Example
{
    "id": "9",
    "name": "António da Silva Cardoso",
    "relation": "doctor"
} 
delete
/users/{user_uid}/watches/{watch_id}/profile/relations/{relation_id}Deletes the association of the relation to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

relation_id * required

integer

path

Id to identify relation

Responses

Code
Description

200

Deletes the relation associated to a profile
Example
{
    "message": "Relation deleted"
} 
Profile»Relations»Contacts
get
/users/{user_uid}/watches/{watch_id}/profile/relations/{relation_id}/contacts/Retrieves all contacts of a relation associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

relation_id * required

integer

path

Id to identify relation

Size

integer

parameters

Select the size of collection of contacts of a relation associated to a profile.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of contacts of a relation associated to a profile.
Example
?offset=2 

Responses

Code
Description

200

Retrieves all contacts of a relation from a profile
Example
[
    {
        "id": "10",
        "type": "address",
        "contact": "S. Paul s Street 56"
    },
    {
        "id": "11",
        "type": "phone",
        "contact": "657493021"
    },
    {
        "id": "12",
        "type": "email",
        "contact": "SonMarcus@postman.com"
    }
] 
post
/users/{user_uid}/watches/{watch_id}/profile/relations/{relation_id}/contactsAssociates a contact of a relation associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

relation_id * required

integer

path

Id to identify relation

Contact

json

body

New contact resource associated to a relation of a profile
Example
{
	"type": "phone",
	"contact": "734657863578"
} 

Responses

Code
Description

201

Associates a contact of a relation from a profile
Example
{
    "id": "16",
    "type": "phone",
    "contact": "734657863578"
} 
put
/users/{user_uid}/watches/{watch_id}/profile/relations/{relation_id}/contacts/{contact_id}Updates data from a contact of a relation associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

relation_id * required

integer

path

Id to identify relation

contact_id * required

integer

path

Id to identify contact

Contact

json

body

Updates contact resource associated to a relation of a profile
Example
{
	"type": "phone",
	"contact": "+351998877660"
} 

Responses

Code
Description

200

Updates a contact of a relation from a profile
Example
{
    "id": "16",
    "type": "phone",
    "contact": "+351998877660"
} 

404

Contact not found to relation
Example
{
    "message": "Contact not found"
} 
delete
/users/{user_uid}/watches/{watch_id}/profile/relations/{relation_id}/contacts/{contact_id}Deletes the a contact of a relation associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

relation_id * required

integer

path

Id to identify relation

contact_id * required

integer

path

Id to identify contact

Responses

Code
Description

200

Retrieves all contacts of a relation from a profile
Example
{
    "message": "Contact deleted"
} 
Profile»Diseases
get
/users/{user_uid}/watches/{watch_id}/profile/diseases/Retrieves all diseases associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size of collection of diseases associated to a profile.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of diseases associated to a profile.
Example
?offset=2 

Responses

Code
Description

200

Retrieves all diseases associated to a profile
Example
[
    {
        "id": "9",
        "name_id": "6",
        "name": "Reumatismo",
        "comments": "teste"
    },
    {
        "id": "10",
        "name_id": "6",
        "name": "Reumatismo",
        "comments": "teste"
    },
    {
        "id": "11",
        "name_id": "12",
        "name": "Hipocoagulação",
        "comments": "Historial de TVP com défice Proteína S"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/profile/diseases/{disease_id}Retrieves specific disease associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

disease_id * required

integer

path

Id to identify disease

Responses

Code
Description

200

Retrieves a specific disease from a profile
Example
{
    "id": "5",
    "name_id": "3",
    "name": "Alzheimer",
    "comments": "Para testar as doenças"
} 
post
/users/{user_uid}/watches/{watch_id}/profile/diseasesAssociates a disease to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Disease

json

body

Associated a disease to a profile
Example
{
	"name_id": 12,
	"comments": "Historial de TVP com défice Proteína S"
} 

Responses

Code
Description

201

Associates a disease to a profile
Example
{
    "id": "11",
    "name_id": "12",
    "name": "Hipocoagulação",
    "comments": "Historial de TVP com défice Proteína S"
} 
put
/users/{user_uid}/watches/{watch_id}/profile/diseases/{disease_id}Updates data from a disease associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

disease_id * required

integer

path

Id to identify disease

Disease

json

body

Updates data from a disease associated to a profile
Example
{
	"name_id": 12,
	"comments": "Historial de TVP com défice Proteína S e C"
} 

Responses

Code
Description

200

Updates data of a disease associated to a profile
Example
{
    "id": "11",
    "name_id": "12",
    "name": "Hipocoagulação",
    "comments": "Historial de TVP com défice Proteína S"
} 
delete
/users/{user_uid}/watches/{watch_id}/profile/diseases/{disease_id}Deletes the association of the disease to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

disease_id * required

integer

path

Id to identify disease

Responses

Code
Description

200

Deletes a disease associated to a profile
Example
{
    "message": "Disease deleted"
} 
Profile»Insurances
get
/users/{user_uid}/watches/{watch_id}/profile/insurances/Retrieves all insurances associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size of collection of insurances associated to a profile.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of insurances associated to a profile.
Example
?offset=2 

Responses

Code
Description

200

Retrieves all insurances associated to a profile
Example
[
    {
        "id": "4",
        "name": "Seguros Nem Nem",
        "number": "111 222 333 444",
        "expire_date": "2019-01-01"
    },
    {
        "id": "5",
        "name": "Seguros Sem Saída",
        "number": "111 333 555 777",
        "expire_date": "2019-01-11"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/profile/insurances/{insurance_id}Retrieves a insurance associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

insurance_id * required

integer

path

Id to identify insurance

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Responses

Code
Description

200

Retrives a specific insurance associated to a profile
Example
{
    "id": "2",
    "name": "Tranquilidade Seguros",
    "number": "999 999 999 999",
    "expire_date": "2018-12-31"
} 
post
/users/{user_uid}/watches/{watch_id}/profile/insurancesAssociates a insurance to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Insurance

json

body

Creates a association between insurance and profile
Example
{
	"name": "Seguros Nem Nem",
	"number": "777 888 999 000",
	"expire_date": "2018-12-31"
} 

Responses

Code
Description

201

Associates a insurance to a profile
Example
{
    "id": "4",
    "name": "Seguros Nem Nem",
    "number": "777 888 999 000",
    "expire_date": "2018-12-31"
} 
put
/users/{user_uid}/watches/{watch_id}/profile/insurances/{insurance_id}Updates data from a insurance associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

insurance_id * required

integer

path

Id to identify insurance

Insurance

json

body

Update data from de association insurance and profile
Example
{
	"name": "Seguros Nem Nem",
	"number": "111 222 333 444",
	"expire_date": "2019-01-01"
} 

Responses

Code
Description

200

Update successfully data associated to a insurance of a profile
Example
{
    "id": "4",
    "name": "Seguros Nem Nem",
    "number": "111 222 333 444",
    "expire_date": "2019-01-01"
} 
delete
/users/{user_uid}/watches/{watch_id}/profile/insurances/{insurance_id}Deletes the association of the insurance to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

insurance_id * required

integer

path

Id to identify insurance

Responses

Code
Description

200

Deletes a insurance associated to a profile
Example
{
    "message": "Insurance deleted"
} 
Profile»Social Security Numbers
get
/users/{user_uid}/watches/{watch_id}/profile/ssnumbers/Retrieves all social security numbers associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size of collection of social security numbers associated to a profile.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of social security numbers associated to a profile.
Example
?offset=2 

Responses

Code
Description

200

Retrieves all associations between SSNumbers and a profile
Example
[
    {
        "id": "4",
        "type_id": "2",
        "type": "SAMS",
        "number": "SMS 123 123 999"
    },
    {
        "id": "5",
        "type_id": "3",
        "type": "PSP",
        "number": "PSP 123 123 999"
    },
    {
        "id": "6",
        "type_id": "1",
        "type": "ADSE",
        "number": "ADSE 000 123 999"
    }
] 
post
/users/{user_uid}/watches/{watch_id}/profile/ssnumbersAssociates a social security number to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

SSNumber

json

body

Social Security Number
Example
{
	"type_id": "2",
	"number": "SMS 123 123 999"
} 

Responses

Code
Description

201

Creates a association between a SSNumber and a profile
Example
{
    "id": "6",
    "type_id": "2",
    "type": "SAMS",
    "number": "SMS 123 123 999"
} 
put
/users/{user_uid}/watches/{watch_id}/profile/ssnumbers/{number_id}Updates data from a social security number associated to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

number_id * required

integer

path

Id to identify social security number

SSNumber

json

body

Social Security Number
Example
{
	"type_id": "2",
	"number": "SSN 000 123 999"
} 

Responses

Code
Description

200

Updates data from the association between a SSNumber and a profile
Example
{
    "id": "6",
    "type_id": "2",
    "type": "SAMS",
    "number": "SSN 000 123 999"
} 
delete
/users/{user_uid}/watches/{watch_id}/profile/ssnumbers/{number_id}Deletes the association of the social security number to a profile.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

number_id * required

integer

path

Id to identify social security number

Responses

Code
Description

200

Deletes a SSNumbers associated to a profile
Example
{
    "message": "Number deleted"
} 
Alerts
get
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/Retrieves the collection of Alerts of a given Type from a Watch

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to indentify the watch

reading_types_id * required

integer

path

Id to indentify type of reading

Size

integer

parameters

Select the size of collection of alerts of a given type from a watch.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of alerts of a given type from a watch.
Example
?offset=2 

Responses

Code
Description

200

Gets successfully all Alerts from specific watch and reading type
Example
[
    {
        "id": "1",
        "alert_time": "2018-04-21 08:00:00",
        "urgency_type": "2",
        "report": "valores alterados da média"
    },
    {
        "id": "2",
        "alert_time": "2018-04-22T18:30:00+01:00",
        "urgency_type": "1",
        "report": "Batimento cardíaco alterado"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}Retrieves an Alert of of a Watch and Reading Type

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to indentify the watch

reading_types_id * required

integer

path

Id to indentify type of reading

alert_id * required

integer

path

Id to indentify the alert

Responses

Code
Description

200

Gets successfully the Alert with specific id from said watch and reading type
Example
{
    "id": "2",
    "alert_time": "2018-04-22 18:30:00",
    "urgency_type": "1",
    "report": "Batimento cardíaco alterado"
} 

404

Alert not found from specific watch and reading type
Example
{
    "message": "Alert not found."
} 
post
/watches/readings/{watch_reading_id}/alertsRegister an Alert resource

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

watch_reading_id * required

integer

path

Id to indentify the watch reading

Alert Description

json

body

The new Alert
Example
{
	"alert_time" : "2018-04-22T18:30:00+01:00",
	"urgency_type" : "1",
	"report" : "Batimento cardíaco alterado"
} 

Responses

Code
Description

201

Registers successfully new Alert
Example
{
    "id": "2",
    "alert_time": "2018-04-22 18:30:00",
    "urgency_type": "1",
    "report": "Batimento cardíaco alterado"
} 
put
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}Updates urgency_type and report of an Alert Resource

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to indentify the watch

reading_types_id * required

integer

path

Id to indentify type of reading

alert_id * required

integer

path

Id to indentify the alert

Alert

json

body

The updated Alert
Example
{
    "urgency_type": "3",
    "report": "Batimento cardíaco acelarado"
} 

Responses

Code
Description

200

Updates successfully new Alert
Example
{
    "id": "2",
    "alert_time": "2018-04-22 18:30:00",
    "urgency_type": "3",
    "report": "Batimento cardíaco acelarado"
} 

404

Alert not found from specific watch and reading type
Example
{
    "message": "Resource not found."
} 
delete
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}Deletes an Alert Resource

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to indentify the watch

reading_types_id * required

integer

path

Id to indentify type of reading

alert_id * required

integer

path

Id to indentify the alert

Responses

Code
Description

200

Deletes successfully the Alert
Example
{
     "message": "Deleted successfully."
} 

404

Alert not found from specific watch and reading type
Example
{
    "message": "Alert not found."
} 
Alert»Notifications
get
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}/notifications/Retrieves all Notifications from specific alert

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

alert_id * required

integer

path

Id to identify the Alert

Size

integer

parameters

Select the size of collection of notifications from specific alert.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of notifications from specific alert.
Example
?offset=2 

Responses

Code
Description

200

Gets successfully all Notifications from specific watch, reading type and alert
Example
[
    {
        "id": "2",
        "watch_reading_alert_id": "10",
        "user_name": "Sara Maria",
        "time_alert_sent": "2018-04-11T10:51:45+01:00",
        "time_answered": null,
        "status": "1"
    },
    {
        "id": "3",
        "watch_reading_alert_id": "10",
        "user_name": "Carla Pereira",
        "time_alert_sent": "2018-04-11T10:51:53+01:00",
        "time_answered": null,
        "status": "1"
    },
    {
        "id": "4",
        "watch_reading_alert_id": "10",
        "user_name": "António Dias",
        "time_alert_sent": "2018-04-11T10:52:02+01:00",
        "time_answered": null,
        "status": "1"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}/notifications/{notification_id}Retrieves a notification from specific alert by id

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

alert_id * required

integer

path

Id to identify the Alert

notification_id * required

integer

path

Id to identify the Alert Notification

Responses

Code
Description

200

Gets successfully the notification from specific watch, reading type and alert
Example
{
    "id": "2",
    "watch_reading_alert_id": "10",
    "user_name": "Sara Maria",
    "time_alert_sent": "2018-04-11T10:51:45+01:00",
    "time_answered": null,
    "status": "1"
} 

404

Notification not found from specific watch, reading type and alert
Example
{
    "message": "Alert Notification not found."
} 
post
/watches/alerts/{alert_id}/notificationsRegister a Notification resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

alert_id * required

integer

path

Id to identify the Alert

Notification Description

json

body

The new Notification
Example
{
	"user_name": "Alípio Oliveira",
	"status": "1"
} 

Responses

Code
Description

201

Registers successfully the notification from specific watch, reading type and alert
Example
{
        "id": "1",
        "watch_reading_alert_id": "4",
        "user_name": "Alípio Oliveira",
        "time_alert_sent": "2018-04-11T10:24:16+01:00",
        "time_answered": null,
        "status": "1"
} 
put
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}/notifications/{notification_id}Update a Notification resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

alert_id * required

integer

path

Id to identify the Alert

notification_id * required

integer

path

Id to identify the Alert Notification

Notification Description

json

body

The updated Notification
Example
{
	"user_name": "Alípio Olivas",
	"status": "2"
} 

Responses

Code
Description

200

Updates successfully the notification from specific watch, reading type and alert
Example
{
    "id": "1",
    "watch_reading_alert_id": "4",
    "user_name": "Alípio Olivas",
    "time_alert_sent": "2018-04-11T10:24:16+01:00",
    "time_answered": "2018-04-11T10:48:43+01:00",
    "status": "2"
} 

404

Notification not found from specific watch, reading type and alert
Example
{
    "message": "Alert Notification not found."
} 
delete
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alerts/{alert_id}/notifications/{notification_id}Deletes a Notification resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

alert_id * required

integer

path

Id to identify the Alert

notification_id * required

integer

path

Id to identify the Alert Notification

Responses

Code
Description

200

Deletes successfully the Notification
Example
{
    "message": "Deleted successfully."
} 

404

Notification not found from specific watch, reading type and alert
Example
{
    "message": "Alert Notification not found."
} 
Alert»Parameters
get
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alert_parameters/Retrieves all Alert Parameters by watch and reading type

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm94cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

Size

integer

parameters

Select the size of collection of Alert Parameters by watch and reading type.
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of Alert Parameters by watch and reading type.
Example
?offset=2 

Responses

Code
Description

200

Retrieves successfully all Alert Parameters from specific user, watch and reading type
Example
[
    {
        "id": "2",
        "virtual_watch_id": "14",
        "reading_type_id": "3",
        "name": "António Moreira",
        "min": "2",
        "max": "6",
        "urgency_type": "2"
    },
    {
        "id": "3",
        "virtual_watch_id": "14",
        "reading_type_id": "3",
        "name": "Carla Barroso",
        "min": "1",
        "max": "5",
        "urgency_type": "1"
    },
    {
        "id": "4",
        "virtual_watch_id": "14",
        "reading_type_id": "3",
        "name": "Mara Postiga",
        "min": "1",
        "max": "5",
        "urgency_type": "1"
    }
] 

200

Retrieves successfully all Alert Parameters from specific user, watch and reading type equal to Blood Pressure
Example
[
{
    "name": "High blood pressure",
    "urgency_type": "1",
    "id": "7",
    "interval_min_start": "9.5",
    "interval_min_end": "12.5",
    "interval_max_start": "14",
    "interval_max_end": "21"
},
{
    "name": "Normal blood pressure",
    "urgency_type": "1",
    "id": "8",
    "interval_min_start": "4.5",
    "interval_min_end": "10",
    "interval_max_start": "10",
    "interval_max_end": "14"
},
{
    "name": "Lows blood pressure",
    "urgency_type": "1",
    "id": "9",
    "interval_min_start": "2",
    "interval_min_end": "4.5",
    "interval_max_start": "10",
    "interval_max_end": "9"
}
] 
get
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alert_parameters/{parameter_id}Retrieves Alert Parameters from watch and reading type by id

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm95cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

parameter_id * required

integer

path

Id to identify the Alert Parameters

Responses

Code
Description

200

Retrieves successfully the Alert Parameters from specific user, watch and reading type with id
Example
{
    "id": "2",
    "virtual_watch_id": "14",
    "reading_type_id": "3",
    "name": "António Moreira",
    "min": "2",
    "max": "6",
    "urgency_type": "2"
} 

200

Retrieves successfully the Alert Parameters from specific user, watch with id and reading type equal to Blood Pressure
Example
{
    "name": "High blood pressure",
    "urgency_type": "1",
    "id": "7",
    "interval_min_start": "9.5",
    "interval_min_end": "12.5",
    "interval_max_start": "14",
    "interval_max_end": "21"
} 

404

Alert Parameters not found from specific from specific user, watch and reading type with id
Example
{
    "message": "Alert Parameter not found."
} 
post
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alert_parametersRegister Alert Parameters resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm96cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

Alert Parameters Description

json

body

The new Alert Parameters
Example
{
    "name": "Oxygen Level Low",
    "urgency_type": "1",
    "min": "30",
    "max": "50"
} 

Alert Parameters Blood Pressure

json

body

The new Alert Parameter for Blood Pressure
Example
{
	"name": "Blood Pressure Low",
	"urgency_type": "1",
	"interval_min_start": "7",
	"interval_min_end": "10",
	"interval_max_start": "10.1",
	"interval_max_end": "15"
} 

Responses

Code
Description

201

Registers successfully the Alert Parameters with specific reading type and id
Example
{
    "id": "1",
    "virtual_watch_id": "14",
    "reading_type_id": "2",
    "name": "Alípio Oliveira",
    "min": "1",
    "max": "2",
    "urgency_type": "1"
} 

201

Registers successfully the Alert Parameters for Blood Pressure
Example
{
    "name": "Blood Pressure Low",
    "urgency_type": "1",
    "interval_min_start": "7",
    "interval_min_end": "10",
    "interval_max_start": "10.1",
    "interval_max_end": "15"
} 
put
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alert_parameters/{parameter_id}Update Alert Parameters resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm97cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

parameter_id * required

integer

path

Id to identify the Alert Parameters

Alert Parameter

json

body

The updated Alert Parameters
Example
{
    "name": "Oxygen Level Low",
    "urgency_type": "1",
    "min": "30",
    "max": "50"
} 

Alert Parameters Blood Pressure

json

body

The updated Alert Parameters Blood Pressure
Example
{
	"name": "Blood Pressure Low",
	"urgency_type": "1",
	"interval_min_start": "7",
	"interval_min_end": "10",
	"interval_max_start": "10.1",
	"interval_max_end": "15"
} 

Responses

Code
Description

200

Updates successfully the Alert Parameters from specific user, watch and reading type with id
Example
{
    "id": "2",
    "virtual_watch_id": "14",
    "reading_type_id": "3",
    "name": "Manuel Moreira",
    "min": "2",
    "max": "6",
    "urgency_type": "3"
} 

404

Alert Parameters not found from specific from specific user, watch and reading type with id
Example
{
    "message": "Alert Parameter not found."
} 

200

Updates successfully the Alert Parameters Blood Pressure
Example
{
    "virtual_watch_id": "1",
    "reading_type_id": "2",
    "name": "High blood pressure",
    "urgency_type": "1",
    "id": "7",
    "interval_min_start": "9.5",
    "interval_min_end": "12.5",
    "interval_max_start": "14",
    "interval_max_end": "21"
} 
delete
/users/{user_uid}/watches/{watch_id}/readingtypes/{reading_type_id}/alert_parameters/{parameter_id}Deletes Alert Parameters resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm98cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

reading_type_id * required

integer

path

Id to identify reading type

parameter_id * required

integer

path

Id to identify the Alert Parameters

Responses

Code
Description

200

Deletes successfully the Alert Parameters from specific user, watch and reading type with id
Example
{
     "message": "Deleted successfully."
} 

404

Alert Parameters not found from specific from specific user, watch and reading type with id
Example
{
    "message": "Alert Parameter not found."
} 
GeoFecing
get
/users/{user_uid}/watches/{watch_id}/geofecing/Retrieves the collection of GeoFecing resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of Geofecing
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of Geofecing
Example
?offset=3 

Responses

Code
Description

200

Returns a GeoFecing colletion of a watch sucefull
Example
[
    {
        "id": "12",
        "name": "IDICare",
        "positions": [
            {
                "id": "4",
                "latitude": "41.5530650",
                "longitude": "-8.4257280"
            },
            {
                "id": "5",
                "latitude": "41.5531040",
                "longitude": "-8.4236200"
            },
            {
                "id": "6",
                "latitude": "41.5514340",
                "longitude": "-8.4233520"
            },
            {
                "id": "7",
                "latitude": "41.5514420",
                "longitude": "-8.4255080"
            }
        ]
    },
    {
        "id": "13",
        "name": "Casa",
        "positions": [
            {
                "id": "8",
                "latitude": "30.5530650",
                "longitude": "-8.4257280"
            },
            {
                "id": "9",
                "latitude": "30.5531040",
                "longitude": "-8.4236200"
            },
            {
                "id": "10",
                "latitude": "30.5514340",
                "longitude": "-8.4233520"
            }
        ]
    },
    {
        "id": "14",
        "name": "Largo Principal",
        "positions": [
            {
                "id": "14",
                "latitude": "20.5530650",
                "longitude": "-5.4257280"
            },
            {
                "id": "15",
                "latitude": "20.5531040",
                "longitude": "-5.4236200"
            },
            {
                "id": "16",
                "latitude": "20.5514340",
                "longitude": "-5.4233520"
            }
        ]
    }
] 
get
/users/{user_uid}/watches/{watch_id}/geofecing/{geofecing_id}Retrieves the Geofecing by Id with all Positions

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

geofecing_id * required

integer

path

Id to identify geofecing

Responses

Code
Description

200

Gets sucefully all Positions by a Geofecing identifier
Example
{
    "id": "14",
    "name": "Largo Principal",
    "positions": [
        {
            "id": "14",
            "latitude": "20.5530650",
            "longitude": "-5.4257280"
        },
        {
            "id": "15",
            "latitude": "20.5531040",
            "longitude": "-5.4236200"
        },
        {
            "id": "16",
            "latitude": "20.5514340",
            "longitude": "-5.4233520"
        }
    ]
} 
post
/users/{user_uid}/watches/{watch_id}/geofecingCreates a GeoFecing resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

GeoFecing

json

body

The new GeoFecing resource
Example
{
	"name": "IDICare",
	"positions": [
		{ 
			"latitude": "41.553065",
			"longitude": "-8.425728"
		},
		{ 
			"latitude": "41.553104",
			"longitude": "-8.423620"
		},
		{ 
			"latitude": "41.551434",
			"longitude": "-8.423352"
		},
		{ 
			"latitude": "41.551442",
			"longitude": "-8.425508"
		}
	]
} 

Responses

Code
Description

201

Create a GeoFecing resource sucefull
Example
{
    "message": "Geofencing registration successful.",
    "geofencing": {
        "id": "1",
        "name": "IDICare",
        "positions": [
            {
                "id": "1",
                "latitude": "41.5530650",
                "longitude": "-8.4257280"
            },
            {
                "id": "2",
                "latitude": "41.5531040",
                "longitude": "-8.4236200"
            },
            {
                "id": "3",
                "latitude": "41.5514340",
                "longitude": "-8.4233520"
            },
            {
                "id": "4",
                "latitude": "41.5514420",
                "longitude": "-8.4255080"
            }
        ]
    }
} 
put
/users/{user_uid}/watches/{watch_id}/geofecing/{geofecing_id}Replaces a GeoFecing resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

geofecing_id * required

integer

path

Id to identify geofecing

GeoFecing

json

body

GeoFecing Resources
Example
{
	"name": "Lar Principal",
	"positions": [
		{ 
			"latitude": "41.553065",
			"longitude": "-8.425728"
		},
		{ 
			"latitude": "41.553104",
			"longitude": "-8.423620"
		},
		{ 
			"latitude": "41.551434",
			"longitude": "-8.423352"
		},
		{ 
			"latitude": "41.551442",
			"longitude": "-8.425508"
		}
	]
} 

Responses

Code
Description

200

Updates a GeoFecing resource sucefull
Example
{
    "message": "GeoFencing update successful.",
    "geofencing": {
        "id": "12",
        "name": "Lar Principal",
        "positions": [
            {
                "id": "33",
                "latitude": "41.5530650",
                "longitude": "-8.4257280"
            },
            {
                "id": "34",
                "latitude": "41.5531040",
                "longitude": "-8.4236200"
            },
            {
                "id": "35",
                "latitude": "41.5514340",
                "longitude": "-8.4233520"
            },
            {
                "id": "36",
                "latitude": "41.5514420",
                "longitude": "-8.4255080"
            }
        ]
    }
} 
delete
/users/{user_uid}/watches/{watch_id}/geofecing/{geofecing_id}Removes a GeoFecing resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

geofecing_id * required

integer

path

Id to identify geofecing

Responses

Code
Description

200

Delete a GeoFecing resource sucefull
Example
{
    "message": "GeoFecing deletion successful"
} 
GeoFecing»Positions
get
/users/{user_uid}/watches/{watch_id}/geofecing/{geofecing_id}/positions/Retrieves the collection of Positions of a Geofecing resource

Parameters

Name
Description

Authorization * required

string

header

Token Authentication

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

geofecing_id * required

integer

path

Id to identify geofecing

Responses

Code
Description

200

Returns all Positions to a GeoFecing resource sucefull
Example
[
    {
        "id": "8",
        "latitude": "30.5530650",
        "longitude": "-8.4257280"
    },
    {
        "id": "9",
        "latitude": "30.5531040",
        "longitude": "-8.4236200"
    },
    {
        "id": "10",
        "latitude": "30.5514340",
        "longitude": "-8.4233520"
    }
] 
post
/users/{user_uid}/watches/{watch_id}/geofecing/{geofecing_id}/positionsCreates a Position resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

geofecing_id * required

integer

path

Id to identify geofecing

Position

json

body

The new position resource
Example
{
	"positions": [
	{
	"latitude": "1.0000000",
	"longitude": "1.0000000"
},
{
	"latitude": "30.9988550",
	"longitude": "-3.4256970"\n	}
	]
}  

Responses

Code
Description

201

Creates a Position to a GeoFecing resource sucefull
Example
{
    "message": "Position registration successful.",
    "positions": [
        {
            "id": "23",
            "latitude": "1.0000000",
            "longitude": "1.0000000"
        },
        {
            "id": "31",
            "latitude": "30.9988550",
            "longitude": "-3.4256970"
        }
    ]
} 
delete
/users/{user_uid}/watches/{watch_id}/geofecing/{geofecing_id}/positions/{position_id}Removes a Position resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

geofecing_id * required

integer

path

Id to identify geofecing

position_id * required

integer

path

Id to identify position

Responses

Code
Description

200

Deletes a Position to a GeoFecing resource sucefull
Example
{
    "message": "Position deletion successful"
} 
PillBoxes
get
/users/{user_uid}/watches/{watch_id}/pillboxes/Retrieves the collection of Pillboxes.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of Pillboxes
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of Pillboxes
Example
?offset=3 

Responses

Code
Description

200

Retrieves the collection of Pillboxes of a Watch successful
Example
[
    {
        "id": "5",
        "name": "Pressão Arterial",
        "date_start": "2018-01-01",
        "date_end": "2018-12-31"
    },
    {
        "id": "6",
        "name": "Diabetes",
        "date_start": "2018-02-01",
        "date_end": "2018-08-31"
    },
    {
        "id": "7",
        "name": "Gripe",
        "date_start": "2018-02-01",
        "date_end": "2018-02-21"
}
] 
get
/users/{user_uid}/watches/{watch_id}/pillboxes/between-dates/Retrieves the collection of Pillboxes between dates

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Start Date * required

string

parameters

Select the start date to create the collection of pillboxes
Example
?start=2018-02-01 

End Date * required

string

parameters

Select the end date to create the collection of pillboxes
Example
&end=2018-03-31 

Time of day

string

parameters

Select the time of day to create the collection of pillboxes
Example
?time_of_day=10 

Responses

Code
Description

200

Returns all Pillboxes between two dates sucefull
Example
{
    "start": "2018-01-01",
    "end": "2018-12-31",
    "pillboxes": [
        {
            "id": "5",
            "name": "Pressão Arterial",
            "date_start": "2018-01-01",
            "date_end": "2018-06-30",
            "pills": []
        },
        {
            "id": "6",
            "name": "Diabetes",
            "date_start": "2018-02-01",
            "date_end": "2018-08-31",
            "pills": []
        },
        {
            "id": "7",
            "name": "Gripe",
            "date_start": "2018-02-01",
            "date_end": "2018-02-21",
            "pills": [
                {
                    "id": "6",
                    "name": "AntiGripine",
                    "dose": "1",
                    "day_of_week": "127",
                    "time_of_day": "10"
                },
                {
                    "id": "7",
                    "name": "Ben-U-Ron",
                    "dose": "1",
                    "day_of_week": "127",
                    "time_of_day": "2"
                }
            ]
        }
    ]
} 

400

Time of day not valid to create de list of pillboxes
Example
{
    "message": "Time of Day not valid."
} 
get
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}Retrieves all Pills from a PillBox

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

Responses

Code
Description

200

Gets sucefully all Pills from a specific Pillbox
Example
{
    "id": "7",
    "name": "Gripe",
    "date_start": "2018-02-01",
    "date_end": "2018-02-21",
    "pills": [
        {
            "id": "6",
            "name": "AntiGripine",
            "dose": "1",
            "day_of_week": "127",
            "time_of_day": "10"
        },
        {
            "id": "7",
            "name": "Ben-U-Ron",
            "dose": "1",
            "day_of_week": "127",
            "time_of_day": "2"
        }
    ]
} 
post
/users/{user_uid}/watches/{watch_id}/pillboxesCreates a Pillbox resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Pillbox

json

body

The new pillbox resource
Example
{
	"name" : "Diabetes",
	"date_start" : "2018-02-01",
	"date_end" : "2018-08-31"
} 

Responses

Code
Description

201

PillBox registration successful
Example
{
    "id": "6",
    "name": "Diabetes",
    "date_start": "2018-02-01",
    "date_end": "2018-08-31"
} 
put
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}Replaces a Pillbox resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

PillBox

json

body

PillBox Resources
Example
{
	"name" : "Gripe",
	"date_start" : "2018-02-01",
	"date_end" : "2018-02-21"
} 

Responses

Code
Description

200

PillBox update successful
Example
{
    "id": "7",
    "name": "Gripe",
    "date_start": "2018-02-01",
    "date_end": "2018-02-21"
} 
delete
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}Removes a Pillbox resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

Responses

Code
Description

200

PillBox detetion successful
Example
{
    "message": "PillBox deletion successful"
} 
PillBoxes»Pills
get
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}/pills/Retrieves the collection of Pills by PillBox

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

Size

integer

parameters

Select the size to create the collection of Pills by pillbox
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of Pills by pillbox
Example
?offset=3 

Responses

Code
Description

200

Pills from a PillBox
Example
[
    {
        "id": "6",
        "name": "AntiGripine",
        "dose": "1",
        "day_of_week": "127",
        "time_of_day": "10"
    },
    {
        "id": "7",
        "name": "Ben-U-Ron",
        "dose": "1",
        "day_of_week": "127",
        "time_of_day": "2"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}/pills/day_of_week/Retrieves the collection of Pills by day of week

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

Day_of_Week * required

integer

parameters

Select the day of week to create the collection of pills
Example
?day_of_week=127 

Responses

Code
Description

200

Returns all Pills by Day of Week from a pillbox sucefull
Example
[
    {
        "id": "3",
        "name": "Brufen 600mg",
        "day_of_week": "127"
    },
    {
        "id": "4",
        "name": "Amoxicilina",
        "day_of_week": "127"
    }
] 

400

Day of week not valid to create de list of pills
Example
{
    "message": "Day of Week not valid."
} 

404

No pills found in that day of week
Example
{
    "message": "Pills not found in this day of week"
} 
get
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}/pills/time_of_day/Retrieves the collection of Pills by time of the day

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

Time_of_Day * required

integer

parameters

Select the time of day to create the collection of pills
Example
?time_of_day=10 

Responses

Code
Description

200

Returns all Pills by Time of Day from a pillbox sucefull
Example
[
    {
        "id": "4",
        "name": "Amoxicilina",
        "dose": "1",
        "day_of_week": "127",
        "time_of_day": "10"
    },
    {
        "id": "3",
        "name": "Brufen 600mg",
        "dose": "1",
        "day_of_week": "127",
        "time_of_day": "10"
    }
] 

400

Time of the day not valid to create a list of pills
Example
{
    "message": "Time of Day not valid."
} 

404

No pills found in that time of day
Example
{
    "message": "Pills not found in this time of day."
} 
post
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}/pillsCreates a Pill resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

Pill

json

body

The new pill resource
Example
{
	"name" : "Teste",
	"dose" : "0.5",
	"day_of_week" : "50",
	"time_of_day" : "3"
} 

Responses

Code
Description

201

Pills registration successful
Example
{
    "id": "10",
    "name": "Teste",
    "dose": "0.5",
    "day_of_week": "50",
    "time_of_day": "3"
} 
put
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}/pills/{pill_id}Replaces a Pill resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

pill_id * required

integer

path

Id to identify pill

Pill

json

body

Pills Resources
Example
{
	"name" : "Teste para delete",
	"dose" : "0.5",
	"day_of_week" : "50",
	"time_of_day" : "3"
} 

Responses

Code
Description

200

Update Pills resources from a pillbox sucefull
Example
{
    "id": "10",
    "name": "Teste para delete",
    "dose": "0.5",
    "day_of_week": "50",
    "time_of_day": "3"
} 
delete
/users/{user_uid}/watches/{watch_id}/pillboxes/{pillbox_id}/pills/{pill_id}Removes a Pill resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pillbox_id * required

integer

path

Id to identify pillbox

pill_id * required

integer

path

Id to identify pill

Responses

Code
Description

200

Delete Pills from a pillbox sucefull
Example
{
    "message": "Pill deletion successful."
} 
PillBoxes»Pills Taken
get
/users/{user_uid}/watches/{watch_id}/pillstaken/Retrieves the collection of Taken Pills.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of PillsTaken.
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of PillsTaken.
Example
?offset=3 

Responses

Code
Description

200

Retrieves the colletion of Pills Taken of a PillBox sucefull
Example
[
    {
        "id": "5",
        "date": "2018-04-06T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "6",
        "date": "2018-05-06T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "7",
        "date": "2018-06-06T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "8",
        "date": "2018-07-06T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "9",
        "date": "2018-07-26T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "10",
        "date": "2018-09-06T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "11",
        "date": "2018-10-06T23:09:00+01:00",
        "status": "3",
        "feel": "4"
    },
    {
        "id": "15",
        "date": "2018-03-28T12:15:00+01:00",
        "status": "4",
        "feel": "4"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/pillstaken/between-dates/Retrieves Pills Taken Between Dates

Parameters

Name
Description

Authorization * required

string

header

Token Authentication

user_uid * required

integer

path

Unique identifier of user

watch_id * required

integer

path

Id to identify watch

Start_date * required

string

parameters

Select the start date to create the collection of Pills Taken
Example
?start=2018-01-01 

End_date * required

string

parameters

Select the end date to create the collection of Pills Taken
Example
&end=2018-01-31 

Responses

Code
Description

200

Pills Taken between dates
Example
{
    "start": "2018-01-01",
    "end": "2018-01-31",
    "pillstaken": [
        {
            "id": "1",
            "date": "2018-01-06T23:09:00+01:00",
            "status": "3",
            "feel": "4"
        },
        {
            "id": "2",
            "date": "2018-01-16T23:09:00+01:00",
            "status": "3",
            "feel": "4"
        }
    ]
} 

404

Pills Taken not found between dates
Example
"message" => "Pills Taken not found between dates." 
post
/users/{user_uid}/watches/{watch_id}/pillstakenCreates a Taken Pill resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Taken Pill

json

body

The new taken pill resource
Example
{
	"date" :"2018-05-02T23:30:00+00:00",
	"status" : 1,
	"feel" :3
} 

Responses

Code
Description

201

Creates a Pills Taken resources sucefull
Example
{
    "id": "16",
    "date": "2018-05-02 23:30:00",
    "status": "1",
    "feel": "3"
} 
put
/users/{user_uid}/watches/{watch_id}/pillstaken/{pilltaken_id}Replaces a Taken Pill resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pilltaken_id * required

integer

path

Id to identify taken pill

Pill Taken

json

body

Pills Taken Resources
Example
{
	"date" :"2018-05-02T11:30:00+01:00",
	"status" :2,
	"feel" :3
} 

Responses

Code
Description

200

Update resources of Pills Taken from a PillBox sucefull
Example
{
    "id": "16",
    "date": "2018-05-02T11:30:00+01:00",
    "status": "1",
    "feel": "3"
} 
delete
/users/{user_uid}/watches/{watch_id}/pillstaken/{pilltaken_id}Removes a Taken Pill resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

pilltaken_id * required

integer

path

Id to identify taken pill

Responses

Code
Description

200

Deletes a Pills Taken from a PillBox sucefull
Example
{
    "message": "Pills Taken deletion successful"
} 
Calendar
get
/users/{user_uid}/watches/{watch_id}/calendar/Retrieves the collection of Calendar.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of Calendar.
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of Calendar.
Example
?offset=3 

Responses

Code
Description

200

Retrieves all Calendar Resources from a watch sucefull
Example
{
    "calendars": [
        {
            "id": "4",
            "name": "Formação",
            "description": "Formação de Lideres",
            "location": "Sala de Formação",
            "date": "2018-07-10",
            "hour": "09:00:00"
            "date_hour": "2018-03-10T15:00:00+01:00"
},
        {
            "id": "5",
            "name": "Reunião",
            "description": "Reunião Desenvolvimento",
            "location": "Sala de Reuniões",
            "date": "2018-03-10",
            "hour": "15:00:00"
        "date_hour" : "2018-03-10T15:00:00+01:00"}
]
} 
get
/users/{user_uid}/watches/{watch_id}/calendar/between-dates/Retrieves the collection of Calendar between dates.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

start_date * required

string

parameters

Select the start date to create the collection of calendars
Example
?start=2018-01-01 

end_date * required

string

parameters

Select the end date to create the collection of calendars
Example
&end=2018-12-31 

Responses

Code
Description

200

Retrieves all Calendar Resources between dates succefull
Example
[
    {
        "id": "4",
        "name": "Formação",
        "description": "Formação de Lideres",
        "location": "Sala de Formação",
        "date": "2018-07-10",
        "hour": "09:00:00"
    },
    {
        "id": "5",
        "name": "Reunião",
        "description": "Reunião Desenvolvimento",
        "location": "Sala de Reuniões",
        "date": "2018-03-10",
        "hour": "15:00:00"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/calendar/upcoming/Retrieves the collection of Calendar after date.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

start_date * required

string

parameters

Select the start date to get the collection of appoiments
Example
?start=2018-01-01 

Responses

Code
Description

200

Retrieves all Calendar Resources between dates sucefull
Example
[{"id":"4","name":"Formação","description":"Formação de Lideres","location":"Sala de Formação","date":"2018-07-10","hour":"09:00:00"},{"id":"5","name":"Reunião","description":"Reunião Desenvolvimento","location":"Sala de Reuniões","date":"2018-03-10","hour":"15:00:00"}] 
get
/users/{user_uid}/watches/{watch_id}/calendar/{calendar_id}Retrieves a Calendar.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

calendar_id * required

integer

path

Id to identify calendar

Responses

Code
Description

200

Retrieves a Calendar resource
Example
{
    "id": "2",
    "name": "Reunião",
    "description": "Reunião Desenvolvimento",
    "location": "Sala de Reuniões",
    "date": "2018-03-10",
    "hour": "15:00:00",
    "date_hour": "2018-03-10T15:00:00+01:00"
} 
post
/users/{user_uid}/watches/{watch_id}/calendarCreates a Calendar resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Calendar

json

body

The new calendar resource
Example
{
	"name"        : "Reunião",
	"description" : "Reunião Desenvolvimento",
	"location"    : "Sala de Reuniões",
	"date"        : "",
	"hour"        : "",
	"date_hour"        : "2018-03-10T15:00:00+01:00"
} 

Responses

Code
Description

201

Create a Calendar Resource sucefull
Example
{
    "id": "5",
    "name": "Reunião",
    "description": "Reunião Desenvolvimento",
    "location": "Sala de Reuniões",
    "date": "2018-03-10",
    "hour": "15:00:00"
} 
put
/users/{user_uid}/watches/{watch_id}/calendar/{calendar_id}Replaces a Calendar resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

calendar_id * required

integer

path

Id to identify calendar

Calendar

json

body

Calendar Resources
Example
{
    "name": "Formação",
    "description": "Formação de Lideres",
    "location": "Sala de Formação",
    "date": "2018-07-10",
    "hour": "09:00:00",
	"date_hour"        : "2018-03-10T15:00:00+01:00"
} 

Responses

Code
Description

200

Updates a Calendar Resource from a watch sucefull
Example
{
    "id": "4",
    "name": "Formação",
    "description": "Formação de Lideres",
    "location": "Sala de Formação",
    "date": "2018-07-10",
    "hour": "09:00:00"
} 
delete
/users/{user_uid}/watches/{watch_id}/calendar/{calendar_id}Removes a Calendar resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

calendar_id * required

integer

path

Id to identify calendar

Responses

Code
Description

200

Deletes a Calendar Resources sucefull
Example
{
    "message": "Calendar deletion successful"
} 
Health Report
get
/users/{user_uid}/watches/{watch_id}/healthreports/Returns all Health Reports associated with a watch and its attachments.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of Health Reports and attachments.
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of Health Reports and attachments.
Example
?offset=3 

Responses

Code
Description

200

Returns all Health Reports associated with a watch and its attachments
Example
{"healthReports":[{"id":"13","name":"Teste","report":"Raio-X","responsible":"Carlos","date":"2018-01-09","hour":"17:30:00","attachments":[]},{"id":"14","name":"Teste","report":"Raio-X","responsible":"Carlos","date":"2018-01-09","hour":"17:30:00","date_hour":"2018-01-09T17:30:00+01:00","attachments":[{"id":"14","name":"Electro","file":"Electrocardiograma.pdf"},{"id":"15","name":"Raio-X","file":"Electrocardiograma.pdf"}]},{"id":"15","name":"Teste","report":"Raio-X","responsible":"Carlos","date":"2018-01-09","hour":"17:30:00","date_hour":"2018-01-09T17:30:00+01:00","attachments":[{"id":"16","name":"Electro","file":"Electrocardiograma.pdf"},{"id":"17","name":"Raio-X","file":"Electrocardiograma.pdf"}]},{"id":"17","name":"Santos","report":"Análises","responsible":"Carlos Semedo","date":"2018-01-09","hour":"17:30:00","date_hour":"2018-01-09T17:30:00+01:00","attachments":[{"id":"20","name":"ElectroCardiograma","file":"Electrocardiograma.pdf"},{"id":"21","name":"Raio-X","file":"RaioX.pdf"}]},{"id":"11","name":"TAC - Cabeça","report":"tac_anual","responsible":"Paulo Pedro","date":"2018-01-10","hour":"10:45:00","date_hour":"2018-01-10T10:45:00+01:00","attachments":[{"id":"9","name":"Anexo","file":"Anexo.jpg"},{"id":"10","name":"Teste","file":"teste.jpg"},{"id":"12","name":"TAC","file":"TAC.jpg"}]},{"id":"10","name":"Análises Anuais","report":"Anual-III","responsible":"Manuel","date":"2018-03-25","hour":"16:45:00","date_hour":"2018-03-25T16:45:00+01:00","attachments":[{"id":"11","name":"TAC","file":"TAC.jpg"}]}]} 
post
/users/{user_uid}/watches/{watch_id}/healthreportsCreates a Health Report resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Health Report

json

body

The new health report resource
Example
{
    "name": "Santos",
    "report": "Análises",
    "responsible": "Carlos Semedo",
    "date": "",
    "hour": "",
    "date_hour": "2018-05-09T10:00:00+01:00",
    "attachments":[
		{
            "name": "ElectroCardiograma",
            "file": "Electrocardiograma.pdf"
        },
        {
            "name": "Raio-X",
            "file": "RaioX.pdf"
        }
	]
} 

Responses

Code
Description

201

Creates a Healh Report sucefull
Example
{
    "message": "Health Report registration successful.",
    "healthReport": {
        "id": "18",
        "name": "Santos",
        "report": "Análises",
        "responsible": "Carlos Semedo",
        "date": "2018-01-09",
        "hour": "17:30:00",
        "attachments": [
            {
                "id": "26",
                "name": "ElectroCardiograma",
                "file": "Electrocardiograma.pdf"
            },
            {
                "id": "27",
                "name": "Raio-X",
                "file": "RaioX.pdf"
            }
        ]
    }
} 
put
/users/{user_uid}/watches/{watch_id}/healthreports/{healthreport_id}Replaces a Health Report resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

healthreport_id * required

integer

path

Id to identify heath report

Health Report

json

body

Health Report Resources
Example
{
    "name": "Carlos Santos",
    "report": "Análises Gerais",
    "responsible": "Carlos Semedo",
    "date": "",
    "hour": "",
    "date_hour": "2018-06-10T08:30:00+01:00",
    "attachments":[
		{
            "name": "Hemoglobina",
            "file": "Hemograma.pdf"
        },
        {
            "name": "Urina",
            "file": "Urina.pdf"
        }
	]
} 

Responses

Code
Description

200

Updates sucefully a Healh Report associated a one watch
Example
{
    "message": "Health Report update successful.",
    "healthreport": {
        "id": "18",
        "name": "Carlos Santos",
        "report": "Análises Gerais",
        "responsible": "Carlos Semedo",
        "date": "2018-01-21",
        "hour": "08:30:00",
        "date_hour": "2018-01-21T08:30:00",
        "attachments": [
            {
                "id": "28",
                "name": "Hemoglobina",
                "file": "Hemograma.pdf"
            },
            {
                "id": "29",
                "name": "Urina",
                "file": "Urina.pdf"
            }
        ]
    }
} 
delete
/users/{user_uid}/watches/{watch_id}/healthreports/{healthreport_id}Removes a Health Report resource and all its attachments.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

healthreport_id * required

integer

path

Id to identify heath report

Responses

Code
Description

200

Deletes sucefully a Healh Report associated a one watch
Example
{
    "message": "Health Report deletion successful"
} 
Health Report»Attachment
get
/users/{user_uid}/watches/{watch_id}/healthreports/{healthreport_id}/attachments/Retrieves the collection of Attachments by a Health Reports

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

healthreport_id * required

integer

path

Id to identify the health report

Responses

Code
Description

200

Retrieves sucefully all Attachments associated to a Health Report
Example
[
    {
        "id": "9",
        "name": "Anexo",
        "file": "Anexo.jpg"
    },
    {
        "id": "10",
        "name": "Teste",
        "file": "teste.jpg"
    }
] 
post
/users/{user_uid}/watches/{watch_id}/healthreports/{healthreport_id}/attachmentsCreates a Attachement resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

healthreport_id * required

integer

path

Id to identify health report

Attachment

json

body

The new attachment of health report resource
Example
{
    "name": "TAC",
    "file": "TAC.jpg"
} 

Responses

Code
Description

201

Creates sucefully a Attachment associated to a Healh Report
Example
{
    "id": "11",
    "name": "TAC",
    "file": "TAC.jpg"
} 
delete
/users/{user_uid}/watches/{watch_id}/healthreports/{healthreport_id}/attachments/{attachment_id}Removes a Attachement resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

healthreport_id * required

integer

path

Id to identify health report

attachment_id * required

integer

path

Id to identify attachment of the health report

Responses

Code
Description

200

Deletes sucefully a Attachments of a Healh Report
Example
{
    "message": "Health Report Attachment deletion successful"
} 
Medical Documents
get
/users/{user_uid}/watches/{watch_id}/medicaldocuments/Retrieves the collection of Medical Documents by Watch or retrieves the collection of medical documents by watch and by category.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Category

string

parameters

Select all Medical Documents in the category
Example
?category=10 

Size

integer

parameters

Select the size to create the collection of Medical Documents.
Example
?size=2 

Offset

integer

parameters

Select the offset to create the collection of Medical Documents.
Example
?offset=3 

Responses

Code
Description

200

Retrieves sucefully a colletion of Medical Documents by watch
Example
[
    {
        "id": "1",
        "name": "Raio X - Braço Esquerdo",
        "file": "",
        "responsible": "Maria Carla",
        "description": "Raio X sem alterações ",
        "categories_id": "10",
        "category_name": "Raio - X"
    },
    {
        "id": "3",
        "name": "Raio X - Braço Esquerdo",
        "file": "ksadjask",
        "responsible": "Maria Carla",
        "description": "Raio X sem alterações ",
        "categories_id": "10",
        "category_name": "Raio - X"
    },
    {
        "id": "4",
        "name": "INR - Controlo",
        "file": "INR-Março",
        "responsible": "Sara",
        "description": "Valor dentro dos padrões - 2,23 ",
        "categories_id": "8",
        "category_name": "Análises - INR"
    }
] 

200

Medical Documents by watch and category
Example
[
    {
        "id": "1",
        "name": "Raio X - Braço Esquerdo",
        "file": "",
        "responsible": "Maria Carla",
        "description": "Raio X sem alterações ",
        "categories_id": "10",
        "category_name": "Raio - X"
    },
    {
        "id": "3",
        "name": "Raio X - Braço Esquerdo",
        "file": "ksadjask",
        "responsible": "Maria Carla",
        "description": "Raio X sem alterações ",
        "categories_id": "10",
        "category_name": "Raio - X"
    }
] 
get
/users/{user_uid}/watches/{watch_id}/medicaldocuments/categoriesRetrieves the collection of Categories with Medical Documents

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user.

watch_id * required

integer

path

Id to identify watch.

Responses

Code
Description

200

Retrives all categories with medical documents to a specific watch
Example
[
{
    "id": "35",
    "name": "Medical laboratory"
},
{
    "id": "8",
    "name": "Antibody barcoding"
}
] 
get
/users/{user_uid}/watches/{watch_id}/medicaldocuments/{medicaldocument_id}Retrieves a Medical Documents by id.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user.

watch_id * required

integer

path

Id to identify watch.

medicaldocument_id * required

integer

path

Id to identify medical document.

Responses

Code
Description

200

Retrives a specific medical document
Example
{
    "id": "2",
    "name": "Análises Urina",
    "file": "Análise-Jan",
    "responsible": "Carla",
    "description": "Testes",
    "categories_id": "35",
    "category_name": "Medical laboratory"
} 
post
/users/{user_uid}/watches/{watch_id}/medicaldocumentsCreates a Medical Document resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

Medical Document

json

body

The new medical document resource
Example
{
	"name" :"INR - Controlo",
	"file" : "INR-Jan",
	"responsible" : "Mara",
	"description" : "Valor dentro dos padrões - 2,3 ",
	"categories_id": 8
} 

Responses

Code
Description

201

Creates sucefully a Medical Document
Example
{
    "id": "4",
    "name": "INR - Controlo",
    "file": "INR-Jan",
    "responsible": "Mara",
    "description": "Valor dentro dos padrões - 2,3 ",
    "categories_id": "8",
    "category_name": "Análises - INR"
} 
put
/users/{user_uid}/watches/{watch_id}/medicaldocuments/{medicaldocument_id}Replaces a Medical Document resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

medicaldocument_id * required

integer

path

Id to identify medical document

Medical Document

json

body

The updated profile resource
Example
{
	"name" :"INR - Controlo",
	"file" : "INR-Março",
	"responsible" : "Sara",
	"description" : "Valor dentro dos padrões - 2,23 ",
	"categories_id": 8
} 

Responses

Code
Description

200

Updates sucefully a Medical Documents
Example
{
    "id": "4",
    "name": "INR - Controlo",
    "file": "INR-Março",
    "responsible": "Sara",
    "description": "Valor dentro dos padrões - 2,23 ",
    "categories_id": "8",
    "category_name": "Análises - INR"
} 
delete
/users/{user_uid}/watches/{watch_id}/medicaldocuments/{medicaldocument_id}Removes a Medical Document resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

watch_id * required

integer

path

Id to identify watch

medicaldocument_id * required

integer

path

Id to identify medical document

Responses

Code
Description

200

Deletes sucefully a Medical Documents
Example
{
    "message": "Medical Document deletion successful"
} 
Chat
get
/users/{user_uid}/watches/{watch_id}/chat/watchRetrieves all messages of a watch.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of Medical Documents.
Example
?size=2 

Offset

string

parameters

Select the offset to create collection of readings
Example
?size=4 

Responses

Code
Description

200

Retrieves all messages from a watch
Example
"[
    {
    "id": "1",
    "message": "teste ao chat ",
    "attachment": "",
    "reading_time": "2018-04-30T08:00:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "1"
    },
    {
    "id": "3",
    "message": "teste ao chat  2",
    "attachment": "",
    "reading_time": null,
    "user_id": "2",
    "virtual_watches_id": "1"
    },
    {
    "id": "5",
    "message": "Mensagem enviada com urgência",
    "attachment": "",
    "reading_time": null,
    "user_id": "1",
    "virtual_watches_id": "1"
    },
    {
    "id": "6",
    "message": "Teste ao model",
    "attachment": "",
    "reading_time": null,
    "user_id": "1",
    "virtual_watches_id": "1"
    },
    {
    "id": "7",
    "message": "Heart Rate High",
    "attachment": "",
    "reading_time": "2018-05-07T15:50:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "1"
    }
]" 
get
/users/{user_uid}/watches/{watch_id}/chat/userRetrieves all messages of a user.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Size

integer

parameters

Select the size to create the collection of Medical Documents.
Example
?size=2 

Offset

string

parameters

Select the offset to create collection of readings
Example
?size=4 

Responses

Code
Description

200

Retrieves all messages from a user
Example
"[
    {
    "id": "1",
    "message": "teste ao chat ",
    "attachment": "",
    "reading_time": "2018-04-30T08:00:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "1"
    },
{
    "id": "2",
    "message": "teste ao chat 1",
    "attachment": "",
    "reading_time": "2018-03-30T21:30:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "2"
    },
{
    "id": "5",
    "message": "Mensagem enviada com urgência",
    "attachment": "",
    "reading_time": null,
    "user_id": "1",
    "virtual_watches_id": "1"
    },
{
    "id": "6",
    "message": "Teste ao model",
    "attachment": "",
    "reading_time": null,
    "user_id": "1",
    "virtual_watches_id": "1"
    },
{
    "id": "7",
    "message": "Heart Rate High",
    "attachment": "",
    "reading_time": "2018-05-07T15:50:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "1"
}
]" 
get
/users/{user_uid}/watches/{watch_id}/chat/{chat_id}Retrieves a message.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

chat_id * required

integer

path

Id to identify message

Responses

Code
Description

200

Retrieves a messages
Example
"{
    "id": "7",
    "message": "Heart Rate High",
    "attachment": "",
    "reading_time": "2018-05-07T15:50:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "1"
}" 
post
/users/{user_uid}/watches/{watch_id}/chatInserts a message.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

Chat * required

json

body

Creates a message
Example
{
	"message": "Heart Rate High",
	"attachment": "",
	"reading_time": ""
} 

Responses

Code
Description

201

Message Create with success
Example
"{
    "id": null,
    "message": "Heart Rate High",
    "attachment": "",
    "reading_time": null,
    "user_id": "1",
    "virtual_watches_id": "1"
}" 
put
/users/{user_uid}/watches/{watch_id}/chat/{chat_id}Updates the reading time of a message.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier to identify user

watch_id * required

integer

path

Id to identify watch

chat_id * required

integer

path

Id to identify message

reading_time * required

json

body

Updates the reading time of a message
Example
{
	"reading_time": "2018-05-07T15:50:00+01:00"
	} 

Responses

Code
Description

200

Message Update with success
Example
"{
    "id": "7",
    "message": "Heart Rate High",
    "attachment": "",
    "reading_time": "2018-05-07T15:50:00+01:00",
    "user_id": "1",
    "virtual_watches_id": "1"
}" 
Administration Users
get
/users/Retrieves the collection of Users resources.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Size

integer

parameters

Select the size of collection of users
Example
?size=10 

Offset

integer

parameters

Select the offset of collection of users
Example
?offset=5 

Responses

Code
Description

200

Retrieves all users
Example
[
    {
        "id": "1",
        "uid": "5ab8cafbb3adb",
        "fullname": "Sílvia Abreu",
        "email": "silvia.abreu@sketchpixel.com",
        "password_hash": "$2y$10$yCbSeDYrkLgUXsz5R84PgOlTxt1EAh9rwoG0VEUDzBMNk514kJjDi",
        "activation_hash": "34303fce07c4eb6d9435795db69e3e5c31320966",
        "recover_hash": null,
        "activation_time": "2018-03-26T11:43:22+01:00"
    },
    {
        "id": "3",
        "uid": "5ac7346160468",
        "fullname": "Sílvia Abreu",
        "email": "silvia.abreu@teste.com",
        "password_hash": "$2y$10$gfMOQThMWcCu.XoOPj1lu.A4QPgmxZbCEpBOK1jw9R6hpm2yNMr9m",
        "activation_hash": "7b6782244e800bb3c6d527046ea904c9a7101f4f",
        "recover_hash": null,
        "activation_time": "2018-04-06T09:49:30+01:00"
    }
] 
delete
/users/{user_id}/Removes a User resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

user_uid * required

integer

path

Unique identifier of a user

Responses

Code
Description

200

Deletes a user
Example
{"message":"User delete successful"} 
Administration Watches
get
/watches/Retrieves all watches.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Size

integer

parameters

Select the size of collection of watches
Example
?size=10 

Offset

integer

parameters

Select the offset of collection of watches
Example
?offset=5 

Responses

Code
Description

200

Retrieve Watches sucefull
Example
[
    {
        "id": "1",
        "uid": "5ab8cafbb3adb"
    },
    {
        "id": "5",
        "uid": "IMEI"
    },
    {
        "id": "4",
        "uid": "Testes Imei"
    },
    {
        "id": "3",
        "uid": "tt37snm,n934"
}
] 
get
/watches/{watch_id}Retrieves a watch.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

watch_id * required

integer

path

Id to identify watch

Responses

Code
Description

200

Retrieves select Watch
Example
{
    "id": "5",
    "uid": "IMEI"
} 

404

Watch not found
Example
{
    "message": "Watch not found"
} 
post
/watchesRegister of a watch.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

uid

json

body

Unique identifier to a watch
Example
{
	"uid": "5ab8cafbb3adb"
} 

Responses

Code
Description

201

Watch created sucefull
Example
{
    "id": "6",
    "uid": "5ac7346160468"
} 
put
/watches/{watch_id}Replaces a watch resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

watch_id * required

integer

path

Id to identify watch

Watch

json

body

Updates data from a watch
Example
{
	"uid": "5ac7346160469"
} 

Responses

Code
Description

200

Watch updated
Example
{
    "id": "6",
    "uid": "5ac7346160469"
} 
delete
/watches/{watch_id}Deletes a watch resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

watch_id * required

integer

path

Id to identify watch

Responses

Code
Description

200

Watch deleted sucefull
Example
{"message":"Watch deleted"} 
Administration Reading Types
get
/readingtypes/Retrieves all Reading Type

Parameters

Name
Description

Size

integer

parameters

Select the size of collection of reading types
Example
?size=10 

Offset

integer

parameters

Select the offset of collection of reading types
Example
?offset=5 

Responses

Code
Description

200

Retrieves all Reading types sucessufly
Example
[
    {
        "id": "1",
        "type": "Batimento Cardíaco"
    },
    {
        "id": "2",
        "type": "Pressão Arterial"
    },
    {
        "id": "3",
        "type": "Temperatura Corporal"
    }
] 
get
/readingtypes/{readingtype_id}Retrieves a Reading Type

Parameters

Name
Description

readingtype_id * required

integer

path

Unique identifier of the reading type

Responses

Code
Description

200

Retrieves a Reading type sucessufly
Example
{
    "id": "2",
    "type": "Pressão Arterial"
} 
post
/readingtypesCreates a Reading Type

Parameters

Name
Description

readingtype

json

body

Creates a reading type
Example
{
	"type": "Temperatura"
} 

Responses

Code
Description

201

Reading type create sucessufly
Example
{
    "id": "3",
    "type": "Temperatura"
} 
put
/readingtypes/{readingtype_id}Updates a Reading Type

Parameters

Name
Description

readingtype_id * required

integer

path

Unique identifier of the reading type

readingtype

json

body

Updates a reading type
Example
{
	"type": "Temperatura Corporal"
} 

Responses

Code
Description

200

Updates a Reading type sucessufly
Example
{
    "id": "3",
    "type": "Temperatura Corporal"
} 
delete
/readingtypes/{readingtype_id}Deletes a Reading Type

Parameters

Name
Description

readingtype_id * required

integer

path

Unique identifier of the reading type

Responses

Code
Description

200

Deletes a Reading type sucessufly
Example
{
    "message": "Reading Type deleted"
} 
Administration Reading Types»Alert»Parameters References
get
/readingtypes/{reading_type_id}/alert_parameters_references/Retrieves all Alert Parameters References by Reading Type

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

reading_type_id * required

integer

path

Id to identify reading type

Size

integer

parameters

Select the size of collection of alert parameters
Example
?size=3 

Offset

integer

parameters

Select the offset of collection of alert parameters
Example
?offset=2 

Responses

Code
Description

200

Gets successfully all Alert Parameters Reference from specific reading type
Example
[
    {
        "id": "1",
        "name": "Jovem",
        "min": "60",
        "max": "90",
        "urgency_type": "1",
        "interval_age_start": "18",
        "interval_age_end": "30"
    },
    {
        "id": "5",
        "name": "Jovem",
        "min": "8",
        "max": "12",
        "urgency_type": "3",
        "interval_age_start": "20",
        "interval_age_end": "30"
    },
    {
        "id": "7",
        "name": "Jovem",
        "min": "8",
        "max": "12",
        "urgency_type": "3",
        "interval_age_start": "20",
        "interval_age_end": "30"
    }
] 

200

Gets successfully all Alert Parameters Reference from reading type equal to Blood Pressure
Example
[
{
    "name": "Blood Pressure Normal",
    "urgency_type": "2",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "id": "5",
    "interval_min_start": "7",
    "interval_min_end": "11",
    "interval_max_start": "11.1",
    "interval_max_end": "16"
},
{
    "name": "Blood Pressure High",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "id": "6",
    "interval_min_start": "9",
    "interval_min_end": "12",
    "interval_max_start": "14",
    "interval_max_end": "21"
},
{
    "name": "Blood Pressure Low",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "id": "7",
    "interval_min_start": "4",
    "interval_min_end": "7",
    "interval_max_start": "8",
    "interval_max_end": "10"
}
] 
get
/readingtypes/{reading_type_id}/alert_parameters_references/{parameter_reference_id}Retrieves an Alert Parameters Reference by Reading Type

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

reading_type_id * required

integer

path

Id to identify reading type

parameter_reference_id * required

integer

path

Id to identify the Alert Parameters Reference

Responses

Code
Description

200

Gets successfully the Alert Parameters Reference from specific reading type and id
Example
{
    "name": "Heart Rate High",
    "urgency_type": "100",
    "interval_age_start": "110",
    "interval_age_end": "1",
    "id": "1",
    "min": "40",
    "max": "80"
} 

200

Gets successfully the Alert Parameters Reference of Blood Pressure
Example
{
    "name": "Blood Pressure Low",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "id": "7",
    "interval_min_start": "4",
    "interval_min_end": "7",
    "interval_max_start": "8",
    "interval_max_end": "10"
} 

404

Alert Parameters Reference not found from specific reading type
Example
{
    "message": "Alert Parameter Reference not found."
} 
post
/readingtypes/{reading_type_id}/alert_parameters_referencesRegister an Alert Parameters Reference resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

reading_type_id * required

integer

path

Id to identify reading type

Alert Parameter Reference

body

json

The new Alert Parameters Reference
Example
{
    "name": "Oxygen Level Normal",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "min": "0",
    "max": "100"
} 

Alert Parameter Reference Blood Pressure

body

json

The new Alert Parameters Reference for Blood Pressure
Example
{
	"name": "Blood Pressure Normal",
	"urgency_type": "2",
	"interval_age_start": "25",
	"interval_age_end": "45",
	"interval_min_start": "7",
	"interval_min_end": "11",
	"interval_max_start": "11.1",
	"interval_max_end": "16"
} 

Responses

Code
Description

201

Registers successfully the Alert Parameters Reference with specific reading type and id
Example
{
    "id": "10",
    "name": "Temperatura",
    "min": "36",
    "max": "37",
    "urgency_type": "1",
    "interval_age_start": "15",
    "interval_age_end": "40"
} 

201

Registers successfully the Alert Parameters Reference for Blood Pressure
Example
{
    "reading_type_id": "2",
    "name": "Blood Pressure Normal",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "id": "10",
    "interval_min_start": "7",
    "interval_min_end": "11",
    "interval_max_start": "11.1",
    "interval_max_end": "16"
} 
put
/readingtypes/{reading_type_id}/alert_parameters_references/{parameter_reference_id}Update an Alert Parameters Reference resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm92cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

reading_type_id * required

integer

path

Id to identify reading type

parameter_reference_id * required

integer

path

Id to identify the Alert Parameters Reference

Alert Parameter Reference

body

json

Update Alert Parameters Reference
Example
{
    "name": "Oxygen Level Normal",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "min": "0",
    "max": "100"
} 

Alert Parameter Reference Blood Pressure

body

json

Update Alert Parameters Reference for Blood Pressure
Example
{
	"name": "Blood Pressure Normal",
	"urgency_type": "2",
	"interval_age_start": "25",
	"interval_age_end": "45",
	"interval_min_start": "7",
	"interval_min_end": "11",    
	"interval_max_start": "11.1",
	"interval_max_end": "16"
} 

Responses

Code
Description

200

Updates successfully the Alert Parameters Reference from specific reading type and id
Example
{
    "id": "11",
    "name": "Referência 1",
    "min": "1",
    "max": "2",
    "urgency_type": "2",
    "interval_age_start": "1",
    "interval_age_end": "2"
} 

404

Alert Parameters Reference not found from specific reading type and id
Example
{
    "message": "Resource not found."
} 

200

Updates successfully the Alert Parameters Reference of Blood Pressure
Example
{
    "reading_type_id": "2",
    "name": "Blood Pressure High",
    "urgency_type": "1",
    "interval_age_start": "25",
    "interval_age_end": "45",
    "id": "10",
    "interval_min_start": "9",
    "interval_min_end": "13",
    "interval_max_start": "13",
    "interval_max_end": "16"
} 
delete
/readingtypes/{reading_type_id}/alert_parameters_references/{parameter_reference_id}Deletes an Alert Parameters Reference resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm93cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

reading_type_id * required

integer

path

Id to identify reading type

parameter_reference_id * required

integer

path

Id to identify the Alert Parameters Reference

Responses

Code
Description

200

Deletes successfully the Alert Parameters Reference
Example
{
    "message": "Deleted successfully."
} 

404

Alert Parameters Reference not found from specific reading type
Example
{
    "message": "Resource not found."
} 
Administration Categories
get
/medicaldocuments/categories/Retrieves all categories

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Size

integer

parameters

Select the size of collection of categories
Example
?size=10 

Offset

integer

parameters

Select the offset of collection of categories
Example
?offset=5 

Responses

Code
Description

200

Retrives sucefully all Category
Example
[
    {
        "id": "8",
        "name": "Análises - INR"
    },
    {
        "id": "9",
        "name": "Análises - Urina"
    },
    {
        "id": "11",
        "name": "Electrocardiograma"
    },
    {
        "id": "10",
        "name": "Raio - X"
    },
    {
        "id": "12",
        "name": "TAC"
    }
] 
post
/medicaldocuments/categoriesRegister of a category.

Parameters

Name
Description

Authorization * required

string

header

Basic Authentication
Example
Basic base64(email:password)
Basic c2lsdmlhLmFicmV1QHNrZXRjaHBpeGVsLmNvbTpwYXNzd29yZA 

Category

json

body

Category
Example
{
	"name" :"Ecografia"
} 

Responses

Code
Description

201

Creates sucefully a Category
Example
{
    "id": "16",
    "name": "Ecografia"
} 
put
/medicaldocuments/categories/{id}Update a category.

Parameters

Name
Description

Authorization * required

string

header

Basic Authentication
Example
Basic base64(email:password)
Basic c2lsdmlhLmFicmV1QHNrZXRjaHBpeGVsLmNvbTpwYXNzd29yZA 

category_id * required

integer

path

Id to identify category

Category

json

body

Category
Example
{
    "name": "Ecografia - Gravidez"
} 

Responses

Code
Description

200

Updates sucefully a Category
Example
{
    "id": "14",
    "name": "Ecografia - Gravidez"
} 
delete
/medicaldocuments/categories/{id}Deletes a category resource.

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

category_id * required

integer

path

Id to identify category

Responses

Code
Description

200

Deletes sucefully a Category
Example
{
    "message": "Category deletion successful"
} 
Administration Diseases Names
get
/diseases/Retrieves all diseases names

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Size

integer

parameters

Select the size of collection of diseases
Example
?size=10 

Offset

integer

parameters

Select the offset of collection of diseases
Example
?offset=5 

Responses

Code
Description

200

Retrieves all diseases names
Example
[
    {
        "id": "3",
        "name": "Alzheimer"
    },
    {
        "id": "5",
        "name": "Doença Crohn"
    },
    {
        "id": "7",
        "name": "Gripe"
    },
    {
        "id": "6",
        "name": "Reumatismo"
    }
] 
get
/diseases/{disease_id}Retrieves a disease name

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

disease_id * required

integer

path

Id to identify a disease

Responses

Code
Description

200

Retrieves a diseases names
Example
{
    "id": "7",
    "name": "Gripe"
} 
post
/diseasesCreates a disease names

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Disease

json

body

Disease name
Example
{
	"name": "Arritmia Cardíaca"
} 

Responses

Code
Description

201

Creates successfully a disease name
Example
{
    "id": "9",
    "name": "Arritmia Cardíaca"
} 

500

Duplicate entry
Example
{
    "message": "Duplicate entry",
    "details": "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry Gripe for key name_UNIQUE"
} 
put
/diseases/{disease_id}Updates a disease name

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

disease_id * required

integer

path

Id to identify a disease

Disease

json

body

Disease name
Example
{
	"name": "Arritmia"
} 

Responses

Code
Description

200

Updates data successfully from a disease name
Example
{
    "id": "9",
    "name": "Arritmia"
} 
delete
/diseases/{disease_id}Deletes a disease name

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

disease_id * required

integer

path

Id to identify a disease

Responses

Code
Description

200

Deletes successfully a disease name
Example
{
    "message": "Disease deleted"
} 
Administration Social Security Number Types
get
/ssnumbers/Retrieves all Social Security Number Types

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Size

integer

parameters

Select the size of collection of Social Security Number Types
Example
?size=10 

Offset

integer

parameters

Select the offset of collection of Social Security Number Types
Example
?offset=5 

Responses

Code
Description

200

Retrieves all types of Social Security Number
Example
[
    {
        "id": "1",
        "type": "ADSE"
    },
    {
        "id": "5",
        "type": "Medicare"
    },
    {
        "id": "3",
        "type": "PSP"
    },
    {
        "id": "2",
        "type": "SAMS"
    },
    {
        "id": "9",
        "type": "Unicare"
    }
] 
get
/ssnumbers/{type_id}Retrieves a Social Security Number Type

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

type_id * required

integer

path

Id to identify type of SSNumber

Responses

Code
Description

200

Retrieves a types of Social Security Number
Example
{
    "id": "9",
    "type": "Unicare"
} 
post
/ssnumbersCreates a Social Security Number Type

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

Type

json

body

Type of Social Security Number
Example
{
	"type": "Unicare"
} 

Responses

Code
Description

201

Creates a type of Social Security Number
Example
{
    "id": "9",
    "type": "Unicare"
} 

500

Try to create a Duplicate entry of a type of Social Security Number
Example
{
    "message": "Duplicate entry",
    "details": "SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry Unicare for key type_UNIQUE"
} 
put
/ssnumbers/{type_id}Updates data from a Social Security Number Types

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

type_id * required

integer

path

Id to identify type of SSNumber

Type

json

body

Type of Social Security Number
Example
{
	"type": "Givecare"
} 

Responses

Code
Description

200

Updates data from a type of Social Security Number
Example
{
    "id": "9",
    "type": "Givecare"
} 
delete
/ssnumbers/{type_id}Deletes a Social Security Number Types

Parameters

Name
Description

Authorization * required

string

header

Token Authentication
Example
Bearer <token>
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI1YWI4Y2FmYmIzYWRiIiwicm9sZXMiOlsiYWRtaW4iLCJ3YXRjaCJdLCJncm91cHMiOlsiZ3JvdXBBIl19.gDMKbDsoirVyaJfQgsKcd2ZB_Zf1w1eHpNacoSDyPW4 

type_id * required

integer

path

Id to identify type of SSNumber

Responses

Code
Description

200

Deletes a type of Social Security Number
Example
{
    "message": "Type deleted"
}