Creating export of the raw data
In this tutorial we will show you how to create and export file with raw data.
Prerequisites
- Research token (how to get it here)
- UUID of the patient you need the data from
Create export request
POST to:
https://api.integration.corsano.com/v1/create-export/{UUID}/{data_type}?token=XYZ
Note: Export requests via this endpoint are limited to 1 per user (UUID) every 5 minutes (If you want to increase the limit for each UUID, please contact devsupport@corsano.com).
Supported data types
activity
rr-interval
sleep
temperature
heart-rate-variability
ppg1
ppg2
bioz
acc
ecg
tests
Example request
curl --request POST \
--url 'https://api.integration.corsano.com/v1/create-export/50907d67-1575-4599-8693-80b14e68b57b?token=xyz' \
--header 'Content-Type: application/json' \
--data '{
"client_date_from": "2023-06-05T00:00:00.000",
"client_date_to": "2023-06-05T10:00:00.000",
"types": ["activity", "sleep", "ppg1"]
}'
Example response:
{
"id": "647d976a8f95762a8768d725",
"status": "in_progress"
}
Check export status
Poll the export status until status becomes done.
GET:
https://api.integration.corsano.com/v1/export/{EXPORT_ID}?token=XYZ
Example status request
curl --request GET \
--url 'https://api.integration.corsano.com/v1/export/647d9d648b5f5472ed5d8727?token=XYZ' \
Example response:
{
"status": "done",
"id": "647d9ef0eaf06f6e1a2d86b2",
"downloadUrl": "https://cloudconnect-uploads-prod.s3.eu-central-1.amazonaws.com/raw-metrics-export/647d9ef0eaf06f6e1a2d86b2.zip?response-content-disposition=attachment%3B%20filename%3D%22647d9ef0eaf06f6e1a2d86b2.zip%22&response-content-type=application%2Fzip&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA2NPJAASWBOJHKNZP%2F20230605%2Feu-central-1%2Fs3%2Faws4_request&X-Amz-Date=20230605T084728Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=92448788b769e3b1dd2be1a22132cffb00d44017acc7017523c31a7e17384fe0"
}
The value of "downloadUrl" is the URL of the ZIP archive you can download.
Export AFib data
To export AFib detection data for a user, send a POST request to the AFib export endpoint with the user UUID and your research token. Provide a millisecond timestamp range to bound the results.
curl --location 'https://api.study-integration.corsano.com/v1/create-afib-export/{UUID}?token=XYZ' \
--header 'Content-Type: application/json' \
--data '{
"timestamp_from": 1728656624881,
"timestamp_to": 1728697024881
}'
Example response:
[
{
"_id": "6709383d3fec34e78f1ba720",
"timestamp": 1728657280799,
"user_id": "6009410dc24dd44bf585c0b9",
"af_detected": null,
"af_timestamp": null,
"afb_probability": 0.25664883627743446,
"avnn": null,
"classification": "NSR",
"client_date": "2024-10-11T16:34:40",
"created_at": "2024-10-11 14:37:49",
"final_probability": 0.7433511637225656,
"good_ibi_number": null,
"good_quality_probability": 0.446809321641922,
"has_image_file": false,
"heart_rate": null,
"hta": null,
"hta_q": null,
"lf": null,
"lf_confidence": null,
"nsr_probability": null,
"pnn50": null,
"rmssd": null,
"sdnn": null,
"updated_at": "2024-10-11 14:37:49"
}
]