SDK Integration
Use the Doctor App SDK and REST API to integrate appointment workflows, messaging, medical record access, and provider interactions.
Prerequisites
Confirm the following before starting integration:
- A registered partner or developer account
- Access to SDK credentials or API tokens
- A compatible development environment
- Installed platform-specific dependencies
[TBD: Add SDK name(s), version compatibility, API version, supported platforms]
Step 1: Install the SDK
Install the SDK using a package manager.
- npm
- Yarn
npm install @airdoctor/sdk
yarn add @airdoctor/sdk
[TBD: Confirm SDK package name and registry source]
Step 2: Set Up Authentication
Use authentication in both SDK and API methods.
SDK Initialization Example
import AirDoctorSDK from '@airdoctor/sdk';
const sdk = new AirDoctorSDK({
apiKey: '<your-api-key>',
token: '<access-token>',
environment: 'sandbox',
});
API Token Header
Authorization: Bearer <access-token>
Required Request Headers
Header | Value | Description |
---|---|---|
X-Device | Desktop | Mobile | Identify the client platform |
X-Camera | Granted | Denied | Query | Report camera permission |
X-Microphone | Granted | Denied | Query | Report microphone permission |
X-Location | Granted | Denied | Query | Report geolocation permission |
X-Token | <token> | Optional alternative to cookie-based auth |
Tokens may also be passed via the
session_token
cookie.
Step 3: Make Requests
Supported Methods
GET
: Return dataPOST
: Create new entitiesPATCH
: Update records or refresh state
Body format depends on method and data type.
Content Types
Method | Content Type | Notes |
---|---|---|
GET | None | Use query parameters only |
POST | application/x-www-form-urlencoded | multipart/form-data | Use multipart for files; default to urlencoded for metadata |
PATCH | application/x-www-form-urlencoded | Include update as a comma-separated list of update keys |
Send
photo
fields as booleans (present/absent) or integers (image count).
Step 4: Interpret API Responses
Common Status Codes and Headers
Status | Description | Headers |
---|---|---|
200 | Success with response body | X-Refresh , X-Update |
201 | New entity created | Location , plus 204 headers |
204 | Success with no content | X-Close , X-Refresh , X-Banner , X-Forward , X-Target |
302 | Redirect for permissions or flow changes | Location , X-Target |
401 | Unauthorized | — |
405 | Method not allowed | Returns a patch-style reply body |
X-Target
values includePage
,Popup
, or a custom frame.
Step 5: Test in the Sandbox Environment
Use sandbox endpoints to run integration tests.
Environment | SDK Base URL (TBD) | API Base URL (TBD) |
---|---|---|
Sandbox | https://sandbox-sdk.airdoctor.com | https://sandbox.api.airdoctor.com |
Production | https://sdk.airdoctor.com | https://api.airdoctor.com |