Step 1: Upload Record
curl --request POST \
--url https://api.eka.care/mr/api/v1/docs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Pt-Id: <x-pt-id>' \
--data '
{
"batch_request": [
{
"dt": "ps",
"dd_e": 1614556800,
"tg": [
"tag1",
"tag2"
],
"files": [
{
"contentType": "image/jpeg",
"file_size": 110000
}
],
"document_id": "d1ed9519-d2aa-400b-a572-6e00701b9fb3"
}
]
}
'import requests
url = "https://api.eka.care/mr/api/v1/docs"
payload = { "batch_request": [
{
"dt": "ps",
"dd_e": 1614556800,
"tg": ["tag1", "tag2"],
"files": [
{
"contentType": "image/jpeg",
"file_size": 110000
}
],
"document_id": "d1ed9519-d2aa-400b-a572-6e00701b9fb3"
}
] }
headers = {
"X-Pt-Id": "<x-pt-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Pt-Id': '<x-pt-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
batch_request: [
{
dt: 'ps',
dd_e: 1614556800,
tg: ['tag1', 'tag2'],
files: [{contentType: 'image/jpeg', file_size: 110000}],
document_id: 'd1ed9519-d2aa-400b-a572-6e00701b9fb3'
}
]
})
};
fetch('https://api.eka.care/mr/api/v1/docs', 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/mr/api/v1/docs",
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([
'batch_request' => [
[
'dt' => 'ps',
'dd_e' => 1614556800,
'tg' => [
'tag1',
'tag2'
],
'files' => [
[
'contentType' => 'image/jpeg',
'file_size' => 110000
]
],
'document_id' => 'd1ed9519-d2aa-400b-a572-6e00701b9fb3'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Pt-Id: <x-pt-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/mr/api/v1/docs"
payload := strings.NewReader("{\n \"batch_request\": [\n {\n \"dt\": \"ps\",\n \"dd_e\": 1614556800,\n \"tg\": [\n \"tag1\",\n \"tag2\"\n ],\n \"files\": [\n {\n \"contentType\": \"image/jpeg\",\n \"file_size\": 110000\n }\n ],\n \"document_id\": \"d1ed9519-d2aa-400b-a572-6e00701b9fb3\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Pt-Id", "<x-pt-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/mr/api/v1/docs")
.header("X-Pt-Id", "<x-pt-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"batch_request\": [\n {\n \"dt\": \"ps\",\n \"dd_e\": 1614556800,\n \"tg\": [\n \"tag1\",\n \"tag2\"\n ],\n \"files\": [\n {\n \"contentType\": \"image/jpeg\",\n \"file_size\": 110000\n }\n ],\n \"document_id\": \"d1ed9519-d2aa-400b-a572-6e00701b9fb3\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/mr/api/v1/docs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Pt-Id"] = '<x-pt-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"batch_request\": [\n {\n \"dt\": \"ps\",\n \"dd_e\": 1614556800,\n \"tg\": [\n \"tag1\",\n \"tag2\"\n ],\n \"files\": [\n {\n \"contentType\": \"image/jpeg\",\n \"file_size\": 110000\n }\n ],\n \"document_id\": \"d1ed9519-d2aa-400b-a572-6e00701b9fb3\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "",
"batch_response": [
{
"document_id": "<string>",
"forms": [
{
"url": "<string>",
"fields": {}
}
],
"error_details": {
"message": "<string>",
"code": "<string>"
}
}
]
}{
"error": true,
"message": "Invalid document type.",
"batch_response": [],
"upload_time": null
}Add
Step 1: Upload Record
Generate a presigned URL that allows you to securely upload a document to the server. This URL can be used to upload the document directly without needing additional authentication or authorization steps.
POST
/
mr
/
api
/
v1
/
docs
Step 1: Upload Record
curl --request POST \
--url https://api.eka.care/mr/api/v1/docs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Pt-Id: <x-pt-id>' \
--data '
{
"batch_request": [
{
"dt": "ps",
"dd_e": 1614556800,
"tg": [
"tag1",
"tag2"
],
"files": [
{
"contentType": "image/jpeg",
"file_size": 110000
}
],
"document_id": "d1ed9519-d2aa-400b-a572-6e00701b9fb3"
}
]
}
'import requests
url = "https://api.eka.care/mr/api/v1/docs"
payload = { "batch_request": [
{
"dt": "ps",
"dd_e": 1614556800,
"tg": ["tag1", "tag2"],
"files": [
{
"contentType": "image/jpeg",
"file_size": 110000
}
],
"document_id": "d1ed9519-d2aa-400b-a572-6e00701b9fb3"
}
] }
headers = {
"X-Pt-Id": "<x-pt-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Pt-Id': '<x-pt-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
batch_request: [
{
dt: 'ps',
dd_e: 1614556800,
tg: ['tag1', 'tag2'],
files: [{contentType: 'image/jpeg', file_size: 110000}],
document_id: 'd1ed9519-d2aa-400b-a572-6e00701b9fb3'
}
]
})
};
fetch('https://api.eka.care/mr/api/v1/docs', 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/mr/api/v1/docs",
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([
'batch_request' => [
[
'dt' => 'ps',
'dd_e' => 1614556800,
'tg' => [
'tag1',
'tag2'
],
'files' => [
[
'contentType' => 'image/jpeg',
'file_size' => 110000
]
],
'document_id' => 'd1ed9519-d2aa-400b-a572-6e00701b9fb3'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Pt-Id: <x-pt-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/mr/api/v1/docs"
payload := strings.NewReader("{\n \"batch_request\": [\n {\n \"dt\": \"ps\",\n \"dd_e\": 1614556800,\n \"tg\": [\n \"tag1\",\n \"tag2\"\n ],\n \"files\": [\n {\n \"contentType\": \"image/jpeg\",\n \"file_size\": 110000\n }\n ],\n \"document_id\": \"d1ed9519-d2aa-400b-a572-6e00701b9fb3\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Pt-Id", "<x-pt-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/mr/api/v1/docs")
.header("X-Pt-Id", "<x-pt-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"batch_request\": [\n {\n \"dt\": \"ps\",\n \"dd_e\": 1614556800,\n \"tg\": [\n \"tag1\",\n \"tag2\"\n ],\n \"files\": [\n {\n \"contentType\": \"image/jpeg\",\n \"file_size\": 110000\n }\n ],\n \"document_id\": \"d1ed9519-d2aa-400b-a572-6e00701b9fb3\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/mr/api/v1/docs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Pt-Id"] = '<x-pt-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"batch_request\": [\n {\n \"dt\": \"ps\",\n \"dd_e\": 1614556800,\n \"tg\": [\n \"tag1\",\n \"tag2\"\n ],\n \"files\": [\n {\n \"contentType\": \"image/jpeg\",\n \"file_size\": 110000\n }\n ],\n \"document_id\": \"d1ed9519-d2aa-400b-a572-6e00701b9fb3\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"error": false,
"message": "",
"batch_response": [
{
"document_id": "<string>",
"forms": [
{
"url": "<string>",
"fields": {}
}
],
"error_details": {
"message": "<string>",
"code": "<string>"
}
}
]
}{
"error": true,
"message": "Invalid document type.",
"batch_response": [],
"upload_time": null
}Constraints for File Upload:
- A client can create a maximum of 5 batches at a time.
- Each batch can include up to 10 files.
- All files in a batch must have the same content type.
- Images:
contentTypeJpg= “image/jpg”contentTypePng= “image/png”- Documents:
contentTypePdf= “application/pdf”
- Maximum size for PDF files:
pdfMaxSizeMb= 25 MB - Maximum size for image files:
imageMaxSizeMb= 10 MB
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
eka user id (OID)
Body
application/json
Show child attributes
Show child attributes
Was this page helpful?
⌘I

