NAV
shell python

Introduction

Welcome! On this page you can learn how to use the Pylo API and webhooks.

Here is a summary of the services we offer:

  1. Devices Service: API service where you can get information about devices currently possessed by your company.

  2. Readings Service: API service where you can get device measurement readings.

  3. Fulfillment Service: API service where you can place orders and get order status.

  4. Webhooks: Webhooks enable you to subscribe your application to our system so that it can be notified when new measurement readings have been received.

You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. If you do not see your programming language of choice, please let us know and we will add examples for it.

API Setup and General Usage

Authentication

Please review the following authentication information before using any of the services listed in this documentation.

To authorize, use this code:

# Set your api in the request header as shown below:
headers = {
    'x-api-key': 'your-api-key'
}

# With shell, you can just pass the correct header with each request
curl 'https://api.pylo.com/readings' \
  -H 'x-api-key: your-api-key'

Make sure to replace your-api-key with your API key.

The Pylo API uses API keys to allow access to the API. You can register a new Pylo API key at our developer portal.

Pylo expects for the API key to be included in all API requests to the server in a header that looks like the following:

'x-api-key': 'your-api-key'

Pagination

import requests

headers = {
    'x-api-key': 'your-api-key'
}
payload = {
    'cursor': None
}

# Get first page
response = requests.get('https://api.pylo.com/devices', headers=headers).json()
payload['cursor'] = response['page_info']['cursor_token'] # Store for next page 

# Do stuff with this page of items 
print(response)

# Get subsequent pages
while payload['cursor'] is not None:
    response = requests.get('https://api.pylo.com/devices', headers=headers, params=payload).json()

    payload['cursor'] = response['page_info']['cursor_token'] # Store for next page 
    # Do stuff with this page of items 
    print(response)

Some resources may return a large response, so we employ the use of pagination in these cases. Usage is simple and does not require you to keep track of pages. How it works is with each response there is a "cursor_token". This cursor signifies where in your response we last left off. If the cursor_token is ever null, there are no more items to fetch. In other words, while there is a token_cursor in the response, there are additional pages to be fetched; get the next page by including the cursor_token in your next request.

An example of the business logic for getting all items is shown on the right.

Devices Service

The Devices resource enables you to get information about your company's devices. This is a suggested starting place if you haven't yet mapped device identifiers to your patients.

Get All Devices

You can get information about all of your company's devices by sending a GET request to: https://api.pylo.com/devices

Pagination

A limit of 50 devices will be returned per request. If there are more than 50 devices, a "cursor_token" will be returned. If you would like to get the next 50 devices, supply the cursor token as a query parameter. See Pagination for more information.

HTTP Request

GET https://api.pylo.com/devices
GET https://api.pylo.com/devices?cursor=YOUR_TOKEN

Query Parameters

import requests

headers = {
    'x-api-key': 'your-api-key'
}
payload = {
    'cursor': None
}

# Get first page
response = requests.get('https://api.pylo.com/devices', headers=headers).json()
payload['cursor'] = response['page_info']['cursor_token'] # Store for next page 

# Do stuff with this page of items 
print(response)

# Get subsequent pages
while payload['cursor'] is not None:
    response = requests.get('https://api.pylo.com/devices', headers=headers, params=payload).json()

    payload['cursor'] = response['page_info']['cursor_token'] # Store for next page 
    # Do stuff with this page of items 
    print(response)

curl -X GET 'https://api.pylo.com/devices' \ 
    -H 'x-api-key: your-api-key'

The following optional parameter should be supplied in the query parameters if using pagination.

Query String Parameter Type Description
cursor_token string The token returned from the previous page. Supply this token in another request to get the subsequent page. See Pagination for more information.

Response Body

The above command returns all devices possessed by your company in an array of JSONs structured like this:

{
    "devices": [
        {
            "device_imei": "imei1",
            "device_sim": "sim1",
            "device_id": "id1",
            "device_type": "type1",
            "patient_id": "patient_id1"
        },
        {
            "device_imei": "imei2",
            "device_sim": "sim2",
            "device_id": "id2",
            "device_type": "type2",
            "patient_id": "patient_id2"
        },
        {
          ...
        },
        {
            "device_imei": "imei50",
            "device_sim": "sim50",
            "device_id": "id50",
            "device_type": "type50",
            "patient_id": "patient_id50"
        },
    ],
    "page_info": {
        "cursor_token": "Y3VycmVudF9jdXJzb3JfcG9zaXRpb24x=="
    }
}


Name Type Description
devices object[] List of devices possessed by your company.
devices[x].device_imei string The IMEI for this device.
devices[x].device_sim string The SIM corresponding for this device.
devices[x].device_id string The device ID for this device.
devices[x].patient_id string The patient ID that this device is currently mapped to. Empty if no patient_id supplied upon ordering.
page_info object Information about the response; used for pagination.
page_info.cursor_token string The token signifying where in the response the cursor left off. Supply this token in another request to get the subsequent page. See Pagination for more information.

Get Specific Device

Supply either device_id or imei to get information about that particular device.

HTTP Request

GET https://api.pylo.com/devices?id=DEVICE_ID
GET https://api.pylo.com/devices?imei=IMEI

Query Parameters

import requests

headers = {
    'x-api-key': 'your-api-key'
}
payload = {
    'id': 'deviceid123' 
}

response = requests.get('https://api.pylo.com/devices', headers=headers)
curl -X GET 'https://api.pylo.com/devices?id=deviceid123' \ 
    -H 'x-api-key: your-api-key'

Supply exactly one of the following parameters to get information about a specific device.

Query String Parameter Type Description
id string The device_id corresponding to the device about which you seek information.
imei string The imei corresponding to the device about which you seek information.

Response Body

The above command returns information about the device corresponding to the query string parameter you provided in JSON structured like this:

{
    "device_imei": "imei123",
    "device_sim": "sim123",
    "device_id": "id123",
    "device_type": "type123",
    "patient_id": "patient_id123"
}


Name Type Description
device_imei string The IMEI for this device.
device_sim string The SIM corresponding for this device.
device_id string The device ID for this device.
patient_id string The patient ID that this device is currently mapped to. Empty if no patient_id supplied upon ordering.

Readings Service

The Readings resource enables you to query device readings using a combination of filters. Filters are defined in the data of a POST request. Filter options are set forth below.

Note: This endpoint retrieves all measurements taken on your company's member devices which satisfy all of the filter parameters provided in your request (logical AND).

Pagination

A limit of 50 measurement readings will be returned per request. If there are more than 50 readings, a "cursor_token" will be returned. If you would like to get the next 50 devices, supply the cursor token as a query parameter. See Pagination for more information.

Unique Identifiers for Queries

HTTP Request

POST https://api.pylo.com/readings

Query Parameters

import requests

headers = {
    'x-api-key': 'your-api-key'
}

filters = {
    'imei': 'imei1',
    'measurement_taken_start_date': '2021-02-21T23:12:00.000Z'
}

requests.post(
    'https://api.pylo.com/readings'
    json=filters,
    headers=headers
).json()

curl -d '{"imei": "imei1"}' \
    -X POST 'https://api.pylo.com/readings' \ 
    -H 'x-api-key: your-api-key'

The following optional query string parameter should be supplied if using pagination.

Query String Parameter Type Description
cursor_token string The token returned from the previous page. Supply this token in another request to get the subsequent page. See Pagination for more information.

These parameters should be in the POST data. At least one parameter is required.

Data (JSON) Type Description
reading_id string Only the measurement with this ID will be returned.
imei string Only measurements taken by the device with this IMEI will be returned.
patient_id string Only measurements taken by this patient will be returned.
device_id string Only measurements taken by the device with this device ID will be returned.
reading_type string Only measurements of this reading type will be returned.
measurement_taken_start_date string Results will only include measurements taken between this date end end date. Specify datetime in ISO 8601 format in UTC (e.g., 2021-02-21T23:12:00.000Z).
measurement_taken_end_date string Similar to measurement_taken_start_date, but end of range. Specify datetime in ISO 8601 format in UTC (e.g., 2021-02-21T23:12:00.000Z).

Response Body

The above command returns all measurements which satisfy all the filter requirements in an array of JSONs structured like this:

{
    "measurements": [
        {
            "DeviceUser": "1",
            "MeasurementType": "Blood Pressure",
            "DeviceId": "deviceid1",
            "MeasuredAt": "2021-02-23T22:06:00.000Z",
            "BatteryPercentage": 58,
            "DeviceModel": "PY-802-LTE",
            "DeviceType": "PyloBp",
            "InsertedAt": "2021-02-23T22:06:00.000Z",
            "DeviceSim": "sim1",
            "Id": "id3",
            "DeviceImei": "imei1",
            "SignalStrengthPercentage": 94,
            "PatientId": "patient_id1",
            "Values": [
                {
                    "Value": 84,
                    "Type": "diastolic"
                },
                {
                    "Value": 129,
                    "Type": "systolic"
                },
                {
                    "Value": 62,
                    "Type": "pulse"
                },
                {
                    "Value": 0,
                    "Type": "irregular"
                }
            ]
        },
        {
            "DeviceUser": "1",
            "MeasurementType": "Blood Pressure",
            "DeviceId": "deviceid1",
            "MeasuredAt": "2021-02-25T22:06:00.000Z",
            "BatteryPercentage": 56,
            "DeviceModel": "PY-802-LTE",
            "DeviceType": "PyloBp",
            "InsertedAt": "2021-02-25T22:06:00.000Z",
            "DeviceSim": "sim1",
            "Id": "id1",
            "DeviceImei": "imei1",
            "SignalStrengthPercentage": 75,
            "PatientId": "patient_id1",
            "Values": [
                {
                    "Value": 77,
                    "Type": "diastolic"
                },
                {
                    "Value": 133,
                    "Type": "systolic"
                },
                {
                    "Value": 66,
                    "Type": "pulse"
                },
                {
                    "Value": 0,
                    "Type": "irregular"
                }
            ]
        }
    ],
    "page_info": {
      "cursor_token": "Y3VycmVudF9jdXJzb3JfcG9zaXRpb24x=="
    }
}


Name Type Description
Measurements object[] List of measurements found based on the search criteria.
Measurements[x].DeviceUser string The user of the device for this measurement (will always be 1 for devices without switchable user profiles).
Measurements[x].MeasurementType string Either "Weight" or "Blood Pressure".
Measurements[x].DeviceId string The serial number of the device.
Measurements[x].MeasuredAt string The ISO timestamp for when the measurement was recorded.
Measurements[x].BatteryPercentage number The percentage of battery that remains on the device.
Measurements[x].DeviceModel string The model number of the device.
Measurements[x].DeviceType string The type/brand of the device (e.g., PyloBp, PyloWt, etc.)
Measurements[x].InsertedAt string The time at which the measurement was inserted into our database.
Measurements[x].DeviceSim string The ICCID of the SIM profile currently being used by the device.
Measurements[x].Id string The unique ID for the measurement.
Measurements[x].DeviceImei string The IMEI of the device.
Measurements[x].SignalStrengthPercentage number Signal strength of the device (if applicable), which ranges from 0 - 100
Measurements[x].PatientId string The patient ID provided by partner to Pylo to attach to this device (usually at the time of ordering). Optional.
Measurements[x].Values[y].Value string The value of this reading. (Blood pressure in mmHg, weight in lbs.)
Measurements[x].Values[y].Type string The type of this reading

Fulfillment Service

This service enables you to place an order, get order information, and more.

Authentication

Requests use the same authentication method defined in Authentication above.

Place Order

Place an order for a device (or devices) to be shipped to a patient. Supply order details in the body of the request. An order number will be returned to the client upon success.

HTTP Request

POST https://api.pylo.com/orders

Query Parameters

import requests

headers = {
    'x-api-key': 'your-api-key'
}

order = {
    'order_requested_shipping_service': 'standard',
    'order_notes_from_buyer': 'Please send ASAP'
    'recipient_first_name': 'John',
    'recipient_last_name': 'Doe',
    'recipient_phone': '5551234567',
    'recipient_email': 'jdoe@gmail.com',
    'recipient_company': '',
    'address1': '30 rockefeller center',
    'address2': 'apt 5'
    'address3': '',
    'city': 'New York',
    'state': 'NY',
    'postal_code': '10041',
    'country_code': 'USA',
    'devices': [
        {
            'item_sku': 'PY-802-LTE',
            'quantity': '2'
        },
        {
            'item_sku': 'PY-300-LTE',
            'quantity': '1'
        }
    ],
    'require_signature': 'no',
    'confirmation': 'none',
    'patient_identifier': 'patientid123',
    'billing_info': {
            'name': 'ABC Company Health',
            'country': 'US',
            'street1': '10 Rockefeller Plaza',
            'state': 'NY',
            'postal_code': '10112',
            'city': 'New York'
    },
}

requests.post(
    'https://api.pylo.com/orders',
    json=order,
    headers=headers
).json()

Create a file "order.json" following the format below. 
Change values as needed.
{
    'order_requested_shipping_service': 'standard',
    'order_notes_from_buyer': 'Please send ASAP'
    'recipient_first_name': 'John',
    'recipient_last_name': 'Doe',
    'recipient_phone': '5551234567',
    'recipient_email': 'jdoe@gmail.com',
    'recipient_company': '',
    'address1': '70 rockefeller center',
    'address2': 'apt 5'
    'address3': '',
    'city': 'New York',
    'state': 'NY',
    'postal_code': '10041',
    'country_code': 'USA',
    'devices': [
        {
            'item_sku': 'PY-802-LTE',
            'quantity': '2'
        },
        {
            'item_sku': 'PY-300-LTE',
            'quantity': '1'
        }
    ]
    'require_signature': 'no',
    'patient_identifier': 'patientid123',
    'billing_info': {
        'name': 'ABC Company Health',
        'country': 'US',
        'street1': '10 Rockefeller Plaza',
        'state': 'NY',
        'postal_code': '10112',
        'city': 'New York'
    },
}
Then, pass that file as a payload to a curl POST:
curl -d '@../path-to-file/order.json' \
    -X POST 'https://api.pylo.com/orders' \
    -H 'x-api-key: your-api-key'

These parameters should be in the POST data.

Parameter Type Description
order_requested_shipping_service string Either 'standard' or 'two-day'.
order_notes_from_buyer string Any notes you wish to be attached to the order.
recipient_first_name string The first name of the patient to which the device is being sent.
recipient_last_name string The last name of the patient to which the device is being sent.
recipient_phone string The phone number of the patient to which the device is being sent.
recipient_email string The email of patient to which the device is being sent.
recipient_company string The company of the patient to which the device is being sent.
address_line_1 string The address of the patient to which the device is being sent.
address_line_2 string Additional space for the address of the patient to which the device is being sent.
address_line_3 string Additional space for the address of the patient to which the device is being sent.
city string The city of the above address.
state string The state of the above address.
postal_code string The postal code of the above address.
country_code string The ISO country code of the above address.
devices obj[] An array of devices to be ordered.
devices[x][item_sku] string The item to be ordered. Can be "PY-802-LTE" or "PY-300-LTE".
devices[x][quantity] string The quantity of devices[x][item_sku] to be ordered.
require_signature string Whether a signature should be required upon delivery. Can be "yes" or "no".
confirmation string Whether to request proof of delivery from the carrier. Set to "none" unless specifically required.
patient_identifier string The unique patient identifier internal to your company.
billing_info obj The billing information for your company.
billing_info[name] string The name of your company or the name of the party to be billed.
billing_info[street1] string The street number and name of the company or bill-to party address.
billing_info[state] string The state of the company or bill-to party address.
billing_info[city] string The city of the company or bill-to party address.
billing_info[postal_code] string The postal code of the company or bill-to party address.
billing_info[country] string The ISO country code of the company or bill-to party address.

Response Body

The above command returns a 200 with an order number if the order was placed successfully, or an error code otherwise.

{
  "status": "OK",
  "order_number": "497993eb-2b94-4a51-ae21-477a9254b4b3"
}
Name Type Description
status string The status code of the response. "OK" if order placed successfully.
order_number string The order reference number for the newly created order. Use this when querying orders via GET.

Get Specific Order

Pass an order number as a query parameter to get details about that order.

HTTP Request

GET https://api.pylo.com/orders?number={your order number}

Query Parameters

import requests

headers = {
    'x-api-key': 'your-api-key'
}

payload = {
    'number': 'abc123'
}

requests.get(
    'https://api.pylo.com/orders',
    params=payload,
    headers=headers
).json()

curl -X GET 'https://api.pylo.com/orders?number=abc123' \
    -H 'x-api-key: your-api-key'

The order number parameter should be passed in the URL.

Parameter Type Description
number string The unique order number returned when you placed the order. If you do not know the order number, you can perform a GET without providing an order number to retrieve all orders for your company.

Response Body

The above command returns the order details if found, or a 404 error code otherwise.

{
    "address3": "",
    "last_name_recipient": "Doe",
    "email_recipient": "jdoe@gmail.com",
    "devices": [
        {
            "sku": "PY-802-LTE",
            "quantity": "2",
            "imeis": []
        },
        {
            "sku": "PY-300-LTE",
            "quantity": "1",
            "imeis": []
        }
    ],
    "first_name_recipient": "John",
    "order_notes_from_buyer": "Please send ASAP",
    "phone_recipient": "5551234567",
    "state": "NY",
    "postal_code": "10041",
    "date_placed": "2021-04-20 05:57:22",
    "city": "New York",
    "require_signature": "no",
    "confirmation": "none",
    "order_requested_shipping_service": "ups",
    "order_number": "02877f36-660f-475e-8778-3c2e4758301c",
    "company_recipient": "",
    "country_code": "US",
    "address1": "30 rockefeller center",
    "patient_id": "patientid123",
    "address2": "",
    "date_order_processed": "2021-04-20 05:57:22",
    "order_status": "awaiting_shipment",
    "ship_date": "",
    "tracking_number": ""
}
{
    "address3": "",
    "last_name_recipient": "Doe",
    "email_recipient": "jdoe@gmail.com",
    "devices": [
        {
            "sku": "PY-802-LTE",
            "quantity": "2",
            "imeis": []
        },
        {
            "sku": "PY-300-LTE",
            "quantity": "1",
            "imeis": []
        }
    ],
    "first_name_recipient": "John",
    "order_notes_from_buyer": "Please send ASAP",
    "phone_recipient": "5551234567",
    "state": "NY",
    "postal_code": "10041",
    "date_placed": "2021-04-20 05:57:22",
    "city": "New York",
    "require_signature": "no",
    "confirmation": "none",
    "order_requested_shipping_service": "ups",
    "order_number": "02877f36-660f-475e-8778-3c2e4758301c",
    "company_recipient": "",
    "country_code": "US",
    "address1": "30 rockefeller center",
    "patient_id": "patientid123",
    "address2": "",
    "date_order_processed": "2021-04-20 05:57:22",
    "order_status": "awaiting_shipment",
    "ship_date": "",
    "tracking_number": ""
}
Key Type Value
order_number string The order number corresponding to this order.
order_date string The date at which the order was placed.
order_status string The status of this order. Will be one of these values.
ship_date string The date on which the order was shipped.
carrier_code string The carrier code for this shipment.
tracking_number string The tracking number for this shipment.
order_requested_shipping_service string Either 'standard' or 'two-day'.
order_notes_from_buyer string Any notes you wish to be attached to the order.
first_name_recipient string The first name of the patient to which the device is being sent.
last_name_recipient string The last name of the patient to which the device is being sent.
phone_recipient string The phone number of the patient to which the device is being sent.
email_recipient string The email of patient to which the device is being sent.
company_recipient string The company of the patient to which the device is being sent.
address1 string The address of the patient to which the device is being sent.
address2 string Additional space for the address of the patient to which the device is being sent.
address3 string Additional space for the address of the patient to which the device is being sent.
city string The city of the above address.
state string The state of the above address.
postal_code string The postal code of the above address.
country_code string The ISO country code of the above address.
devices obj[] An array of devices to be ordered.
devices[x]['sku'] string The item to be ordered. Will be "PY-802-LTE" or "PY-300-LTE".
devices][x]['quantity'] string The number of devices with this sku in this order.
devices[x]['imei'] string The IMEIs for these devices. Will be an empty string if awaiting shipment, or a list of strings (one IMEI for each device) once shipped.
require_signature string Whether a signature should be required upon delivery. Can be "yes" or "no".
patient_id string The unique patient identifier internal to your company.

Order Status

order_status will be one of the following strings:

Shipping Type shipping_type will be one of the following strings:

Get All Orders

Get all orders for your company.

HTTP Request

GET https://api.pylo.com/orders?cursor={cursor_returned_from_previous_page}

Query Parameters

import requests

headers = {
    'x-api-key': 'your-api-key'
}


requests.get(
    'https://api.pylo.com/orders',
    headers=headers
).json()

curl -X GET 'https://api.pylo.com/orders' \
    -H 'x-api-key: your-api-key'

The cursor token parameter should be passed in the URL.

Parameter Type Description
cursor string The token returned from the previous page. Supply this token in another request to get the subsequent page. See Pagination for more information.

Response Body

The above command returns all orders for your company.

{
    "orders": [
        {
            "address3": "",
            "last_name_recipient": "Seldon",
            "email_recipient": "hseldon@galacticempire.net",
            "devices": [
                {
                    "sku": "PY-802-LTE",
                    "quantity": "2",
                    "imeis": []
                },
                {
                    "sku": "PY-300-LTE",
                    "quantity": "1",
                    "imeis": []
                }
            ],
            "first_name_recipient": "Harry",
            "order_notes_from_buyer": "Please send ASAP",
            "phone_recipient": "5551234567",
            "state": "NY",
            "postal_code": "10041",
            "date_placed": "2021-04-20 05:57:22",
            "city": "New York",
            "require_signature": "no",
            "confirmation": "none",
            "order_requested_shipping_service": "ups",
            "order_number": "02877f36-660f-475e-8778-3c2e4758301c",
            "company_recipient": "",
            "country_code": "US",
            "address1": "30 rockefeller center",
            "patient_id": "patientid1",
            "address2": "",
            "date_order_processed": "2021-04-20 05:57:22",
            "order_status": "awaiting_shipment",
            "ship_date": "",
            "tracking_number": ""
        },
        {
            "address3": "",
            "last_name_recipient": "Doe",
            "email_recipient": "jdoe@gmail.com",
            "devices": [
                {
                    "sku": "PY-802-LTE",
                    "quantity": "2",
                    "imeis": []
                },
                {
                    "sku": "PY-300-LTE",
                    "quantity": "1",
                    "imeis": []
                }
            ],
            "first_name_recipient": "John",
            "order_notes_from_buyer": "No rush",
            "phone_recipient": "5551234567",
            "state": "NY",
            "postal_code": "10041",
            "date_placed": "2021-04-20 06:30:06",
            "city": "New York",
            "require_signature": "no",
            "confirmation": "none",
            "order_requested_shipping_service": "standard",
            "order_number": "417e93eb-2b24-4151-ae21-477a925fb4b3",
            "company_recipient": "",
            "country_code": "US",
            "address1": "30 rockefeller center",
            "patient_id": "patientid2",
            "address2": "",
            "date_order_processed": "2021-04-20 06:30:06",
            "order_status": "shipped",
            "ship_date": "2021-04-01",
            "carrier_code": "ups_walleted",
            "service_code": "ups_ground",
            "tracking_number": "1Zabcdefg"
        },
        {
            # ...more orders
        }
    ],        
    "page_info": {
        "cursor_token": "abcdefghijklmnopqrstuvwxyz==="
    }
}

{
    "orders": [
        {
            "address3": "",
            "last_name_recipient": "Seldon",
            "email_recipient": "hseldon@galacticempire.net",
            "devices": [
                {
                    "sku": "PY-802-LTE",
                    "quantity": "2",
                    "imeis": []
                },
                {
                    "sku": "PY-300-LTE",
                    "quantity": "1",
                    "imeis": []
                }
            ],
            "first_name_recipient": "Harry",
            "order_notes_from_buyer": "Please send ASAP",
            "phone_recipient": "5551234567",
            "state": "NY",
            "postal_code": "10041",
            "date_placed": "2021-04-20 05:57:22",
            "city": "New York",
            "require_signature": "no",
            "confirmation": "none",
            "order_requested_shipping_service": "ups",
            "order_number": "02877f36-660f-475e-8778-3c2e4758301c",
            "company_recipient": "",
            "country_code": "US",
            "address1": "30 rockefeller center",
            "patient_id": "patientid1",
            "address2": "",
            "date_order_processed": "2021-04-20 05:57:22",
            "order_status": "awaiting_shipment",
            "ship_date": "",
            "tracking_number": ""
        },
        {
            "address3": "",
            "last_name_recipient": "Doe",
            "email_recipient": "jdoe@gmail.com",
            "devices": [
                {
                    "sku": "PY-802-LTE",
                    "quantity": "2",
                    "imeis": []
                },
                {
                    "sku": "PY-300-LTE",
                    "quantity": "1",
                    "imeis": []
                }
            ],
            "first_name_recipient": "John",
            "order_notes_from_buyer": "No rush",
            "phone_recipient": "5551234567",
            "state": "NY",
            "postal_code": "10041",
            "date_placed": "2021-04-20 06:30:06",
            "city": "New York",
            "require_signature": "no",
            "confirmation": "none",
            "order_requested_shipping_service": "standard",
            "order_number": "417e93eb-2b24-4151-ae21-477a925fb4b3",
            "company_recipient": "",
            "country_code": "US",
            "address1": "30 rockefeller center",
            "patient_id": "patientid2",
            "address2": "",
            "date_order_processed": "2021-04-20 06:30:06",
            "order_status": "shipped",
            "ship_date": "2021-04-01",
            "carrier_code": "ups_walleted",
            "service_code": "ups_ground",
            "tracking_number": "1Zabcdefg"
        },
        {
            # ...more orders
        }
    ],        
    "page_info": {
        "cursor_token": "abcdefghijklmnopqrstuvwxyz==="
    }
}
Key Type Value
orders[] object[] An array of orders. See the response body in Get Specific Order for the order model definition.
page_info['cursor_token'] string The token returned from the previous page. Supply this token in another request to get the subsequent page. See Pagination for more information.

Order Status

order_status will be one of the following strings:

Shipping Type shipping_type will be one of the following strings:

API Errors

The Pylo API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is invalid or order fulfillment has not been enabled for your account.
403 Forbidden -- Your API key may be valid but it is not associated with a usage plan.
406 Not Acceptable -- You requested a format that isn't json.
429 Too Many Requests or Limit Exceeded -- You're requesting too many measurements! Slow down (or request a rate/quota increase)!
500 Internal Server Error -- We had a problem with our server. Try again later. If the problem persists, please contact us.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Webhooks

Overview

Pylo webhooks can be used to notify applications when measurements are taken.

Delivery Information

HMAC Validation

Blood Pressure Webhook

Triggers whenever a measurement is received from a blood pressure device or app.

Blood Pressure Webhook format

Example blood pressure webhook POST.

{
    "event": "DEVICE_MEASUREMENT",
    "eventTime": "2021-02-23T22:07:00.000Z",
    "data": 
        {
            "Id": "id1",
            "DeviceId": "deviceid1",
            "DeviceImei": "imei1",
            "DeviceSim": "sim1",
            "DeviceType": "PyloBp",
            "DeviceModel": "PY-802-LTE",
            "DeviceUser": "1",
            "MeasurementType": "Blood Pressure",
            "BatteryPercentage": 58,
            "SignalStrengthPercentage": 94,
            "MeasuredAt": "2021-02-23T22:06:00.000Z",
            "Values": [
                {
                    "Value": 84,
                    "Type": "diastolic"
                },
                {
                    "Value": 129,
                    "Type": "systolic"
                },
                {
                    "Value": 62,
                    "Type": "pulse"
                },
                {
                    "Value": 0,
                    "Type": "irregular"
                }
            ],
            "PatientId": "patient_id1"
        },
  "signature": "abcd1234"
}
Key Type Value
event string The event that triggered this webhook. (For patient measurements, the event will be "DEVICE_MEASUREMENT".)
eventTime string The ISO timestamp for when the webhook was first sent.
data object The data related to the event.
data.Id string A unique ID for the measurement.
data.DeviceId string The serial number of the device.
data.DeviceImei string The IMEI of the device.
data.DeviceSim string The ICCID of the SIM profile currently being used by the device.
data.DeviceType string The type/brand of the device. Will be "PyloBp".
data.DeviceModel string The model number of the device.
data.DeviceUser string The user of the device for this measurement (will always be 1 for devices without switchable user profiles).
data.MeasurementType string Will be "Blood Pressure".
data.BatteryPercentage number The percentage of battery that remains on the device.
data.SignalStrengthPercentage number Signal strength of the device (if applicable), which ranges from 0 - 100
data.MeasuredAt string The ISO timestamp for when the measurement was recorded.
data.Values object[] The array of measurement type and value pairs for this measurement.
data.Values[0].Value number The value of this diastolic blood pressure reading in units of mmHg.
data.Values[0].Type string The type of this reading. Will be "diastolic".
data.Values[1].Value number The value of this systolic blood pressure reading in units of mmHg.
data.Values[1].Type string The type of this reading. Will be "systolic".
data.Values[2].Value number The value of this pulse reading in units of BPM.
data.Values[2].Type string The type of this reading. Will be "pulse".
data.Values[3].Value number A boolean (1 or 0) number indicating whether the reading is irregular. 1 if irregular, 0 otherwise.
data.Values[3].Type string The type of this reading. Will be "irregular".
data.PatientId string The patient ID provided by partner to Pylo to attach to this device (usually at the time of ordering). Optional.
signature string HMAC SHA-256 of the data field against the secret provided when the webhook was configured. Can be used to verify that the data came from us and was not altered en route.

Weight Webhook

Triggers whenever a measurement is received from a weight device or app.

Weight Webhook Format

Example weight webhook POST.

{
    "event": "DEVICE_MEASUREMENT",
    "eventTime": "2021-02-23T22:07:00.000Z",
    "data": 
        {
            "Id": "id1",
            "DeviceId": "deviceid1",
            "DeviceImei": "imei1",
            "DeviceSim": "sim1",
            "DeviceType": "PyloWt",
            "DeviceModel": "PY-802-LTE",
            "DeviceUser": "1",
            "MeasurementType": "Weight",
            "BatteryPercentage": 58,
            "SignalStrengthPercentage": 94,
            "MeasuredAt": "2021-02-23T22:06:00.000Z",
            "Values": [
                {
                    "Value": 184.5,
                    "Type": "weight"
                }
            ],
            "PatientId": "patient_id1"
        },
  "signature": "abcd1234"
}
Key Type Value
event string The event that triggered this webhook. (For patient measurements, the event will be "DEVICE_MEASUREMENT".)
eventTime string The ISO timestamp for when the webhook was first sent.
data object The data related to the event.
data.Id string A unique ID for the measurement.
data.DeviceId string The serial number of the device.
data.DeviceImei string The IMEI of the device.
data.DeviceSim string The ICCID of the SIM profile currently being used by the device.
data.DeviceType string The type/brand of the device. Will be "PyloWt".
data.DeviceModel string The model number of the device.
data.DeviceUser string The user of the device for this measurement (will always be 1 for devices without switchable user profiles).
data.MeasurementType string Will be "Weight".
data.BatteryPercentage number The percentage of battery that remains on the device.
data.SignalStrengthPercentage number Signal strength of the device (if applicable), which ranges from 0 - 100
data.MeasuredAt string The ISO timestamp for when the measurement was recorded.
data.Values object[] The array of measurement type and value pairs for this measurement.
data.Values[0].Value number The value of this weight pressure reading in units lbs.
data.Values[0].Type string The type of this reading. Will be "weight".
data.PatientId string The patient ID provided by partner to Pylo to attach to this device (usually at the time of ordering). Optional.
signature string HMAC SHA-256 of the data field against the secret provided when the webhook was configured. Can be used to verify that the data came from us and was not altered en route.