Webhooks
Webhooks allow you to receive notifications on events that occur within the MD Live system. When an event is triggered, we will send an HTTP POST request to your webhook url with an Event object.
Events
Section titled “Events”The event object sent to your configured webhook url will correspond to the type of object that triggers the event. For example, when a provider sends a message to a patient, the message:provider:created action gets triggered and a message data object will be supplied in the body of the webhook request.
Actions
Section titled “Actions”Currently, we support the following actions:
| Action | Description |
|---|---|
message:provider:created |
Any time a provider sends a patient a message. |
consultation:provider:accepted |
Any time the first available provider accepts the patients consultation from the waiting room. |
consultation:provider:ready |
When the provider is ready to connect with the patient for the video consultation. |
prescription:pharmacy:accepted |
Any time a pharmacy receives a prescription for a patient. |
consultation:provider:requested |
Any time a provider requests an appointment for a patient. |
consultation:status:changed |
Any time a patient consultation changes statuses. |
Example Events
Section titled “Example Events”message:provider:created
Section titled “message:provider:created”The message:provider:created action will send an event object structured like this:
{ "event": { "token": "random-uuid", "action": "message:provider:created", "data": { "message": { "id": 105, "date_time": "2018-01-23T02:33:13+00:00", "from_id": 3, "to_id": 4, "unread_status": true, "replied_to_message_id": 104 } } }}To get more details for the message, use messages - retrieve a conversation.
consultation:provider:accepted
Section titled “consultation:provider:accepted”The consultation:provider:accepted action will send an event object structured like this:
{ "event": { "token": "random-uuid", "action": "consultation:provider:accepted", "data": { "appointment": { "id": 43, "patient_id": 3, "provider_id": 4, "start_date": "Wednesday, Aug 07 2019 at 03:00PM EDT", "start_date_rfc3339": "2019-08-07T15:00:00-04:00", "appointment_by": "video", "status": "pending" } } }}To get more details for appointment, use appointments - list upcoming.
consultation:provider:ready
Section titled “consultation:provider:ready”The consultation:provider:ready action will send an event object structured like this:
{ "event": { "token": "random-uuid", "action": "consultation:provider:ready", "data": { "appointment": { "id": 43, "patient_id": 3, "provider_id": 4, "start_date": "Wednesday, Aug 07 2019 at 03:00PM EDT", "start_date_rfc3339": "2019-08-07T15:00:00-04:00", "appointment_by": "video", "status": "in_progress" } } }}To get more details for appointment, use appointments - list upcoming.
prescription:pharmacy:accepted
Section titled “prescription:pharmacy:accepted”The prescription:pharmacy:accepted action will send an event object structured like this:
{ "event": { "token": "random-uuid", "action": "prescription:pharmacy:accepted", "data": { "prescription": { "id": 1, "patient_id": 3, "provider_id": 4, "appointment_id": 43 } } }}To get more details for the prescription, use prescriptions.
consultation:provider:requested
Section titled “consultation:provider:requested”The consultation:provider:requested action will send an event object structured like this:
{ "event": { "token": "random-uuid", "action": "consultation:provider:requested", "data": { "availability": { "id": 43, "patient_id": 3, "provider_id": 4, "start_date": "2018-11-15T15:43:45+00:00" } } }}consultation:status:changed
Section titled “consultation:status:changed”The consultation:status:changed action will send an event object structured like this:
{ "event": { "token": "random-uuid", "action": "consultation:status:changed", "data": { "appointment": { "id": 43, "patient_id": 3, "provider_id": 4, "start_date": "Wednesday, Aug 07 2019 at 03:00PM EDT", "start_date_rfc3339": "2019-08-07T15:00:00-04:00", "appointment_by": "video", "status": "completed" } } }}