Book Appointment Slot
curl --request POST \
--url https://api.eka.care/dr/v1/appointment \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"partner_appointment_id": "098765434567890",
"partner_clinic_id": "642783",
"partner_doctor_id": "8423994",
"partner_patient_id": "6742984",
"token": 2,
"appointment_details": {
"start_time": 1730189586,
"end_time": 1730189586,
"mode": "INCLINIC",
"custom_attributes": {
"label": [
"vitals_submitted"
],
"tags": [
"paid",
"in_consult"
]
},
"video_connect": {
"vendor": "other",
"url": "https://xyz.com"
}
},
"patient_details": {
"designation": "Mr.",
"first_name": "Test",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"gender": "M",
"dob": "1987-01-06",
"address": {
"city": "Bangalore",
"pincode": 560049
},
"partner_patient_id": "6742984"
},
"partner_meta": {
"encounter_id": "123"
},
"display_meta": {
"key1": "value1"
},
"notes": "<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>"
}
'import requests
url = "https://api.eka.care/dr/v1/appointment"
payload = {
"partner_appointment_id": "098765434567890",
"partner_clinic_id": "642783",
"partner_doctor_id": "8423994",
"partner_patient_id": "6742984",
"token": 2,
"appointment_details": {
"start_time": 1730189586,
"end_time": 1730189586,
"mode": "INCLINIC",
"custom_attributes": {
"label": ["vitals_submitted"],
"tags": ["paid", "in_consult"]
},
"video_connect": {
"vendor": "other",
"url": "https://xyz.com"
}
},
"patient_details": {
"designation": "Mr.",
"first_name": "Test",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"gender": "M",
"dob": "1987-01-06",
"address": {
"city": "Bangalore",
"pincode": 560049
},
"partner_patient_id": "6742984"
},
"partner_meta": { "encounter_id": "123" },
"display_meta": { "key1": "value1" },
"notes": "<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partner_appointment_id: '098765434567890',
partner_clinic_id: '642783',
partner_doctor_id: '8423994',
partner_patient_id: '6742984',
token: 2,
appointment_details: {
start_time: 1730189586,
end_time: 1730189586,
mode: 'INCLINIC',
custom_attributes: {label: ['vitals_submitted'], tags: ['paid', 'in_consult']},
video_connect: {vendor: 'other', url: 'https://xyz.com'}
},
patient_details: {
designation: 'Mr.',
first_name: 'Test',
middle_name: '',
last_name: 'Patient',
mobile: '+919999999999',
gender: 'M',
dob: '1987-01-06',
address: {city: 'Bangalore', pincode: 560049},
partner_patient_id: '6742984'
},
partner_meta: {encounter_id: '123'},
display_meta: {key1: 'value1'},
notes: '<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>'
})
};
fetch('https://api.eka.care/dr/v1/appointment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.eka.care/dr/v1/appointment")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"partner_appointment_id\": \"098765434567890\",\n \"partner_clinic_id\": \"642783\",\n \"partner_doctor_id\": \"8423994\",\n \"partner_patient_id\": \"6742984\",\n \"token\": 2,\n \"appointment_details\": {\n \"start_time\": 1730189586,\n \"end_time\": 1730189586,\n \"mode\": \"INCLINIC\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"video_connect\": {\n \"vendor\": \"other\",\n \"url\": \"https://xyz.com\"\n }\n },\n \"patient_details\": {\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"gender\": \"M\",\n \"dob\": \"1987-01-06\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n },\n \"partner_patient_id\": \"6742984\"\n },\n \"partner_meta\": {\n \"encounter_id\": \"123\"\n },\n \"display_meta\": {\n \"key1\": \"value1\"\n },\n \"notes\": \"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/dr/v1/appointment");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"partner_appointment_id\": \"098765434567890\",\n \"partner_clinic_id\": \"642783\",\n \"partner_doctor_id\": \"8423994\",\n \"partner_patient_id\": \"6742984\",\n \"token\": 2,\n \"appointment_details\": {\n \"start_time\": 1730189586,\n \"end_time\": 1730189586,\n \"mode\": \"INCLINIC\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"video_connect\": {\n \"vendor\": \"other\",\n \"url\": \"https://xyz.com\"\n }\n },\n \"patient_details\": {\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"gender\": \"M\",\n \"dob\": \"1987-01-06\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n },\n \"partner_patient_id\": \"6742984\"\n },\n \"partner_meta\": {\n \"encounter_id\": \"123\"\n },\n \"display_meta\": {\n \"key1\": \"value1\"\n },\n \"notes\": \"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/dr/v1/appointment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_appointment_id\": \"098765434567890\",\n \"partner_clinic_id\": \"642783\",\n \"partner_doctor_id\": \"8423994\",\n \"partner_patient_id\": \"6742984\",\n \"token\": 2,\n \"appointment_details\": {\n \"start_time\": 1730189586,\n \"end_time\": 1730189586,\n \"mode\": \"INCLINIC\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"video_connect\": {\n \"vendor\": \"other\",\n \"url\": \"https://xyz.com\"\n }\n },\n \"patient_details\": {\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"gender\": \"M\",\n \"dob\": \"1987-01-06\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n },\n \"partner_patient_id\": \"6742984\"\n },\n \"partner_meta\": {\n \"encounter_id\": \"123\"\n },\n \"display_meta\": {\n \"key1\": \"value1\"\n },\n \"notes\": \"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>\"\n}"
response = http.request(request)
puts response.read_body{
"appointment_id": "{{appointment_id}}"
}{
"error": {
"code": "INVALID_REQUEST_PARAMETERS",
"message": "The request contains invalid parameters"
}
}Appointment API
Book Appointment Slot
This API is used to book an appointment slot for a patient based on the available slots retrieved from the get appointment slots API.
POST
/
dr
/
v1
/
appointment
Book Appointment Slot
curl --request POST \
--url https://api.eka.care/dr/v1/appointment \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"partner_appointment_id": "098765434567890",
"partner_clinic_id": "642783",
"partner_doctor_id": "8423994",
"partner_patient_id": "6742984",
"token": 2,
"appointment_details": {
"start_time": 1730189586,
"end_time": 1730189586,
"mode": "INCLINIC",
"custom_attributes": {
"label": [
"vitals_submitted"
],
"tags": [
"paid",
"in_consult"
]
},
"video_connect": {
"vendor": "other",
"url": "https://xyz.com"
}
},
"patient_details": {
"designation": "Mr.",
"first_name": "Test",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"gender": "M",
"dob": "1987-01-06",
"address": {
"city": "Bangalore",
"pincode": 560049
},
"partner_patient_id": "6742984"
},
"partner_meta": {
"encounter_id": "123"
},
"display_meta": {
"key1": "value1"
},
"notes": "<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>"
}
'import requests
url = "https://api.eka.care/dr/v1/appointment"
payload = {
"partner_appointment_id": "098765434567890",
"partner_clinic_id": "642783",
"partner_doctor_id": "8423994",
"partner_patient_id": "6742984",
"token": 2,
"appointment_details": {
"start_time": 1730189586,
"end_time": 1730189586,
"mode": "INCLINIC",
"custom_attributes": {
"label": ["vitals_submitted"],
"tags": ["paid", "in_consult"]
},
"video_connect": {
"vendor": "other",
"url": "https://xyz.com"
}
},
"patient_details": {
"designation": "Mr.",
"first_name": "Test",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"gender": "M",
"dob": "1987-01-06",
"address": {
"city": "Bangalore",
"pincode": 560049
},
"partner_patient_id": "6742984"
},
"partner_meta": { "encounter_id": "123" },
"display_meta": { "key1": "value1" },
"notes": "<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
partner_appointment_id: '098765434567890',
partner_clinic_id: '642783',
partner_doctor_id: '8423994',
partner_patient_id: '6742984',
token: 2,
appointment_details: {
start_time: 1730189586,
end_time: 1730189586,
mode: 'INCLINIC',
custom_attributes: {label: ['vitals_submitted'], tags: ['paid', 'in_consult']},
video_connect: {vendor: 'other', url: 'https://xyz.com'}
},
patient_details: {
designation: 'Mr.',
first_name: 'Test',
middle_name: '',
last_name: 'Patient',
mobile: '+919999999999',
gender: 'M',
dob: '1987-01-06',
address: {city: 'Bangalore', pincode: 560049},
partner_patient_id: '6742984'
},
partner_meta: {encounter_id: '123'},
display_meta: {key1: 'value1'},
notes: '<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>'
})
};
fetch('https://api.eka.care/dr/v1/appointment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.eka.care/dr/v1/appointment")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"partner_appointment_id\": \"098765434567890\",\n \"partner_clinic_id\": \"642783\",\n \"partner_doctor_id\": \"8423994\",\n \"partner_patient_id\": \"6742984\",\n \"token\": 2,\n \"appointment_details\": {\n \"start_time\": 1730189586,\n \"end_time\": 1730189586,\n \"mode\": \"INCLINIC\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"video_connect\": {\n \"vendor\": \"other\",\n \"url\": \"https://xyz.com\"\n }\n },\n \"patient_details\": {\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"gender\": \"M\",\n \"dob\": \"1987-01-06\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n },\n \"partner_patient_id\": \"6742984\"\n },\n \"partner_meta\": {\n \"encounter_id\": \"123\"\n },\n \"display_meta\": {\n \"key1\": \"value1\"\n },\n \"notes\": \"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/dr/v1/appointment");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"partner_appointment_id\": \"098765434567890\",\n \"partner_clinic_id\": \"642783\",\n \"partner_doctor_id\": \"8423994\",\n \"partner_patient_id\": \"6742984\",\n \"token\": 2,\n \"appointment_details\": {\n \"start_time\": 1730189586,\n \"end_time\": 1730189586,\n \"mode\": \"INCLINIC\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"video_connect\": {\n \"vendor\": \"other\",\n \"url\": \"https://xyz.com\"\n }\n },\n \"patient_details\": {\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"gender\": \"M\",\n \"dob\": \"1987-01-06\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n },\n \"partner_patient_id\": \"6742984\"\n },\n \"partner_meta\": {\n \"encounter_id\": \"123\"\n },\n \"display_meta\": {\n \"key1\": \"value1\"\n },\n \"notes\": \"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
require 'uri'
require 'net/http'
url = URI("https://api.eka.care/dr/v1/appointment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_appointment_id\": \"098765434567890\",\n \"partner_clinic_id\": \"642783\",\n \"partner_doctor_id\": \"8423994\",\n \"partner_patient_id\": \"6742984\",\n \"token\": 2,\n \"appointment_details\": {\n \"start_time\": 1730189586,\n \"end_time\": 1730189586,\n \"mode\": \"INCLINIC\",\n \"custom_attributes\": {\n \"label\": [\n \"vitals_submitted\"\n ],\n \"tags\": [\n \"paid\",\n \"in_consult\"\n ]\n },\n \"video_connect\": {\n \"vendor\": \"other\",\n \"url\": \"https://xyz.com\"\n }\n },\n \"patient_details\": {\n \"designation\": \"Mr.\",\n \"first_name\": \"Test\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"gender\": \"M\",\n \"dob\": \"1987-01-06\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n },\n \"partner_patient_id\": \"6742984\"\n },\n \"partner_meta\": {\n \"encounter_id\": \"123\"\n },\n \"display_meta\": {\n \"key1\": \"value1\"\n },\n \"notes\": \"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>\"\n}"
response = http.request(request)
puts response.read_body{
"appointment_id": "{{appointment_id}}"
}{
"error": {
"code": "INVALID_REQUEST_PARAMETERS",
"message": "The request contains invalid parameters"
}
}Body
application/json
- PartnerIds
- EkaIds
The request body should contain either partner-specific fields or non-partner-specific fields for clinic and doctor identification.
Optional. Identifier for the partner’s doctor. Please ensure the doctor is registered on the hub. Omit this key entirely to book a clinic-level appointment against partner_clinic_id with no doctor assigned; sending it as null or an empty string is rejected. A doctor can be assigned later through PATCH /dr/v2/appointment/{appointment_id}.
- This field is a set of
key-value pair. - The value corresponding to a key must be string, int, or float.
- Keys in
display_metamust not exceed 30 characters. - The value for a key must not exceed 50 characters.
- These key-value pairs will be shown on the appointment card.
- For key names, it is recommended to use underscores (
_) instead of spaces. During display, underscores will be replaced with spaces, and the following letter will be capitalized automatically. - Example:
"vendor_patient_id": "P41025551968206"will be shown as"Vendor Patient Id": "P41025551968206"
- Optional field used to save notes attached to the created appointment.
- It can be provided as a plain string or as HTML for better formatting,
using tags such as
<p>,<li>, and<b>(bold).
Example:
"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>"
Was this page helpful?

