API Reference: Quickstart
To start you need the following:
- A Valid
license.
- An API key (preferably from the sandbox)
It is recommended that the <STAGE> you start with is /sandbox.
Software partners:
There are additional instructions for authentication available within your BloodCOMM API settings - your requests will fail unless the correct data is supplied with every request.
1. Test Authentication
Send a request to / to verify that your application is able to talk to BloodCOMM, and to test your authentication process.
| Method | Content Type | Response |
|---|---|---|
GET |
Returns authentication result | Plain Text |
For example, a cURL request would be:
curl -H "Authorization: Bearer <ORGANIZATION_API_KEY>"
https://api.blood.dev/sandbox/
A successful result would look like:
===========================================================================+
| |
| ____ _ _ ____ ___ __ __ __ __ _ ____ ___ |
| | __ )| | ___ ___ __| |/ ___/ _ \| \/ | \/ | / \ | _ \_ _| |
| | _ \| |/ _ \ / _ \ / _ | | | | | | |\/| | |\/| | / _ \ | |_) | | |
| | |_) | | (_) | (_) | (_| | |__| |_| | | | | | | | / ___ \| __/| | |
| |____/|_|\___/ \___/ \__,_|\____\___/|_| |_|_| |_| /_/ \_\_| |___| |
| |
+===========================================================================+
Get started at: https://docs.blood.dev/api
API Key valid: VALID API KEY
2. Get a list of available devices
Send a GET request to /devices to get a list of all available devices within your organization.
| Method | Description | Response |
|---|---|---|
GET |
Returns an array of devices | JSON Array |
For example, a cURL request would be:
curl -H "Authorization: Bearer <ORGANIZATION_API_KEY>"
https://api.blood.dev/sandbox/devices
Response:
| Method | Description |
|---|---|
serial |
Device Serial Number |
type |
Device Type |
license |
Device License* |
nickname |
Optional Device Nickname |
teams |
Optional list of Team UUIDs, for use with the Teams API |
This request will return all registered cloud devices, including those that are not currently active or those which do not have a valid subscription.
Take note of the license status for each device, as only the following can be used for further queries: PRO, PRO_TRIAL, PREMIUM, PREMIUM_TRIAL. Expired or otherwise unlicensed devices will not return data.
[
{
"serial": <string>,
"type": <string>,
"license": <string>,
"nickname": <string>,
"teams":[<string>]
},
...
]
3. Request Dashboard Data for a Single Device
Send a GET request for a single device to see the current, realtime status of that device. Use the below format, using the type and serial vlaues returned in the above step.
/devices/dashboard/<DEVICE_TYPE>/<SERIAL_NUMBER>
| Method | Description | Response |
|---|---|---|
GET |
Returns a single device's status | JSON Object |
For example, a cURL request would be:
curl -H "Authorization: Bearer <ORGANIZATION_API_KEY>"
https://api.blood.dev/sandbox/devices/ICE-002L/1ABCDE
Response:
| Method | Description | Units |
|---|---|---|
temperature |
Current Cooler Temperature | °C |
duration |
Duration remaining until Excursion | hours |
timestamp |
Last recorded timestamp | seconds |
battery |
Current battery percentage | % |
{
"temperature": <float>,
"duration": <int>,
"timestamp": <int>,
"battery": <int>,
}