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));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();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/mr/api/v1/docs");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Pt-Id", "<x-pt-id>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\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}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
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
}Medical Records
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));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();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/mr/api/v1/docs");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Pt-Id", "<x-pt-id>");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\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}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
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
Was this page helpful?

