Implementation
The ROOK Extraction App streamlines the integration of ROOK SDKs by providing a ready-to-use mobile application for health data extraction. This guide explains the steps needed to bind users to the app, connect them to data sources, and start receiving health data via webhooks.
Prerequisites
Generate Credentials
Obtain yourclient_uuid
andsecret_key
from the ROOK Portal. Follow the QuickStart Guide to set up your credentials and register your Data Webhook.Prepare Your Backend
Set up an endpoint capable of receiving health data delivered by ROOK via the Data Webhook.
User Binding: Generating Links and QR Codes
User binding links the ROOK Extraction App to a specific client configuration. This process is initiated using QR codes or universal links generated via the ROOK API.
Binding Overview
The user binding process initializes the app with the client-specific settings such as terms and conditions, support links, and user identification. The generated QR code or universal link ensures a secure connection between the app and the client system.
API Endpoint
- Sandbox:
https://api.rook-connect.dev/api/v1/extraction_app/binding/
- Production:
https://api.rook-connect.com/api/v1/extraction_app/binding/
Required Headers
Authorization: Basic {client_uuid}:{secret_key}
Content-Type: application/json
Request Body
{
"user_id": "unique-user-identifier",
"metadata": {
"client_name": "Your Organization Name",
"tyc_url": "https://example.com/terms",
"support_url": "https://example.com/support",
"complete_log_out": false
},
"salt": "unique-security-string"
}
- user_id: A unique identifier for the user. Learn more about user_id.
- metadata.client_name: The name of the client organization.
- metadata.tyc_url: (Optional) A URL for terms and conditions.
- metadata.support_url: (Optional) A URL for support.
- metadata.complete_log_out: (Optional) Boolean determining whether logging out disconnects all linked data sources.
- salt: A unique string used for encryption.
Example Request
curl --location 'https://api.rook-connect.dev/api/v1/extraction_app/binding/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YOUR_CLIENT_UUID:YOUR_SECRET_KEY' \
--data '{
"user_id": "user123",
"metadata": {
"client_name": "Your Company",
"tyc_url": "https://example.com/terms",
"support_url": "https://example.com/support",
"complete_log_out": false
},
"salt": "uniqueSalt123"
}'
API Response
{
"qr_code": "data:image/png;base64,BASE64_ENCODED_IMAGE",
"universal_link": "https://extraction-app-user-bind.rook-connect.com/binding/unique-id?auth=1234&token=456"
}
- qr_code: A Base64-encoded QR code image.
- universal_link: A URL for initializing the app.
How To Use the ROOK Extraction App
1. Bind Users
- Share the QR code or universal link generated using the API with the user.
- Users scan the QR code or click the universal link to initialize the app.
- The app is automatically configured with client metadata such as terms, conditions, and support links.
2. Connect to Data Sources
After binding, users connect to health data sources via the app’s Connections View:
- API-Based Sources: Users complete OAuth flows for platforms such as Fitbit and Garmin.
- Mobile-Based Sources: Users grant permissions for Apple Health or Health Connect.
3. View ROOKScore
The app calculates and displays a ROOKScore, a health score derived from extracted data. Scores are displayed by day, offering actionable insights into user health metrics.
4. Manage Account
The app allows users to log out, unlink accounts, or switch profiles. Logging out disconnects the user from the client
system but does not automatically unlink connected data sources unless complete_log_out
is enabled.
Security Details
Salt and Encryption
Thesalt
ensures secure encryption and decryption. It is not stored by ROOK. The app decrypts data on the user's mobile device, ensuring end-to-end security.QR Code Functionality
The QR code does not contain sensitive information. It serves as a reference to the binding configuration.Environment-Specific Binding
Devices can only bind to one environment at a time (sandbox or production).
Receiving Health Data
Real-Time Delivery
Data is sent to the client’s registered Data Webhook as events or summaries. Refer to Data Delivery for details.Compatibility
The app inherits all capabilities and limitations of the ROOK SDKs for mobile-based sources.
Next Steps
- Test the binding process and webhook delivery in the sandbox environment.
- Ensure users are educated on connecting to desired data sources via the app.
- Switch to production URLs after successful testing.
- Explore additional resources: