DocMeIn API Reference
● Introduction
DocMeIn API enables developers and integrators to build applications and application extensions
to interact with the DocMeIn platform. Although we make no assumptions about the nature of your
application and its use of the DocMeIn platform, the primary use cases targeted by the API are
as follows:
- scheduling of appointments by patients with their providers;
- management of patient data by patients and by their providers;
- management of appointments by providers.
With these use cases, we provide coverage for the vast majority of requests we received to date, including from vendors of PHR, EHR, EMR, PMS, e-Rx and various other packaged systems, Web and mobile applications. Our API is still a work in progress and we look forward to your feedback and suggestions.
● Protocol
● Authentication
DocMeIn API endpoints support authentication via HTTP’s basic authentication scheme as per RFC 2617. Users’ DocMeIn credentials are thus required in order to access the API. In the future, DocMeIn may support other authentication methods, which do not require the users’ DocMeIn credentials to be known by API clients. Authentication is required for all calls involving account access, but not for the calls exposing published provider data and designated scheduling availability.
● Messaging
DocMeIn API makes extensive use of HTTP protocol features, including various HTTP response codes and headers. API clients must be configured to auto-follow all redirects, correctly processing authentication challenges, media type ("application/json") selection, payload compression and caching-related headers.
● Formats
All DocMeIn requests and responses are based on the JSON encoding notation. Date values are represented as strings in YYYY-MM-DD format. Time values are represented in epoch form (seconds since 1/1/1970 midnight UTC). In addition, relevant timezone is often supplied alongside the time value.
● Error Reporting
DocMeIn API produces HTTP status codes consistent with the HTTP 1.1 specification. Specific response codes that the API client must be prepared to process are 200, 201, 204, 302, 401, 404, 405 and 500. The latter signals that an error occurred in processing an API request. Response body in this case contains an informational message to aid in the diagnostics of the error condition.
● Resources
● Patient
Example:
{
"id": "1234567890987654321",
"name": "Nicole Mary Kidman",
"email": "nickid@gmail.com",
"address": "65536 Santa Monica Blvd, Beverly Hills, CA 90035, USA",
"phones": [
{
"type": "mobile",
"number": "(650) 555-1212"
}
]
}
● Provider
Example:
{
"id": "1234567890987654321",
"name": "Dr. Sanjay Gupta",
"description": "Dr. Gupta is Bay Area’s #1 optometrist serving the community since 1976.",
"location": {
"address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA",
"lat": 37.4219720,
"lng": -122.0841430,
"phone": "(650) 555-1212",
"timezone": "America/Pacific", // Olson database key
},
"gender": "male",
"languages": ["English", "Hindi"],
"training": [
{
"school": "Southern California College of Optometry",
"concentrations": ["Optometry"],
"class_year": 1976
}
],
"accepting_new_patients": true,
"services":
[
{
"id": "123456",
"name": "Comprehensive Eye Exam",
"uri": "https://api.docmein.com/services/123456"
},
{
"id": "456789",
"name": "Contact Lens Check",
"uri": "https://api.docmein.com/services/456789"
}
],
"insurance_options": ["Aetna", "BCBS", "CIGNA", "VSP"],
"brands": ["Carrera", "Emporio Armani", "GUCCI", "Georgio Armani", "Juicy Couture", "Theory", "Valentino"],
"html": "http://www.docmein.com/app/page/13772936973016",
"schedule": "http://www.docmein.com/13772936973016/schedule",
"hours": "https://api.docmein.com/13772936973016/hours",
"availability": "https://api.docmein.com/13772936973016/availability",
"appointments": "https://api.docmein.com/appointments",
"patients": "https://api.docmein.com/patients"
}
● Appointment
Example:
{
"when": 1315249200, // epoch time
"duration": 1800000, // 30 minutes
"service": {
"id": "123456",
"name": "Contact Lens Check",
"uri": "https://api.docmein.com/services/123456"
},
"provider": {
"id": "1234567890987654321",
"name": "Dr. Sanjay Gupta",
"uri": "https://api.docmein.com/providers/1234567890987654321"
},
"patient": {
"id": "1234567890987654321",
"name": "Nicole Mary Kidman",
"uri": "https://api.docmein.com/patients/1234567890987654321"
},
"status": "created"
}
Valid values of appointment status are:
- "created"
- "confirmed"
- "requested"
- "accepted"
- "rejected"
- "canceled"
- "canceled-late"
- "noshow"
- "passed"
- "checked-in"
- "checked-out"
If omitted on input, appointment status defaults to "created".
● Service
Example:
{
"id": "123456",
"uri": "https://api.docmein.com/services/123456",
"name": "Contact Lens Check",
"duration": 1800000, // 30 minutes
"prePad": 600000, // 10 minutes
"postPad": 900000 // 20 minutes
}
● Schedule
The representation of the provider’s schedule, including the repeating pattern of days on and off
and the hours for the days on, as well as any exceptions to this repeating pattern.
Example:
{
"recurring": [
{
"date": "2014-04-01",
"hours": [
{
"from": "9:00AM",
"to": "1:00PM"
},
{
"from": "2:00PM",
"to": "6:00PM"
}
]
},
{
"date": "2014-04-02",
"hours": [
{
"from": "9:00AM",
"to": "1:00PM"
},
{
"from": "2:00PM",
"to": "6:00PM"
}
]
},
{...},{...},{...},{...},{...}
],
"nonrecurring": [
{
"date": "2014-04-01",
"hours": []
},
{
"date": "2015-04-01",
"hours": [
{
"from": "1:00PM",
"to": "4:00PM"
},
{
"from": "4:30PM",
"to": "7:00PM"
}
]
}
]
}
The entity contains two major properties: recurring and nonrecurring. Each of them contains a date property and an hours array, specifying the provider's scheduled time for "date" as ordered time intervals.
The intervals under recurring repeat every recurring.length() number of days. The schedule on
recurring[i]+recurring.length()*n, where n is an arbitrary natural number, is therefore the same
as it is on recurring[i]. In current API version, recurring.length() other than 7 is considered
an error on input, but API clients should be prepared to accept any value of recurring.length().
All date properties in the recurring block appear in sequential order and constitute consecutive
days.
The intervals under nonrecurring represent exceptions from the regular schedule. There may be an
arbitrary number of such exceptions, including deviations from regular posted hours, no hours at
all on a day would otherwise have hours scheduled or vice versa.
The format of hours is an array, designating consecutive time bounds via each of its element's
from and to properties. They specify the start and the end time of the scheduled time interval
in the provider's time zone. The precision and appropriate bounds at which time may be
specified depends on account settings. The time designated by these from-to ranges can never
overlap; all time that falls outside the from-to ranges is considered unavailable for
appointment scheduling. If no hours are scheduled on a particular date, the hours array for the
corresponding date is empty.
● Hours
JSON array of daily working hours for a provider. Each array element is as follows:
{
"date": "2013-04-29",
"from": "9:00AM",
"to": "6:00PM"
}
● Availability
JSON array of dates for which the provider has real-time scheduling availability. Each array element is as follows:
{
"date": "2011-10-12"
"inventory": "https://api.docmein.com/providers/1234567890987654321/inventory?date=2011-10-12"
}
● Inventory
JSON array of time values representing available appointment starting times.
● Operations
● Provider
Multi-Provider Self Discovery
Request syntax
Response
JSON array of Provider objects accessible to the user corresponding to the supplied
credentials. Note that the Provider objects returned in the response document contain
DocMeIn API endpoints. All other API endpoints (except the discovery endpoint) given in this
document are examples only.
Note that the request to this non-SSL URL will be redirected to an SSL URL, which will allow
credentials to be transferred over a secure channel.
Single-Provider Self Discovery
Request syntax
Response
A single Provider object corresponding to the supplied user credentials. The user must be
associated with a particular provider, i.e., must be of Provider role. Note that the
Provider object returned in the response document contains DocMeIn API endpoints. All other
API endpoints (except the discovery endpoint) given in this document are examples only.
Note that the request to this non-SSL URL will be redirected to an SSL URL, which will allow
credentials to be transferred over a secure channel.
Add Provider
Request syntax
Request parameters
None
Request body
Provider properties, excluding the read-only properties:
- id
- location
- html
- schedule
- hours
- availability
- appointments
- patients
Response headers
Upon success, Content-Location will specify the URL of the new provider.
Response body
None
Update Provider
Request syntax
Request parameters
None
Request body
Provider properties that need to be updated, excluding the read-only properties:
- id
- location
- html
- schedule
- hours
- availability
- appointments
- patients
- Response headers
Request headers
None
Response body
None
Remove Provider
Request syntax
Request parameters
None
Response body
None
Response headers
None
Retrieve Provider’s Schedule
Request syntax
GET https://api.docmein.com/providers/<provider-id>/schedule
Request parameters
The parameter fromDate (optional) specifies the date of the first day of schedule in the response document. If omitted, fromDate defaults to the first day of the current week.
Response
Schedule document, including 7 days of the recurring schedule beginning with fromDate and all of the non-recurring days from fromDate onwards into the future indefinitely.
Update Provider’s Schedule
Request syntax
POST https://api.docmein.com/providers/<provider-id>/schedule
Request parameters
None
Request body
Schedule:
- recurring (optional):
- if present, must be composed of exactly 7 consecutive dates and the date of the first day must be the date of the request or an earlier date;
- if absent, the regular schedule will remain as is and not be updated;
- nonrecurring (optional):
- if pesent, all dates for which alternate time intervals are scheduled must be included (i.e., they are not additive to existing data);
- if present, the dates must all be the date of the request or later;
- if absent, the exceptions to the regular schedule will remain as is and not be updated.
Response
none
● Services
Retrieve Practice Services
Request syntax
Response body
JSON array of available service objects.
Retrieve Service Details
Request syntax
Response body
Service with one of two possible levels of detail, depending on whether the request was authenticated or not. If authenticated, all details are included in the response. Otherwise the prePad and the postPad values are omitted and instead added to duration, representing the information relevant to a patient rather than a practice user (who would be making an authenticated request).
Create Service
Request syntax
Request body
Service without the id and uri properties.
Response headers
Upon success, Content-Location will contain the uri property of the newly created service.
Response body
None.
Update Service
Request syntax
Request body
Service without just the properties that need to be updated. Including the id or the uri property will produce an error.
Response body
None
Delete Service
Request syntax
Request body
None.
Response body
None.
● Appointments
Retrieve Appointments
Request syntax
GET https://api.docmein.com/providers/<provider-id>/appointments
Request query parameters
- since: update date of the earliest appointment to be returned (optional, cannot be combined with skip)
- skip: number of most recent appointments to be skipped in the response (defaults to 0, cannot be combined with since)
- max: max number of appointments in the response (defaults to the limit of 50)
Response
JSON array of appointment objects sorted by update date in inverse chronological order.
Add Appointment
Request syntax
POST https://api.docmein.com/providers/<provider-id>/appointments
Request parameters
None
Request body
Appointment
Response headers
Upon success, Content-Location will specify the URL of the appointment created.
Response body
Appointment
Update Appointment
Request parameters
None
Request body
Appointment
Response headers
None
Response body
Appointment
● Patients
Retrieve Patients
Request syntax
Request Parameters
- since: the earliest update date of the patient to be returned (optional, cannot be combined with skip)
- skip: number of most recently updated patients to be skipped in the response (defaults to 0, cannot be combined with since)
- max: max number of patients in the response (defaults to the limit of 50)
Response
Array of patient objects sorted by update date in inverse chronological order.
Add Patient
Request syntax
Request Parameters
None
Request body
Patient
Response headers
Upon success, Content-Location will specify the URL of the patient created.
Response body
None
Update Patient
Request syntax
Request Parameters
None
Request body
Patient
Response headers
None
Response body
None
● Patient Self-Scheduling
Obtain Schedule
Request syntax
Request Parameters
- fromDate: the earliest date for which schedulable hours are to be provided (defaults to today’s date in provider’s timezone)
- numDays: the number of days immediately following fromDate for which schedulable hours are to be provided (defaults to 30)
Request body
None
Response headers
None
Response body
Hours
Find Available Days
Request syntax
GET https://api.docmein.com/providers/<provider-id>/availability
Request Parameters
- isNewPatient: indicates whether the patient has been seen by practice previously (defaults to false)
- fromDate: the earliest date for which availability is to be provided (defaults to today’s date in provider’s timezone)
- numDays: the number of days immediately following fromDate for which availability is to be provided (defaults to 30)
- service: ID of the service for which availability is to be provided (optional)
- Request body
Request body
None
Response headers
None
Response body
Availability
Find Available Appointments
Request syntax
GET https://api.docmein.com/providers//<provider-id>/inventory
Request Parameters
- date: date for which inventory is to be provided (required)
- service: ID of the service for which inventory is to be provided (optional)
Request body
None
Response headers
None
Response body
Inventory