curl --request POST \
--url https://{partner_host}/registered_url_for_status_change_events \
--header 'Content-Type: application/json' \
--data '
{
"business_id": "77133577914507",
"client_id": "",
"event": "appointment.statuschange",
"event_time": 1749544752,
"timestamp": 1730189586,
"data": {
"appointment_id": "api-53423-GH_228766880001",
"clinic_id": "678f4fcd4ce758001d3624ee",
"created_at": 1749532041,
"doctor_id": "173744358327115",
"modified_at": 1749544752,
"patient_id": "173986493567406",
"status": "CM",
"custom_attributes": {
"label": [
"vitals_submitted"
],
"tags": [
"paid",
"in_consult"
]
},
"partner_appointment_id": "GH_228766880001",
"partner_clinic_id": "CL04",
"partner_doctor_id": "sheilly",
"partner_meta": {
"appointment_id": "api-abb67007-1e53-4f0f-b428-a4bc025468a4",
"encounter_id": "228766880001",
"facility_id": "GH"
},
"partner_patient_id": "MM01156831"
},
"service": "appointment",
"transaction_id": "api-53423-GH_228766880001"
}
'import requests
url = "https://{partner_host}/registered_url_for_status_change_events"
payload = {
"business_id": "77133577914507",
"client_id": "",
"event": "appointment.statuschange",
"event_time": 1749544752,
"timestamp": 1730189586,
"data": {
"appointment_id": "api-53423-GH_228766880001",
"clinic_id": "678f4fcd4ce758001d3624ee",
"created_at": 1749532041,
"doctor_id": "173744358327115",
"modified_at": 1749544752,
"patient_id": "173986493567406",
"status": "CM",
"custom_attributes": {
"label": ["vitals_submitted"],
"tags": ["paid", "in_consult"]
},
"partner_appointment_id": "GH_228766880001",
"partner_clinic_id": "CL04",
"partner_doctor_id": "sheilly",
"partner_meta": {
"appointment_id": "api-abb67007-1e53-4f0f-b428-a4bc025468a4",
"encounter_id": "228766880001",
"facility_id": "GH"
},
"partner_patient_id": "MM01156831"
},
"service": "appointment",
"transaction_id": "api-53423-GH_228766880001"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
business_id: '77133577914507',
client_id: '',
event: 'appointment.statuschange',
event_time: 1749544752,
timestamp: 1730189586,
data: {
appointment_id: 'api-53423-GH_228766880001',
clinic_id: '678f4fcd4ce758001d3624ee',
created_at: 1749532041,
doctor_id: '173744358327115',
modified_at: 1749544752,
patient_id: '173986493567406',
status: 'CM',
custom_attributes: {label: ['vitals_submitted'], tags: ['paid', 'in_consult']},
partner_appointment_id: 'GH_228766880001',
partner_clinic_id: 'CL04',
partner_doctor_id: 'sheilly',
partner_meta: {
appointment_id: 'api-abb67007-1e53-4f0f-b428-a4bc025468a4',
encounter_id: '228766880001',
facility_id: 'GH'
},
partner_patient_id: 'MM01156831'
},
service: 'appointment',
transaction_id: 'api-53423-GH_228766880001'
})
};
fetch('https://{partner_host}/registered_url_for_status_change_events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{partner_host}/registered_url_for_status_change_events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'business_id' => '77133577914507',
'client_id' => '',
'event' => 'appointment.statuschange',
'event_time' => 1749544752,
'timestamp' => 1730189586,
'data' => [
'appointment_id' => 'api-53423-GH_228766880001',
'clinic_id' => '678f4fcd4ce758001d3624ee',
'created_at' => 1749532041,
'doctor_id' => '173744358327115',
'modified_at' => 1749544752,
'patient_id' => '173986493567406',
'status' => 'CM',
'custom_attributes' => [
'label' => [
'vitals_submitted'
],
'tags' => [
'paid',
'in_consult'
]
],
'partner_appointment_id' => 'GH_228766880001',
'partner_clinic_id' => 'CL04',
'partner_doctor_id' => 'sheilly',
'partner_meta' => [
'appointment_id' => 'api-abb67007-1e53-4f0f-b428-a4bc025468a4',
'encounter_id' => '228766880001',
'facility_id' => 'GH'
],
'partner_patient_id' => 'MM01156831'
],
'service' => 'appointment',
'transaction_id' => 'api-53423-GH_228766880001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{partner_host}/registered_url_for_status_change_events"
payload := strings.NewReader("{\n \"business_id\": \"77133577914507\",\n \"client_id\": \"\",\n \"event\": \"appointment.statuschange\",\n \"event_time\": 1749544752,\n \"timestamp\": 1730189586,\n \"data\": {\n \"appointment_id\": \"api-53423-GH_228766880001\",\n \"clinic_id\": \"678f4fcd4ce758001d3624ee\",\n \"created_at\": 1749532041,\n \"doctor_id\": \"173744358327115\",\n \"modified_at\": 1749544752,\n \"patient_id\": \"173986493567406\",\n \"status\": \"CM\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"partner_appointment_id\": \"GH_228766880001\",\n \"partner_clinic_id\": \"CL04\",\n \"partner_doctor_id\": \"sheilly\",\n \"partner_meta\": {\n \"appointment_id\": \"api-abb67007-1e53-4f0f-b428-a4bc025468a4\",\n \"encounter_id\": \"228766880001\",\n \"facility_id\": \"GH\"\n },\n \"partner_patient_id\": \"MM01156831\"\n },\n \"service\": \"appointment\",\n \"transaction_id\": \"api-53423-GH_228766880001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{partner_host}/registered_url_for_status_change_events")
.header("Content-Type", "application/json")
.body("{\n \"business_id\": \"77133577914507\",\n \"client_id\": \"\",\n \"event\": \"appointment.statuschange\",\n \"event_time\": 1749544752,\n \"timestamp\": 1730189586,\n \"data\": {\n \"appointment_id\": \"api-53423-GH_228766880001\",\n \"clinic_id\": \"678f4fcd4ce758001d3624ee\",\n \"created_at\": 1749532041,\n \"doctor_id\": \"173744358327115\",\n \"modified_at\": 1749544752,\n \"patient_id\": \"173986493567406\",\n \"status\": \"CM\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"partner_appointment_id\": \"GH_228766880001\",\n \"partner_clinic_id\": \"CL04\",\n \"partner_doctor_id\": \"sheilly\",\n \"partner_meta\": {\n \"appointment_id\": \"api-abb67007-1e53-4f0f-b428-a4bc025468a4\",\n \"encounter_id\": \"228766880001\",\n \"facility_id\": \"GH\"\n },\n \"partner_patient_id\": \"MM01156831\"\n },\n \"service\": \"appointment\",\n \"transaction_id\": \"api-53423-GH_228766880001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{partner_host}/registered_url_for_status_change_events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_id\": \"77133577914507\",\n \"client_id\": \"\",\n \"event\": \"appointment.statuschange\",\n \"event_time\": 1749544752,\n \"timestamp\": 1730189586,\n \"data\": {\n \"appointment_id\": \"api-53423-GH_228766880001\",\n \"clinic_id\": \"678f4fcd4ce758001d3624ee\",\n \"created_at\": 1749532041,\n \"doctor_id\": \"173744358327115\",\n \"modified_at\": 1749544752,\n \"patient_id\": \"173986493567406\",\n \"status\": \"CM\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"partner_appointment_id\": \"GH_228766880001\",\n \"partner_clinic_id\": \"CL04\",\n \"partner_doctor_id\": \"sheilly\",\n \"partner_meta\": {\n \"appointment_id\": \"api-abb67007-1e53-4f0f-b428-a4bc025468a4\",\n \"encounter_id\": \"228766880001\",\n \"facility_id\": \"GH\"\n },\n \"partner_patient_id\": \"MM01156831\"\n },\n \"service\": \"appointment\",\n \"transaction_id\": \"api-53423-GH_228766880001\"\n}"
response = http.request(request)
puts response.read_bodyStatus changed
When status of an appointment changes, a webhook event is sent to registered webhooks with details about the appointment, including the appointment ID, status, doctor ID, patient ID, and event type.
Field Definitions
• event: string - The type of resource for which event is generated. Here, it will be appointment.statuschange.
• service: string - The type of service. For appointments, this will be appointment.
• data: object - Contains detailed information about the appointment event.
• appointment_id: string - Unique identifier for the appointment.
• doctor_id: string - Unique identifier for the doctor.
• patient_id: string - Unique identifier for the patient.
• status: string - Status of the appointment. Possible values can be
-
“BK” (Booked),
-
“OG” (Ongoing),
-
“CM” (Completed with Prescription),
-
“CMNP” (Completed without Prescription),
-
“CN” (Cancelled).
• action: string - Current action for the appointment. Possible values can be
-
created
-
modified
-
completed
• partner_meta: key value pair specified by partner while creating appointment.
• timestamp: string (ISO 8601) - The date and time when the event occurred.
• custom_attibutes: complete set of custom attributes(inclusing tags and labels) defined against this appointment. occurred.
Example Webhook Request
Endpoint: https://your-registered-webhook-url.com
Method: POST
curl --request POST \
--url https://{partner_host}/registered_url_for_status_change_events \
--header 'Content-Type: application/json' \
--data '
{
"business_id": "77133577914507",
"client_id": "",
"event": "appointment.statuschange",
"event_time": 1749544752,
"timestamp": 1730189586,
"data": {
"appointment_id": "api-53423-GH_228766880001",
"clinic_id": "678f4fcd4ce758001d3624ee",
"created_at": 1749532041,
"doctor_id": "173744358327115",
"modified_at": 1749544752,
"patient_id": "173986493567406",
"status": "CM",
"custom_attributes": {
"label": [
"vitals_submitted"
],
"tags": [
"paid",
"in_consult"
]
},
"partner_appointment_id": "GH_228766880001",
"partner_clinic_id": "CL04",
"partner_doctor_id": "sheilly",
"partner_meta": {
"appointment_id": "api-abb67007-1e53-4f0f-b428-a4bc025468a4",
"encounter_id": "228766880001",
"facility_id": "GH"
},
"partner_patient_id": "MM01156831"
},
"service": "appointment",
"transaction_id": "api-53423-GH_228766880001"
}
'import requests
url = "https://{partner_host}/registered_url_for_status_change_events"
payload = {
"business_id": "77133577914507",
"client_id": "",
"event": "appointment.statuschange",
"event_time": 1749544752,
"timestamp": 1730189586,
"data": {
"appointment_id": "api-53423-GH_228766880001",
"clinic_id": "678f4fcd4ce758001d3624ee",
"created_at": 1749532041,
"doctor_id": "173744358327115",
"modified_at": 1749544752,
"patient_id": "173986493567406",
"status": "CM",
"custom_attributes": {
"label": ["vitals_submitted"],
"tags": ["paid", "in_consult"]
},
"partner_appointment_id": "GH_228766880001",
"partner_clinic_id": "CL04",
"partner_doctor_id": "sheilly",
"partner_meta": {
"appointment_id": "api-abb67007-1e53-4f0f-b428-a4bc025468a4",
"encounter_id": "228766880001",
"facility_id": "GH"
},
"partner_patient_id": "MM01156831"
},
"service": "appointment",
"transaction_id": "api-53423-GH_228766880001"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
business_id: '77133577914507',
client_id: '',
event: 'appointment.statuschange',
event_time: 1749544752,
timestamp: 1730189586,
data: {
appointment_id: 'api-53423-GH_228766880001',
clinic_id: '678f4fcd4ce758001d3624ee',
created_at: 1749532041,
doctor_id: '173744358327115',
modified_at: 1749544752,
patient_id: '173986493567406',
status: 'CM',
custom_attributes: {label: ['vitals_submitted'], tags: ['paid', 'in_consult']},
partner_appointment_id: 'GH_228766880001',
partner_clinic_id: 'CL04',
partner_doctor_id: 'sheilly',
partner_meta: {
appointment_id: 'api-abb67007-1e53-4f0f-b428-a4bc025468a4',
encounter_id: '228766880001',
facility_id: 'GH'
},
partner_patient_id: 'MM01156831'
},
service: 'appointment',
transaction_id: 'api-53423-GH_228766880001'
})
};
fetch('https://{partner_host}/registered_url_for_status_change_events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{partner_host}/registered_url_for_status_change_events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'business_id' => '77133577914507',
'client_id' => '',
'event' => 'appointment.statuschange',
'event_time' => 1749544752,
'timestamp' => 1730189586,
'data' => [
'appointment_id' => 'api-53423-GH_228766880001',
'clinic_id' => '678f4fcd4ce758001d3624ee',
'created_at' => 1749532041,
'doctor_id' => '173744358327115',
'modified_at' => 1749544752,
'patient_id' => '173986493567406',
'status' => 'CM',
'custom_attributes' => [
'label' => [
'vitals_submitted'
],
'tags' => [
'paid',
'in_consult'
]
],
'partner_appointment_id' => 'GH_228766880001',
'partner_clinic_id' => 'CL04',
'partner_doctor_id' => 'sheilly',
'partner_meta' => [
'appointment_id' => 'api-abb67007-1e53-4f0f-b428-a4bc025468a4',
'encounter_id' => '228766880001',
'facility_id' => 'GH'
],
'partner_patient_id' => 'MM01156831'
],
'service' => 'appointment',
'transaction_id' => 'api-53423-GH_228766880001'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{partner_host}/registered_url_for_status_change_events"
payload := strings.NewReader("{\n \"business_id\": \"77133577914507\",\n \"client_id\": \"\",\n \"event\": \"appointment.statuschange\",\n \"event_time\": 1749544752,\n \"timestamp\": 1730189586,\n \"data\": {\n \"appointment_id\": \"api-53423-GH_228766880001\",\n \"clinic_id\": \"678f4fcd4ce758001d3624ee\",\n \"created_at\": 1749532041,\n \"doctor_id\": \"173744358327115\",\n \"modified_at\": 1749544752,\n \"patient_id\": \"173986493567406\",\n \"status\": \"CM\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"partner_appointment_id\": \"GH_228766880001\",\n \"partner_clinic_id\": \"CL04\",\n \"partner_doctor_id\": \"sheilly\",\n \"partner_meta\": {\n \"appointment_id\": \"api-abb67007-1e53-4f0f-b428-a4bc025468a4\",\n \"encounter_id\": \"228766880001\",\n \"facility_id\": \"GH\"\n },\n \"partner_patient_id\": \"MM01156831\"\n },\n \"service\": \"appointment\",\n \"transaction_id\": \"api-53423-GH_228766880001\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{partner_host}/registered_url_for_status_change_events")
.header("Content-Type", "application/json")
.body("{\n \"business_id\": \"77133577914507\",\n \"client_id\": \"\",\n \"event\": \"appointment.statuschange\",\n \"event_time\": 1749544752,\n \"timestamp\": 1730189586,\n \"data\": {\n \"appointment_id\": \"api-53423-GH_228766880001\",\n \"clinic_id\": \"678f4fcd4ce758001d3624ee\",\n \"created_at\": 1749532041,\n \"doctor_id\": \"173744358327115\",\n \"modified_at\": 1749544752,\n \"patient_id\": \"173986493567406\",\n \"status\": \"CM\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"partner_appointment_id\": \"GH_228766880001\",\n \"partner_clinic_id\": \"CL04\",\n \"partner_doctor_id\": \"sheilly\",\n \"partner_meta\": {\n \"appointment_id\": \"api-abb67007-1e53-4f0f-b428-a4bc025468a4\",\n \"encounter_id\": \"228766880001\",\n \"facility_id\": \"GH\"\n },\n \"partner_patient_id\": \"MM01156831\"\n },\n \"service\": \"appointment\",\n \"transaction_id\": \"api-53423-GH_228766880001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{partner_host}/registered_url_for_status_change_events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"business_id\": \"77133577914507\",\n \"client_id\": \"\",\n \"event\": \"appointment.statuschange\",\n \"event_time\": 1749544752,\n \"timestamp\": 1730189586,\n \"data\": {\n \"appointment_id\": \"api-53423-GH_228766880001\",\n \"clinic_id\": \"678f4fcd4ce758001d3624ee\",\n \"created_at\": 1749532041,\n \"doctor_id\": \"173744358327115\",\n \"modified_at\": 1749544752,\n \"patient_id\": \"173986493567406\",\n \"status\": \"CM\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"partner_appointment_id\": \"GH_228766880001\",\n \"partner_clinic_id\": \"CL04\",\n \"partner_doctor_id\": \"sheilly\",\n \"partner_meta\": {\n \"appointment_id\": \"api-abb67007-1e53-4f0f-b428-a4bc025468a4\",\n \"encounter_id\": \"228766880001\",\n \"facility_id\": \"GH\"\n },\n \"partner_patient_id\": \"MM01156831\"\n },\n \"service\": \"appointment\",\n \"transaction_id\": \"api-53423-GH_228766880001\"\n}"
response = http.request(request)
puts response.read_bodyBody
Business ID for the appointment
"77133577914507"
Client ID for the appointment
""
Type of event
"appointment.statuschange"
Event occurred timestamp
1749544752
Timestamp of the event
1730189586
Show child attributes
Show child attributes
Service related to the event
"appointment"
Transaction ID for the event
"api-53423-GH_228766880001"
Response
Was this page helpful?

