Skip to main content

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 install @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

HeaderValueDescription
X-DeviceDesktop | MobileIdentify the client platform
X-CameraGranted | Denied | QueryReport camera permission
X-MicrophoneGranted | Denied | QueryReport microphone permission
X-LocationGranted | Denied | QueryReport 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 data
  • POST: Create new entities
  • PATCH: Update records or refresh state

Body format depends on method and data type.

Content Types

MethodContent TypeNotes
GETNoneUse query parameters only
POSTapplication/x-www-form-urlencoded | multipart/form-dataUse multipart for files; default to urlencoded for metadata
PATCHapplication/x-www-form-urlencodedInclude 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

StatusDescriptionHeaders
200Success with response bodyX-Refresh, X-Update
201New entity createdLocation, plus 204 headers
204Success with no contentX-Close, X-Refresh, X-Banner, X-Forward, X-Target
302Redirect for permissions or flow changesLocation, X-Target
401Unauthorized
405Method not allowedReturns a patch-style reply body

X-Target values include Page, Popup, or a custom frame.


Step 5: Test in the Sandbox Environment

Use sandbox endpoints to run integration tests.

EnvironmentSDK Base URL (TBD)API Base URL (TBD)
Sandboxhttps://sandbox-sdk.airdoctor.comhttps://sandbox.api.airdoctor.com
Productionhttps://sdk.airdoctor.comhttps://api.airdoctor.com