curl --request POST \
--url https://api.eka.care/cdr/v1/clinic/ \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"name": "Sunrise Clinic",
"address": "123 Main Street, Block A",
"partner_id": "Clinic_321_Indore",
"pincode": "560001",
"contact": "9876543210",
"doctor_ids": [
"171266028552522",
"171266028552523"
],
"partner_doctor_ids": [
"Part_Doc_1",
"Part_Doc_2"
],
"city": "Bangalore",
"state": "Karnataka"
}
'import requests
url = "https://api.eka.care/cdr/v1/clinic/"
payload = {
"name": "Sunrise Clinic",
"address": "123 Main Street, Block A",
"partner_id": "Clinic_321_Indore",
"pincode": "560001",
"contact": "9876543210",
"doctor_ids": ["171266028552522", "171266028552523"],
"partner_doctor_ids": ["Part_Doc_1", "Part_Doc_2"],
"city": "Bangalore",
"state": "Karnataka"
}
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({
name: 'Sunrise Clinic',
address: '123 Main Street, Block A',
partner_id: 'Clinic_321_Indore',
pincode: '560001',
contact: '9876543210',
doctor_ids: ['171266028552522', '171266028552523'],
partner_doctor_ids: ['Part_Doc_1', 'Part_Doc_2'],
city: 'Bangalore',
state: 'Karnataka'
})
};
fetch('https://api.eka.care/cdr/v1/clinic/', 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/cdr/v1/clinic/",
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([
'name' => 'Sunrise Clinic',
'address' => '123 Main Street, Block A',
'partner_id' => 'Clinic_321_Indore',
'pincode' => '560001',
'contact' => '9876543210',
'doctor_ids' => [
'171266028552522',
'171266028552523'
],
'partner_doctor_ids' => [
'Part_Doc_1',
'Part_Doc_2'
],
'city' => 'Bangalore',
'state' => 'Karnataka'
]),
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/cdr/v1/clinic/"
payload := strings.NewReader("{\n \"name\": \"Sunrise Clinic\",\n \"address\": \"123 Main Street, Block A\",\n \"partner_id\": \"Clinic_321_Indore\",\n \"pincode\": \"560001\",\n \"contact\": \"9876543210\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"partner_doctor_ids\": [\n \"Part_Doc_1\",\n \"Part_Doc_2\"\n ],\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\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/cdr/v1/clinic/")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sunrise Clinic\",\n \"address\": \"123 Main Street, Block A\",\n \"partner_id\": \"Clinic_321_Indore\",\n \"pincode\": \"560001\",\n \"contact\": \"9876543210\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"partner_doctor_ids\": [\n \"Part_Doc_1\",\n \"Part_Doc_2\"\n ],\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/cdr/v1/clinic/")
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 \"name\": \"Sunrise Clinic\",\n \"address\": \"123 Main Street, Block A\",\n \"partner_id\": \"Clinic_321_Indore\",\n \"pincode\": \"560001\",\n \"contact\": \"9876543210\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"partner_doctor_ids\": [\n \"Part_Doc_1\",\n \"Part_Doc_2\"\n ],\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"ekaid": "do1769174683513"
}{
"<field>": [
"This field is required."
],
"message": [
"Only one of doctor_ids or partner_doctor_ids should be provided, not both."
]
}Create Clinic
Overview
The Create Clinic API allows you to register a new clinic for your business, including its name, address, pincode, contact number, city, state, and assigned doctors.
Endpoint: {{HOST}}/cdr/v1/clinic
Method: POST
Request Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| name | string | Name of the clinic | Yes |
| address | string | Address of the clinic | Yes |
| partner_id | string | Unique id of the clinic in partner’s system. | No |
| pincode | string | Pincode of the clinic | No |
| contact | string | Contact number | No |
| doctor_ids | array | List of doctor Eka IDs to assign to this clinic | No |
| partner_doctor_ids | array | List of partner doctor IDs to assign to this clinic | No |
| city | string | City name | No |
| state | string | State name | No |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| status | string | Status of the response (e.g., “success”) |
| ekaid | string | Unique identifier for the created clinic |
curl --request POST \
--url https://api.eka.care/cdr/v1/clinic/ \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"name": "Sunrise Clinic",
"address": "123 Main Street, Block A",
"partner_id": "Clinic_321_Indore",
"pincode": "560001",
"contact": "9876543210",
"doctor_ids": [
"171266028552522",
"171266028552523"
],
"partner_doctor_ids": [
"Part_Doc_1",
"Part_Doc_2"
],
"city": "Bangalore",
"state": "Karnataka"
}
'import requests
url = "https://api.eka.care/cdr/v1/clinic/"
payload = {
"name": "Sunrise Clinic",
"address": "123 Main Street, Block A",
"partner_id": "Clinic_321_Indore",
"pincode": "560001",
"contact": "9876543210",
"doctor_ids": ["171266028552522", "171266028552523"],
"partner_doctor_ids": ["Part_Doc_1", "Part_Doc_2"],
"city": "Bangalore",
"state": "Karnataka"
}
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({
name: 'Sunrise Clinic',
address: '123 Main Street, Block A',
partner_id: 'Clinic_321_Indore',
pincode: '560001',
contact: '9876543210',
doctor_ids: ['171266028552522', '171266028552523'],
partner_doctor_ids: ['Part_Doc_1', 'Part_Doc_2'],
city: 'Bangalore',
state: 'Karnataka'
})
};
fetch('https://api.eka.care/cdr/v1/clinic/', 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/cdr/v1/clinic/",
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([
'name' => 'Sunrise Clinic',
'address' => '123 Main Street, Block A',
'partner_id' => 'Clinic_321_Indore',
'pincode' => '560001',
'contact' => '9876543210',
'doctor_ids' => [
'171266028552522',
'171266028552523'
],
'partner_doctor_ids' => [
'Part_Doc_1',
'Part_Doc_2'
],
'city' => 'Bangalore',
'state' => 'Karnataka'
]),
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/cdr/v1/clinic/"
payload := strings.NewReader("{\n \"name\": \"Sunrise Clinic\",\n \"address\": \"123 Main Street, Block A\",\n \"partner_id\": \"Clinic_321_Indore\",\n \"pincode\": \"560001\",\n \"contact\": \"9876543210\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"partner_doctor_ids\": [\n \"Part_Doc_1\",\n \"Part_Doc_2\"\n ],\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\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/cdr/v1/clinic/")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sunrise Clinic\",\n \"address\": \"123 Main Street, Block A\",\n \"partner_id\": \"Clinic_321_Indore\",\n \"pincode\": \"560001\",\n \"contact\": \"9876543210\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"partner_doctor_ids\": [\n \"Part_Doc_1\",\n \"Part_Doc_2\"\n ],\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/cdr/v1/clinic/")
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 \"name\": \"Sunrise Clinic\",\n \"address\": \"123 Main Street, Block A\",\n \"partner_id\": \"Clinic_321_Indore\",\n \"pincode\": \"560001\",\n \"contact\": \"9876543210\",\n \"doctor_ids\": [\n \"171266028552522\",\n \"171266028552523\"\n ],\n \"partner_doctor_ids\": [\n \"Part_Doc_1\",\n \"Part_Doc_2\"\n ],\n \"city\": \"Bangalore\",\n \"state\": \"Karnataka\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"ekaid": "do1769174683513"
}{
"<field>": [
"This field is required."
],
"message": [
"Only one of doctor_ids or partner_doctor_ids should be provided, not both."
]
}Headers
The auth token of the business. It is used to authenticate the client. This should be fetched from auth api.
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM"
Body
Request body for creating a clinic
Name of the clinic
"Sunrise Clinic"
Address of the clinic
"123 Main Street, Block A"
Unique identifier of the clinic in the partner’s system
"Clinic_321_Indore"
Pincode of the clinic
"560001"
Contact number (10 or 11 digits)
^\d{10,11}$"9876543210"
List of doctor Eka IDs to assign to this clinic
["171266028552522", "171266028552523"]
List of partner doctor IDs to assign to this clinic
["Part_Doc_1", "Part_Doc_2"]
City name
"Bangalore"
State name
"Karnataka"
Was this page helpful?

