curl --request POST \
--url https://api.eka.care/admin/datasets/v1/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"medication_id": "DRUG1001",
"name": "Dolo 650",
"strength": "650mg",
"generic_name": "Paracetamol",
"form_name": "Tablet",
"manufacturer": "Micro Labs Ltd"
},
{
"medication_id": "DRUG1002",
"name": "Augmentin 625 Duo",
"generic_list": [
"Amoxicillin",
"Clavulanic Acid"
],
"form_name": "Tablet"
}
]
'import requests
url = "https://api.eka.care/admin/datasets/v1/"
payload = [
{
"medication_id": "DRUG1001",
"name": "Dolo 650",
"strength": "650mg",
"generic_name": "Paracetamol",
"form_name": "Tablet",
"manufacturer": "Micro Labs Ltd"
},
{
"medication_id": "DRUG1002",
"name": "Augmentin 625 Duo",
"generic_list": ["Amoxicillin", "Clavulanic Acid"],
"form_name": "Tablet"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
medication_id: 'DRUG1001',
name: 'Dolo 650',
strength: '650mg',
generic_name: 'Paracetamol',
form_name: 'Tablet',
manufacturer: 'Micro Labs Ltd'
},
{
medication_id: 'DRUG1002',
name: 'Augmentin 625 Duo',
generic_list: ['Amoxicillin', 'Clavulanic Acid'],
form_name: 'Tablet'
}
])
};
fetch('https://api.eka.care/admin/datasets/v1/', 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/admin/datasets/v1/",
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([
[
'medication_id' => 'DRUG1001',
'name' => 'Dolo 650',
'strength' => '650mg',
'generic_name' => 'Paracetamol',
'form_name' => 'Tablet',
'manufacturer' => 'Micro Labs Ltd'
],
[
'medication_id' => 'DRUG1002',
'name' => 'Augmentin 625 Duo',
'generic_list' => [
'Amoxicillin',
'Clavulanic Acid'
],
'form_name' => 'Tablet'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/admin/datasets/v1/"
payload := strings.NewReader("[\n {\n \"medication_id\": \"DRUG1001\",\n \"name\": \"Dolo 650\",\n \"strength\": \"650mg\",\n \"generic_name\": \"Paracetamol\",\n \"form_name\": \"Tablet\",\n \"manufacturer\": \"Micro Labs Ltd\"\n },\n {\n \"medication_id\": \"DRUG1002\",\n \"name\": \"Augmentin 625 Duo\",\n \"generic_list\": [\n \"Amoxicillin\",\n \"Clavulanic Acid\"\n ],\n \"form_name\": \"Tablet\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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/admin/datasets/v1/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"medication_id\": \"DRUG1001\",\n \"name\": \"Dolo 650\",\n \"strength\": \"650mg\",\n \"generic_name\": \"Paracetamol\",\n \"form_name\": \"Tablet\",\n \"manufacturer\": \"Micro Labs Ltd\"\n },\n {\n \"medication_id\": \"DRUG1002\",\n \"name\": \"Augmentin 625 Duo\",\n \"generic_list\": [\n \"Amoxicillin\",\n \"Clavulanic Acid\"\n ],\n \"form_name\": \"Tablet\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/admin/datasets/v1/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"medication_id\": \"DRUG1001\",\n \"name\": \"Dolo 650\",\n \"strength\": \"650mg\",\n \"generic_name\": \"Paracetamol\",\n \"form_name\": \"Tablet\",\n \"manufacturer\": \"Micro Labs Ltd\"\n },\n {\n \"medication_id\": \"DRUG1002\",\n \"name\": \"Augmentin 625 Duo\",\n \"generic_list\": [\n \"Amoxicillin\",\n \"Clavulanic Acid\"\n ],\n \"form_name\": \"Tablet\"\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "2 medication upserted",
"data": {
"upserted": 2,
"inserted": 1,
"updated": 1,
"reactivated": 0,
"deactivated": 0,
"dry_run": false
}
}Create or update records
Writes records to the catalog. Send either a JSON list of records (Content-Type: application/json) or a CSV file (multipart/form-data, field file, headers as in the CSV template).
Writes are all-or-nothing: if any record or row fails validation, nothing in the request is written and errors lists every problem.
Modes
upsert(default): records in the request are inserted, or merged into the existing record with the same id. Records not in the request are left alone.reconcile: the request is treated as your complete catalog. Records in it are inserted or updated, and every active record not in it is deactivated (never hard-deleted, so it can be restored by sending it again). If a reconcile would deactivate more than half of a non-empty catalog, it is rejected with ashrink_guarderror unless you passconfirm_shrink=true. An empty list or a CSV with no data rows is always rejected in this mode.
Use dry_run=true to validate and get the counts without writing anything.
overwrite=true (CSV only) hard-deletes the whole catalog and replaces it with the file, in one transaction. It cannot be combined with mode=reconcile; prefer reconcile, which can be undone.
curl --request POST \
--url https://api.eka.care/admin/datasets/v1/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"medication_id": "DRUG1001",
"name": "Dolo 650",
"strength": "650mg",
"generic_name": "Paracetamol",
"form_name": "Tablet",
"manufacturer": "Micro Labs Ltd"
},
{
"medication_id": "DRUG1002",
"name": "Augmentin 625 Duo",
"generic_list": [
"Amoxicillin",
"Clavulanic Acid"
],
"form_name": "Tablet"
}
]
'import requests
url = "https://api.eka.care/admin/datasets/v1/"
payload = [
{
"medication_id": "DRUG1001",
"name": "Dolo 650",
"strength": "650mg",
"generic_name": "Paracetamol",
"form_name": "Tablet",
"manufacturer": "Micro Labs Ltd"
},
{
"medication_id": "DRUG1002",
"name": "Augmentin 625 Duo",
"generic_list": ["Amoxicillin", "Clavulanic Acid"],
"form_name": "Tablet"
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
medication_id: 'DRUG1001',
name: 'Dolo 650',
strength: '650mg',
generic_name: 'Paracetamol',
form_name: 'Tablet',
manufacturer: 'Micro Labs Ltd'
},
{
medication_id: 'DRUG1002',
name: 'Augmentin 625 Duo',
generic_list: ['Amoxicillin', 'Clavulanic Acid'],
form_name: 'Tablet'
}
])
};
fetch('https://api.eka.care/admin/datasets/v1/', 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/admin/datasets/v1/",
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([
[
'medication_id' => 'DRUG1001',
'name' => 'Dolo 650',
'strength' => '650mg',
'generic_name' => 'Paracetamol',
'form_name' => 'Tablet',
'manufacturer' => 'Micro Labs Ltd'
],
[
'medication_id' => 'DRUG1002',
'name' => 'Augmentin 625 Duo',
'generic_list' => [
'Amoxicillin',
'Clavulanic Acid'
],
'form_name' => 'Tablet'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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/admin/datasets/v1/"
payload := strings.NewReader("[\n {\n \"medication_id\": \"DRUG1001\",\n \"name\": \"Dolo 650\",\n \"strength\": \"650mg\",\n \"generic_name\": \"Paracetamol\",\n \"form_name\": \"Tablet\",\n \"manufacturer\": \"Micro Labs Ltd\"\n },\n {\n \"medication_id\": \"DRUG1002\",\n \"name\": \"Augmentin 625 Duo\",\n \"generic_list\": [\n \"Amoxicillin\",\n \"Clavulanic Acid\"\n ],\n \"form_name\": \"Tablet\"\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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/admin/datasets/v1/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"medication_id\": \"DRUG1001\",\n \"name\": \"Dolo 650\",\n \"strength\": \"650mg\",\n \"generic_name\": \"Paracetamol\",\n \"form_name\": \"Tablet\",\n \"manufacturer\": \"Micro Labs Ltd\"\n },\n {\n \"medication_id\": \"DRUG1002\",\n \"name\": \"Augmentin 625 Duo\",\n \"generic_list\": [\n \"Amoxicillin\",\n \"Clavulanic Acid\"\n ],\n \"form_name\": \"Tablet\"\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/admin/datasets/v1/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"medication_id\": \"DRUG1001\",\n \"name\": \"Dolo 650\",\n \"strength\": \"650mg\",\n \"generic_name\": \"Paracetamol\",\n \"form_name\": \"Tablet\",\n \"manufacturer\": \"Micro Labs Ltd\"\n },\n {\n \"medication_id\": \"DRUG1002\",\n \"name\": \"Augmentin 625 Duo\",\n \"generic_list\": [\n \"Amoxicillin\",\n \"Clavulanic Acid\"\n ],\n \"form_name\": \"Tablet\"\n }\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "2 medication upserted",
"data": {
"upserted": 2,
"inserted": 1,
"updated": 1,
"reactivated": 0,
"deactivated": 0,
"dry_run": false
}
}Authorizations
Access token for your workspace.
Query Parameters
Which catalog to act on.
medication, lab_test, symptom, diagnosis upsert leaves records not in the request alone; reconcile deactivates them.
upsert, reconcile Validate and count without writing.
Allow a reconcile that deactivates more than half of the catalog.
CSV only. Replace the whole catalog with the file. Not allowed with mode=reconcile.
Body
1- Medication
- LabTest
- Symptom
- Diagnosis
Your id for the drug.
200200Alternate names and short forms, used by search.
200Shown to end users. Defaults to name.
2003230064All generic (salt) components.
10064Dosage form. Matched case-insensitively against the accepted drug forms; a match links the drug to Eka's form, and any other value is stored as text without that link.
646432641286412864200Defaults to true on write.
Was this page helpful?

