The V1 stream API is now longer supported aside from the /v1/session
endpoint (see below).
Throughout this document, the following terminology is used:
A client is associated with exactly one patient. Patients may have multiple clients, depending on how many apps are sending or accessing data. Patients and clients are resources in the Rune platform with unique identifiers, and they are used to control access to patient data.
Authentication is required for all API requests. There are several authentication methods:
Both the access tokens and the client keys are comprised of two parts: a key ID and an access key. These are analagous to a username and password. Usage is described in detail below.
Access tokens provide read access to all the patients in your organization. This is the recommended authentication method for the Stream API.
To use an access token for authentication, the HTTP request must include two headers:
X-Rune-User-Access-Token-Id
- access token IDX-Rune-User-Access-Token-Secret
- access token secretIt is highly recommended that you "rotate" user access tokens every 3-6 months, by creating a new token and deactivating the old one. Store your access tokens securely, and do not share them.
Client keys provide read and write access to one patient.
To use a client key pair for authentication, the HTTP request must include two headers:
X-Rune-Client-Key-Id
- client key IDX-Rune-Client-Access-Key
- client access key (secret)Note that each client may only fetch data for its associated patient.
You can create any number of client keys for a given client, through the Rune web app. If you forget a key, you can always create a new key pair and disable the old.
It is highly recommended that you "rotate" keys for a patient every 3-6 months, by creating a new client key, configuring it in the client (e.g. the patient's app), then disabling the old key. You should do this immediately if you believe the key may have been compromised (e.g. stolen from the device, posted over any insecure/public communication channel, etc).
Fetch raw data that was uploaded to the Rune Platform.
To use this endpoint, you will need a dataset ID, which is generated by the Rune Data API on upload. Rune’s GraphQL API can be used to find dataset IDs for a given patient.
A dataset may be composed of several streams (files). Each request to this endpoint returns one stream: you may need to make multiple requests to download an entire dataset.
Note that unlike other Stream API endpoints, this endpoint returns the raw binary of the original data. It does not have a standard JSON or CSV structure.
The typical use for this endpoint is download a raw dataset into local storage. This is not the optimal way to download entire archives. If for any reason you need to export all data for all your patients, please contact support@runelabs.io, and our team will provide you with a copy of the raw data in a more efficient way.
session_id required | string Example: session_id=dataset-37a2a3dc70c825d9ed1dc5bfcc3137b7c63c84f42c89b075975fb99bfb81c105 The dataset ID to download. Confusingly, this is NOT the |
stream_name required | string Example: stream_name=metadata The name of the specific stream to download from the dataset. Stream names vary, according to the schema of the dataset. |
{- "success": false,
- "error": {
- "message": "string",
- "type": "string"
}, - "result": null
}