curl --request POST \
--url https://api.eka.care/profiles/v1/patient/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'client-id: <client-id>' \
--data '
{
"fn": "eka",
"dob": "2000-01-02",
"gen": "M",
"mn": "eka",
"ln": "user",
"fln": "eka user",
"s": "Dr",
"bloodgroup": "A+",
"mobile": "+916000000000",
"email": "testuser@eka.care",
"username": "UH0001",
"abha": "xyz@abdm",
"extras": {
"dummyKey": "Dummy Value"
}
}
'import requests
url = "https://api.eka.care/profiles/v1/patient/"
payload = {
"fn": "eka",
"dob": "2000-01-02",
"gen": "M",
"mn": "eka",
"ln": "user",
"fln": "eka user",
"s": "Dr",
"bloodgroup": "A+",
"mobile": "+916000000000",
"email": "testuser@eka.care",
"username": "UH0001",
"abha": "xyz@abdm",
"extras": { "dummyKey": "Dummy Value" }
}
headers = {
"client-id": "<client-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<client-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fn: 'eka',
dob: '2000-01-02',
gen: 'M',
mn: 'eka',
ln: 'user',
fln: 'eka user',
s: 'Dr',
bloodgroup: 'A+',
mobile: '+916000000000',
email: 'testuser@eka.care',
username: 'UH0001',
abha: 'xyz@abdm',
extras: {dummyKey: 'Dummy Value'}
})
};
fetch('https://api.eka.care/profiles/v1/patient/', 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/profiles/v1/patient/",
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([
'fn' => 'eka',
'dob' => '2000-01-02',
'gen' => 'M',
'mn' => 'eka',
'ln' => 'user',
'fln' => 'eka user',
's' => 'Dr',
'bloodgroup' => 'A+',
'mobile' => '+916000000000',
'email' => 'testuser@eka.care',
'username' => 'UH0001',
'abha' => 'xyz@abdm',
'extras' => [
'dummyKey' => 'Dummy Value'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"client-id: <client-id>"
],
]);
$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/profiles/v1/patient/"
payload := strings.NewReader("{\n \"fn\": \"eka\",\n \"dob\": \"2000-01-02\",\n \"gen\": \"M\",\n \"mn\": \"eka\",\n \"ln\": \"user\",\n \"fln\": \"eka user\",\n \"s\": \"Dr\",\n \"bloodgroup\": \"A+\",\n \"mobile\": \"+916000000000\",\n \"email\": \"testuser@eka.care\",\n \"username\": \"UH0001\",\n \"abha\": \"xyz@abdm\",\n \"extras\": {\n \"dummyKey\": \"Dummy Value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<client-id>")
req.Header.Add("Authorization", "Bearer <token>")
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/profiles/v1/patient/")
.header("client-id", "<client-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fn\": \"eka\",\n \"dob\": \"2000-01-02\",\n \"gen\": \"M\",\n \"mn\": \"eka\",\n \"ln\": \"user\",\n \"fln\": \"eka user\",\n \"s\": \"Dr\",\n \"bloodgroup\": \"A+\",\n \"mobile\": \"+916000000000\",\n \"email\": \"testuser@eka.care\",\n \"username\": \"UH0001\",\n \"abha\": \"xyz@abdm\",\n \"extras\": {\n \"dummyKey\": \"Dummy Value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/profiles/v1/patient/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<client-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fn\": \"eka\",\n \"dob\": \"2000-01-02\",\n \"gen\": \"M\",\n \"mn\": \"eka\",\n \"ln\": \"user\",\n \"fln\": \"eka user\",\n \"s\": \"Dr\",\n \"bloodgroup\": \"A+\",\n \"mobile\": \"+916000000000\",\n \"email\": \"testuser@eka.care\",\n \"username\": \"UH0001\",\n \"abha\": \"xyz@abdm\",\n \"extras\": {\n \"dummyKey\": \"Dummy Value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"oid": "1876816818618681"
}{
"error": {
"message": "Invalid Gender Enum",
"code": "invalid_request"
}
}Create a patient profile
Allows businesses to add new patient record by capturing personal, contact, and medical information.
Name Field Requirement:
- Either
flnmust be provided, or at leastfnmust be included (optionally withmnandln).
curl --request POST \
--url https://api.eka.care/profiles/v1/patient/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'client-id: <client-id>' \
--data '
{
"fn": "eka",
"dob": "2000-01-02",
"gen": "M",
"mn": "eka",
"ln": "user",
"fln": "eka user",
"s": "Dr",
"bloodgroup": "A+",
"mobile": "+916000000000",
"email": "testuser@eka.care",
"username": "UH0001",
"abha": "xyz@abdm",
"extras": {
"dummyKey": "Dummy Value"
}
}
'import requests
url = "https://api.eka.care/profiles/v1/patient/"
payload = {
"fn": "eka",
"dob": "2000-01-02",
"gen": "M",
"mn": "eka",
"ln": "user",
"fln": "eka user",
"s": "Dr",
"bloodgroup": "A+",
"mobile": "+916000000000",
"email": "testuser@eka.care",
"username": "UH0001",
"abha": "xyz@abdm",
"extras": { "dummyKey": "Dummy Value" }
}
headers = {
"client-id": "<client-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-id': '<client-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
fn: 'eka',
dob: '2000-01-02',
gen: 'M',
mn: 'eka',
ln: 'user',
fln: 'eka user',
s: 'Dr',
bloodgroup: 'A+',
mobile: '+916000000000',
email: 'testuser@eka.care',
username: 'UH0001',
abha: 'xyz@abdm',
extras: {dummyKey: 'Dummy Value'}
})
};
fetch('https://api.eka.care/profiles/v1/patient/', 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/profiles/v1/patient/",
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([
'fn' => 'eka',
'dob' => '2000-01-02',
'gen' => 'M',
'mn' => 'eka',
'ln' => 'user',
'fln' => 'eka user',
's' => 'Dr',
'bloodgroup' => 'A+',
'mobile' => '+916000000000',
'email' => 'testuser@eka.care',
'username' => 'UH0001',
'abha' => 'xyz@abdm',
'extras' => [
'dummyKey' => 'Dummy Value'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"client-id: <client-id>"
],
]);
$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/profiles/v1/patient/"
payload := strings.NewReader("{\n \"fn\": \"eka\",\n \"dob\": \"2000-01-02\",\n \"gen\": \"M\",\n \"mn\": \"eka\",\n \"ln\": \"user\",\n \"fln\": \"eka user\",\n \"s\": \"Dr\",\n \"bloodgroup\": \"A+\",\n \"mobile\": \"+916000000000\",\n \"email\": \"testuser@eka.care\",\n \"username\": \"UH0001\",\n \"abha\": \"xyz@abdm\",\n \"extras\": {\n \"dummyKey\": \"Dummy Value\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-id", "<client-id>")
req.Header.Add("Authorization", "Bearer <token>")
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/profiles/v1/patient/")
.header("client-id", "<client-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"fn\": \"eka\",\n \"dob\": \"2000-01-02\",\n \"gen\": \"M\",\n \"mn\": \"eka\",\n \"ln\": \"user\",\n \"fln\": \"eka user\",\n \"s\": \"Dr\",\n \"bloodgroup\": \"A+\",\n \"mobile\": \"+916000000000\",\n \"email\": \"testuser@eka.care\",\n \"username\": \"UH0001\",\n \"abha\": \"xyz@abdm\",\n \"extras\": {\n \"dummyKey\": \"Dummy Value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/profiles/v1/patient/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-id"] = '<client-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fn\": \"eka\",\n \"dob\": \"2000-01-02\",\n \"gen\": \"M\",\n \"mn\": \"eka\",\n \"ln\": \"user\",\n \"fln\": \"eka user\",\n \"s\": \"Dr\",\n \"bloodgroup\": \"A+\",\n \"mobile\": \"+916000000000\",\n \"email\": \"testuser@eka.care\",\n \"username\": \"UH0001\",\n \"abha\": \"xyz@abdm\",\n \"extras\": {\n \"dummyKey\": \"Dummy Value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"oid": "1876816818618681"
}{
"error": {
"message": "Invalid Gender Enum",
"code": "invalid_request"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
"androiddoc"
Body
- Option 1
- Option 2
First name (will be converted and stored in lowercase)
"eka"
"2000-01-02"
Gender
M, F, O "M"
Middle name (will be converted and stored in lowercase)
"eka"
Last name (will be converted and stored in lowercase)
"user"
Full name (will be converted and stored in lowercase)
"eka user"
Salutation (optional)
"Dr"
Blood group of the patient
A+, A-, B+, B-, AB+, AB-, O+, O- "A+"
Mobile number of the patient ( with country code )
"+916000000000"
Email address of the patient (will be converted and stored in lowercase)
"testuser@eka.care"
Unique UHID| partner id | username for the patient
"UH0001"
ABHA address of the patient
"xyz@abdm"
Additional arbitrary data as a JSON object
{ "dummyKey": "Dummy Value" }
Response
Patient created successfully
Unique identifier for the patient. Use this ID to retrieve the patient profile.
"1876816818618681"
Was this page helpful?

