Add Patient to Directory
curl --request POST \
--url https://api.eka.care/dr/v1/patient \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"dob": "1987-01-06",
"first_name": "Test",
"gender": "M",
"designation": "Mr.",
"partner_patient_id": "6742984",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"address": {
"city": "Bangalore",
"pincode": 560049
}
}
'import requests
url = "https://api.eka.care/dr/v1/patient"
payload = {
"dob": "1987-01-06",
"first_name": "Test",
"gender": "M",
"designation": "Mr.",
"partner_patient_id": "6742984",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"address": {
"city": "Bangalore",
"pincode": 560049
}
}
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({
dob: '1987-01-06',
first_name: 'Test',
gender: 'M',
designation: 'Mr.',
partner_patient_id: '6742984',
middle_name: '',
last_name: 'Patient',
mobile: '+919999999999',
address: {city: 'Bangalore', pincode: 560049}
})
};
fetch('https://api.eka.care/dr/v1/patient', 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/patient")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"dob\": \"1987-01-06\",\n \"first_name\": \"Test\",\n \"gender\": \"M\",\n \"designation\": \"Mr.\",\n \"partner_patient_id\": \"6742984\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/dr/v1/patient");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"dob\": \"1987-01-06\",\n \"first_name\": \"Test\",\n \"gender\": \"M\",\n \"designation\": \"Mr.\",\n \"partner_patient_id\": \"6742984\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n }\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/patient")
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 \"dob\": \"1987-01-06\",\n \"first_name\": \"Test\",\n \"gender\": \"M\",\n \"designation\": \"Mr.\",\n \"partner_patient_id\": \"6742984\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n }\n}"
response = http.request(request)
puts response.read_body{
"patient_id": "123456789"
}{
"error": {
"code": "NOT_ALLOWED",
"message": "You are not allowed to add resource"
}
}{
"error": {
"code": "PATIENT_ALREADY_EXISTS",
"message": "Patient already exists with the same partner_patient_id: abc"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}Patient Directory APIs
Add Patient to Directory
This functionality enables the addition of new patient records to a business’ directory. Users can provide necessary details such as personal information, contact details, and medical history to create a new patient profile.
In case the patient is already registered with Eka care, then passing the patient eka id will be enough
POST
/
dr
/
v1
/
patient
Add Patient to Directory
curl --request POST \
--url https://api.eka.care/dr/v1/patient \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"dob": "1987-01-06",
"first_name": "Test",
"gender": "M",
"designation": "Mr.",
"partner_patient_id": "6742984",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"address": {
"city": "Bangalore",
"pincode": 560049
}
}
'import requests
url = "https://api.eka.care/dr/v1/patient"
payload = {
"dob": "1987-01-06",
"first_name": "Test",
"gender": "M",
"designation": "Mr.",
"partner_patient_id": "6742984",
"middle_name": "",
"last_name": "Patient",
"mobile": "+919999999999",
"address": {
"city": "Bangalore",
"pincode": 560049
}
}
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({
dob: '1987-01-06',
first_name: 'Test',
gender: 'M',
designation: 'Mr.',
partner_patient_id: '6742984',
middle_name: '',
last_name: 'Patient',
mobile: '+919999999999',
address: {city: 'Bangalore', pincode: 560049}
})
};
fetch('https://api.eka.care/dr/v1/patient', 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/patient")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"dob\": \"1987-01-06\",\n \"first_name\": \"Test\",\n \"gender\": \"M\",\n \"designation\": \"Mr.\",\n \"partner_patient_id\": \"6742984\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n }\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/dr/v1/patient");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("auth", "<auth>");
request.AddJsonBody("{\n \"dob\": \"1987-01-06\",\n \"first_name\": \"Test\",\n \"gender\": \"M\",\n \"designation\": \"Mr.\",\n \"partner_patient_id\": \"6742984\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n }\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/patient")
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 \"dob\": \"1987-01-06\",\n \"first_name\": \"Test\",\n \"gender\": \"M\",\n \"designation\": \"Mr.\",\n \"partner_patient_id\": \"6742984\",\n \"middle_name\": \"\",\n \"last_name\": \"Patient\",\n \"mobile\": \"+919999999999\",\n \"address\": {\n \"city\": \"Bangalore\",\n \"pincode\": 560049\n }\n}"
response = http.request(request)
puts response.read_body{
"patient_id": "123456789"
}{
"error": {
"code": "NOT_ALLOWED",
"message": "You are not allowed to add resource"
}
}{
"error": {
"code": "PATIENT_ALREADY_EXISTS",
"message": "Patient already exists with the same partner_patient_id: abc"
}
}{
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
}Headers
Body
application/json
Request body for adding a patient to the directory
- DOB
- AGE
Was this page helpful?

