API Workflows - Health123/wiki GitHub Wiki
Configure biometric types
Configure templates for systolic/diastolic signal types.
Create signal types to represent the two expected data values. This is only done once per data type, and subsequent recorded values will reference the existing types.
POST /signals/types/create
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"signal_types": [
{
"name": "Systolic",
"description": "The maximum arterial pressure during contraction of the left ventricle of the heart",
"unit": "mm Hg"
"value_type": "integer",
"nullable": false,
"sources": [
"member",
"coach",
"device"
],
"disposition_set": [
{
"name": "Healthy"
"score": 100
"min_value": 0
"max_value": 120
},
{
"name": "Prehypertension"
"score": 50
"min_value": 121
"max_value": 139
},
{
"name": "Stage 1 Hypertension"
"score": 20
"min_value": 140
"max_value": 159
},
{
"name": "Stage 2 Hypertension"
"score": 0
"min_value": 160
"max_value": 300
}
]
},
{
"name": "Diastolic",
"description": "The pressure in the arteries when the heart rests between beats",
"unit": "mm Hg"
"value_type": "integer",
"nullable": false,
"sources": [
"member",
"coach",
"device"
],
"disposition_set": [
{
"name": "Healthy"
"score": 100
"min_value": 0
"max_value": 80
},
{
"name": "Prehypertension"
"score": 50
"min_value": 81
"max_value": 89
},
{
"name": "Stage 1 Hypertension"
"score": 20
"min_value": 90
"max_value": 99
},
{
"name": "Stage 2 Hypertension"
"score": 0
"min_value": 100
"max_value": 120
}
]
}
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"signal_type_ids": [
"c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"8399d4a7-b2c6-48f9-9db1-55710cc66e4a"
]
}
Assign to a signal group
Signal groups manage presentation of related signals to the user. A signal type may belong to multiple signal groups (or none.)
POST /signals/groups/create
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"signal_groups": [
{
"category": "biometric",
"name": "Blood Pressure",
"description": "The pressure exerted by the blood against the walls of the blood vessels, especially the arteries.",
"visibility": [
"member",
"coach"
],
"signal_type_ids": [
"c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"8399d4a7-b2c6-48f9-9db1-55710cc66e4a"
]
}
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"signal_group_ids": [
"f9d04a57-d64c-4a84-b097-196468c2c0f7"
]
}
Record biometric values
POST /signals/values/create
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"signal_values": [
{
"signal_type_id": "c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"tuple_id": "992922bb-26d4-4259-b08f-a584edcf5f23",
"member_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"source": "member",
"source_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"span": {
"from": "2015-04-01T11:00:00Z",
"to": "2015-04-01T11:00:00Z"
},
"value": {
"value_type": "integer",
"value": 110
}
},
{
"signal_type_id": "8399d4a7-b2c6-48f9-9db1-55710cc66e4a",
"tuple_id": "992922bb-26d4-4259-b08f-a584edcf5f23",
"member_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"source": "member",
"source_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"span": {
"from": "2015-04-01T11:00:00Z",
"to": "2015-04-01T11:00:00Z"
},
"value": {
"value_type": "integer",
"value": 70
}
}
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"signal_value_ids": [
"736c1987-fb62-4f69-a53f-d266a39e0caa",
"37f0063b-d76e-43d8-8b3e-b12101f596cf"
]
}
Add goal for biometric target
Configure goal
POST /goals/create
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"goals": [
{
"name": "Lower systolic blood pressure"
"interval": "0 12 * * *"
"duration": [
"2015-04-01T11:00:00Z",
"2015-05-30T11:00:00Z"
],
"target": {
"signal_type": "c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c"
"min_value": 0
"max_value": 110
}
}
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"goal_ids": [
"872cecd2-43e5-4352-9373-e397f56b135d"
]
}
Record goal status
POST /goals/statuses/create
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"goal_statuses": [
{
"goal_id": "872cecd2-43e5-4352-9373-e397f56b135d",
"member_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"span": [
"2015-04-01T11:00:00Z",
],
"value": {
"value_type": "integer",
"value": 115
}
}
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"goal_status_ids": [
"301777d7-9cfc-4a54-839b-9a03d160f3bc"
]
}
Retrieve previously recorded values
Examples for simple retrieval of each object by id.
Signal types
POST /signals/types/show
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"signal_type_ids": [
"c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"8399d4a7-b2c6-48f9-9db1-55710cc66e4a"
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"signal_types": [
{
"id": "c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"name": "Systolic",
"description": "The maximum arterial pressure during contraction of the left ventricle of the heart",
"unit": "mm Hg"
"value_type": "integer",
"nullable": false,
"sources": [
"member",
"coach",
"device"
],
"disposition_ranges": [
{
"name": "Healthy"
"score": 100
"min_value": 0
"max_value": 120
},
{
"name": "Prehypertension"
"score": 50
"min_value": 121
"max_value": 139
},
{
"name": "Stage 1 Hypertension"
"score": 20
"min_value": 140
"max_value": 159
},
{
"name": "Stage 2 Hypertension"
"score": 0
"min_value": 160
"max_value": 300
}
]
},
{
"id": "8399d4a7-b2c6-48f9-9db1-55710cc66e4a",
"name": "Diastolic",
"description": "The pressure in the arteries when the heart rests between beats",
"unit": "mm Hg"
"value_type": "integer",
"nullable": false,
"sources": [
"member",
"coach",
"device"
],
"disposition_ranges": [
{
"name": "Healthy"
"score": 100
"min_value": 0
"max_value": 80
},
{
"name": "Prehypertension"
"score": 50
"min_value": 81
"max_value": 89
},
{
"name": "Stage 1 Hypertension"
"score": 20
"min_value": 90
"max_value": 99
},
{
"name": "Stage 2 Hypertension"
"score": 0
"min_value": 100
"max_value": 120
}
]
}
]
}
Signal groups
POST /signals/groups/show
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"signal_group_ids": [
"f9d04a57-d64c-4a84-b097-196468c2c0f7"
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"signal_groups": [
{
"id": "f9d04a57-d64c-4a84-b097-196468c2c0f7"
"category": "biometric",
"name": "Blood Pressure",
"description": "The pressure exerted by the blood against the walls of the blood vessels, especially the arteries.",
"visibility": [
"member",
"coach"
],
"signal_type_ids": [
"c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"8399d4a7-b2c6-48f9-9db1-55710cc66e4a"
]
}
]
}
Signal values
POST /signals/values/show
Request body:
{
"request_metadata": {
"endpoint_version": "1.0",
"api_key": "TEST-API-KEY"
},
"signal_value_ids": [
"736c1987-fb62-4f69-a53f-d266a39e0caa",
"37f0063b-d76e-43d8-8b3e-b12101f596cf"
]
}
Response body:
{
"response_status": {
"http_status": 200,
"error_code": 0,
"message": "Success"
},
"signal_values": [
{
"id": "736c1987-fb62-4f69-a53f-d266a39e0caa",
"signal_type_id": "c1cf445b-0fdc-4a5c-9b87-fe9f3e59f94c",
"tuple_id": "992922bb-26d4-4259-b08f-a584edcf5f23",
"member_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"source": "member",
"source_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"span": {
"from": "2015-04-01T11:00:00Z",
"to": "2015-04-01T11:00:00Z"
},
"value": {
"value_type": "integer",
"value": 110
}
},
{
"id": "37f0063b-d76e-43d8-8b3e-b12101f596cf",
"signal_type_id": "8399d4a7-b2c6-48f9-9db1-55710cc66e4a",
"tuple_id": "992922bb-26d4-4259-b08f-a584edcf5f23",
"member_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"source": "member",
"source_id": "605b3b7f-c5dd-4f2f-8608-59f53c5a771e",
"span": {
"from": "2015-04-01T11:00:00Z",
"to": "2015-04-01T11:00:00Z"
},
"value": {
"value_type": "integer",
"value": 70
}
}
]
}