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));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/dr/v1/appointment",
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([
'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>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <auth>"
],
]);
$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://api.eka.care/dr/v1/appointment"
payload := strings.NewReader("{\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}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<auth>")
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://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();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"
}
}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.
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));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/dr/v1/appointment",
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([
'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>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <auth>"
],
]);
$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://api.eka.care/dr/v1/appointment"
payload := strings.NewReader("{\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}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<auth>")
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://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();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"
}
}Headers
"auth"
Body
- PartnerIds
- EkaIds
The request body should contain either partner-specific fields or non-partner-specific fields for clinic and doctor identification.
Identifier for the partner’s clinic. Please ensure the clinic is registered on the hub
Identifier for the partner’s doctor. Please ensure the doctor is registered on the hub
Identifier for the partner’s patient. Please ensure the patient is registered beforehand using the "Add Patient" API.
Show child attributes
Show child attributes
A unique number given to each patient to indicate their position in the queue.
- DOB
- AGE
Show child attributes
Show child attributes
This field is a set of key-value pair very specific to our partner and not visible in appointment queue. These key-value pairs are just stored at our end and echoed back in appointment related apis. We dont use it for any computation.
- 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).
"<p>Patient reported <b>mild fever</b> since 2 days.</p><ul><li>Advised rest</li><li>Follow-up after 3 days</li></ul>"
Response
OK
Was this page helpful?

