description |
---|
All about BetterPT's GraphQL API |
BHC's next-generation API is built on top of GraphQL. It is fast, type-safe, self-documenting, and flexible. We love GraphQL. 💟
However, we realize that not everyone has used GraphQL. The learning curve on the client-side is quite gentle. Here are a few resources to get started:
Recommended Clients
You can access the schema via the "Public" Playground after you have logged into your account.There you can see the schema with relevant information, you can test queries and mutations, etc.
{% hint style="info" %} The best place to get started with BetterPT's API is to make some test queries and mutations in the GraphQL Playground. This also acts as the most up-to-date documentation. Operations are clearly labeled and all types are visible. {% endhint %}
You will need a developer account to access the playground.
Visit https://playground.betterpt.dev/ and you will see the following:
You will need to use the email and password provided to you by us.
Once you login you should see the following page:\
Because we are only interested in video rooms, the operations that matter to us are:
createPartnerVideoRoom(...): PartnerVideoRoom
Here is an example mutation:
mutation createPartnerVideoRoom($input: CreatePartnerVideoRoomInput){
createPartnerVideoRoom(input: $input){
uid
startTime
timeZone
displayName
patientLink
providerLink
patientDuration
providerDuration
didPatientAttend
didProviderAttend
status
}
}
2. partnerVideoRoom(uid: String!): PartnerVideoRoom
Here is an example query:
query partnerVideoRoom($uid: ID!){
partnerVideoRoom(uid: $uid){
uid
startTime
timeZone
displayName
partnerCustomerId
partnerProviderEmail
partnerPatientEmail
patientLink
providerLink
patientDuration
providerDuration
didPatientAttend
didProviderAttend
status
}
}
3. cancelPartnerVideoRoom(uid: ID!): PartnerVideoRoom
Here is an example mutation:
mutation cancelPartnerVideoRoom($uid: ID!) {
cancelPartnerVideoRoom(uid: $uid) {
uid
...
}
}
4. reschedulePartnerVideoRoom(input: ReschedulePartnerVideoRoomInput!): PartnerVideoRoom
Here is an example mutation:
mutation reschedulePartnerVideoRoom($input: ReschedulePartnerVideoRoomInput!) {
reschedulePartnerVideoRoom(input: $input) {
uid
startTime
...
}
}
How do we use this data in the real world? The response provides the following:
- Two links that are clearly marked as for the provider or for the patient.
- The time zone.
- The "display name" of the PT - is displayed in the video interface.
- The
uid
. - Two links that are clearly marked as for the provider or for the patient.
- The time zone.
- The "display name" of the PT - is displayed in the video interface.
- The
uid
.
In order to start a session:
- The patient opens the patient link, the provider opens the provider link.
The session is open for 60 minutes and users can enter five minutes before the start time. Once a session has started, it cannot be updated.
{% hint style="warning" %} This is not part of the standard API offering - if you are interested please contact [email protected] {% endhint %}
If BetterPT is provided with partnerClinicName
and partnerPatientEmail
and/or partnerPatientPhoneNumber
, we can handle communication of status changes and reminders for our hosted Video Rooms.
Communication Schedule & Methods - Patient Email Provided
- Initial Confirmation - Email sent with iCal attachment
- Reschedule - Email sent with iCal attachment
- Cancellation - Email
- One hour reminder - Email
- Fifteen-minute reminder - Email
Communication Schedule & Methods - Phone Number Provided
- Initial Confirmation - SMS
- Reschedule - SMS
- Cancellation - SMS
- One hour reminder - SMS
- Fifteen-minute reminder - SMS
Communication Schedule & Methods - Patient Email & Phone Provided
- Initial Confirmation - Email sent with iCal attachment
- Reschedule - Email sent with iCal attachment / SMS sent
- Cancellation - Email
- One hour reminder - Email / SMS sent
- Fifteen-minute reminder - Email / SMS sent
By performing the partnerVideoRoom
query, you can retrieve a PartnerVideoRoom.
type PartnerVideoRoom {
uid: ID!
startTime: DateTime!
timeZone: String!
patientLink: String!
providerLink: String!
displayName: String
partnerCustomerId: String
patientDuration: Int
providerDuration: Int
didPatientAttend: Boolean
didProviderAttend: Boolean
status: PartnerVideoRoomStatusEnum
}
With this data, you can produce a simple report on Telehealth call duration, status, etc.