This guide will walk you through integrating and using webhooks with Getlabs to receive real-time updates and notifications about events in your account.
Getlabs uses webhooks to notify you when an event happens in your account. Webhooks are useful for events like when an appointment is created for a patient or when a patient's appointment status is updated.
In order for Getlabs to communicate with your application you'll need to create an endpoint for our webhook service to communicate with.
Setting up a web application is outside the scope of this document but here are some important details on the specifics of the endpoint that we require from your endpoint:
Once you have an endpoint setup and configured on your server you can register that endpoint with us to start receiving events. Simply navigate to our Webhooks settings section to add an endpoint and register your webhook.
Once you've registered a webhook with us make sure you take note of the
Signing Secret. This secret is used to verify that the request to your
endpoint is, in fact, coming from us. More about how to
verify webhook signatures can be found here.
Events can be initiated/triggered in this Portal by you (the partner) or elsewhere by us in the Getlabs system. For example if a patient contacts us to book an appointment under your partner account an event would be sent out. Below are a list of webhook events that we currently have configured.
The following events correspond to lifecycle events with the appointment:
Appointment Status Events are shortcuts to the appointment.update Appointment Event. If you only want to be notified of an appointment update when the status changes these events below can help:
An Appointment Request is a placeholder for a Getlabs Appointment. The details of the Appointment are obtained and we ask the Patient to select the time/day for us to visit them. Once an Appointment Request is Scheduled a Getlabs Appointment is officially Created.
Appointment Request Status Events are specific to status updates on the appointment request.
Below is an example of what you can expect when receiving a payload:
{
"id": "62168584-d449-47d5-bdce-9928c831081f",
"eventType": "appointment.cancelled",
"created": "2023-10-13T13:53:38.316Z",
"data": {},
"ref": "https://portal.getlabs.com/appointments/1f5f60de-7617-4d3c-b323-08e15f4145fe"
}
Payload Explained:
id: The auditing identifier from our system.
eventType: The audited event.
created: Timestamp of when the event happened.
data: The event payload data. ie: the appointment details.
ref: A link to the affected record via portal.getlabs.com
To ensure the security and authenticity of webhook events, Getlabs uses a security feature called "Getlabs-Security." The Getlabs-Security is an HTTP header that is sent along with each webhook event, and it includes an HMAC-SHA256 (hex encoded) signature of the webhook payload. This signature is based on your Getlabs webhook signing secret, which is a unique key provided by Getlabs on each webhook that you register.
Here's how the Getlabs-Security security header works:
Your webhook must return a 200-ish (200-299) level http response code in a timely manner - under 30 seconds. Failure to do so will result in our system rejecting the webhook, thus initiating a retry.
When we receive a NON 200-ish response your webhook message will be retried at a later time. Getlabs Webhooks will retry again after a minimum backoff period of 100 seconds, exponentially increasing up to 600 seconds. Getlabs will retry failed messages for up to 24 hours.
If the message still cannot be delivered after the maximum number of retries, Getlabs Webhooks may consider the message as undeliverable.
Our data payloads mirror our API responses, minus any PHI - for security reasons. Please see details from our API Documentation website .