cURL
curl --request POST \
--url https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"care_context_id": "<string>",
"checksum": "<string>",
"content": "<string>",
"media": "application/fhir+json"
}
],
"key_information": {
"crypto_alg": "<string>",
"curve": "<string>",
"dh_public_key": {
"expiry": "<string>",
"key_value": "<string>",
"parameters": "<string>"
},
"nonce": "<string>"
},
"page_count": 123,
"page_number": 123,
"transaction_id": "<string>"
}
'import requests
url = "https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch"
payload = {
"entries": [
{
"care_context_id": "<string>",
"checksum": "<string>",
"content": "<string>",
"media": "application/fhir+json"
}
],
"key_information": {
"crypto_alg": "<string>",
"curve": "<string>",
"dh_public_key": {
"expiry": "<string>",
"key_value": "<string>",
"parameters": "<string>"
},
"nonce": "<string>"
},
"page_count": 123,
"page_number": 123,
"transaction_id": "<string>"
}
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({
entries: [
{
care_context_id: '<string>',
checksum: '<string>',
content: '<string>',
media: 'application/fhir+json'
}
],
key_information: {
crypto_alg: '<string>',
curve: '<string>',
dh_public_key: {expiry: '<string>', key_value: '<string>', parameters: '<string>'},
nonce: '<string>'
},
page_count: 123,
page_number: 123,
transaction_id: '<string>'
})
};
fetch('https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch', 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/abdm/v1/hip/care-context/data/on-fetch",
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([
'entries' => [
[
'care_context_id' => '<string>',
'checksum' => '<string>',
'content' => '<string>',
'media' => 'application/fhir+json'
]
],
'key_information' => [
'crypto_alg' => '<string>',
'curve' => '<string>',
'dh_public_key' => [
'expiry' => '<string>',
'key_value' => '<string>',
'parameters' => '<string>'
],
'nonce' => '<string>'
],
'page_count' => 123,
'page_number' => 123,
'transaction_id' => '<string>'
]),
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/abdm/v1/hip/care-context/data/on-fetch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"care_context_id\": \"<string>\",\n \"checksum\": \"<string>\",\n \"content\": \"<string>\",\n \"media\": \"application/fhir+json\"\n }\n ],\n \"key_information\": {\n \"crypto_alg\": \"<string>\",\n \"curve\": \"<string>\",\n \"dh_public_key\": {\n \"expiry\": \"<string>\",\n \"key_value\": \"<string>\",\n \"parameters\": \"<string>\"\n },\n \"nonce\": \"<string>\"\n },\n \"page_count\": 123,\n \"page_number\": 123,\n \"transaction_id\": \"<string>\"\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/abdm/v1/hip/care-context/data/on-fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entries\": [\n {\n \"care_context_id\": \"<string>\",\n \"checksum\": \"<string>\",\n \"content\": \"<string>\",\n \"media\": \"application/fhir+json\"\n }\n ],\n \"key_information\": {\n \"crypto_alg\": \"<string>\",\n \"curve\": \"<string>\",\n \"dh_public_key\": {\n \"expiry\": \"<string>\",\n \"key_value\": \"<string>\",\n \"parameters\": \"<string>\"\n },\n \"nonce\": \"<string>\"\n },\n \"page_count\": 123,\n \"page_number\": 123,\n \"transaction_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch")
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 \"entries\": [\n {\n \"care_context_id\": \"<string>\",\n \"checksum\": \"<string>\",\n \"content\": \"<string>\",\n \"media\": \"application/fhir+json\"\n }\n ],\n \"key_information\": {\n \"crypto_alg\": \"<string>\",\n \"curve\": \"<string>\",\n \"dh_public_key\": {\n \"expiry\": \"<string>\",\n \"key_value\": \"<string>\",\n \"parameters\": \"<string>\"\n },\n \"nonce\": \"<string>\"\n },\n \"page_count\": 123,\n \"page_number\": 123,\n \"transaction_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"error": "<string>",
"source_error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": 123,
"error": "<string>",
"source_error": {
"code": "<string>",
"message": "<string>"
}
}Sharing
Push care context data to HIU
Use this API to push encrypted FHIR data to the HIU after receiving the abha.hip_data_fetch webhook.
The HIP is responsible for preparing ABDM-compliant FHIR bundles, encrypting them using the key information received in the webhook, and pushing the data through this API. Use the transaction_id from the webhook payload to correlate the request.
This API is only needed if you are not storing health data on Eka servers.
POST
/
abdm
/
v1
/
hip
/
care-context
/
data
/
on-fetch
cURL
curl --request POST \
--url https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entries": [
{
"care_context_id": "<string>",
"checksum": "<string>",
"content": "<string>",
"media": "application/fhir+json"
}
],
"key_information": {
"crypto_alg": "<string>",
"curve": "<string>",
"dh_public_key": {
"expiry": "<string>",
"key_value": "<string>",
"parameters": "<string>"
},
"nonce": "<string>"
},
"page_count": 123,
"page_number": 123,
"transaction_id": "<string>"
}
'import requests
url = "https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch"
payload = {
"entries": [
{
"care_context_id": "<string>",
"checksum": "<string>",
"content": "<string>",
"media": "application/fhir+json"
}
],
"key_information": {
"crypto_alg": "<string>",
"curve": "<string>",
"dh_public_key": {
"expiry": "<string>",
"key_value": "<string>",
"parameters": "<string>"
},
"nonce": "<string>"
},
"page_count": 123,
"page_number": 123,
"transaction_id": "<string>"
}
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({
entries: [
{
care_context_id: '<string>',
checksum: '<string>',
content: '<string>',
media: 'application/fhir+json'
}
],
key_information: {
crypto_alg: '<string>',
curve: '<string>',
dh_public_key: {expiry: '<string>', key_value: '<string>', parameters: '<string>'},
nonce: '<string>'
},
page_count: 123,
page_number: 123,
transaction_id: '<string>'
})
};
fetch('https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch', 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/abdm/v1/hip/care-context/data/on-fetch",
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([
'entries' => [
[
'care_context_id' => '<string>',
'checksum' => '<string>',
'content' => '<string>',
'media' => 'application/fhir+json'
]
],
'key_information' => [
'crypto_alg' => '<string>',
'curve' => '<string>',
'dh_public_key' => [
'expiry' => '<string>',
'key_value' => '<string>',
'parameters' => '<string>'
],
'nonce' => '<string>'
],
'page_count' => 123,
'page_number' => 123,
'transaction_id' => '<string>'
]),
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/abdm/v1/hip/care-context/data/on-fetch"
payload := strings.NewReader("{\n \"entries\": [\n {\n \"care_context_id\": \"<string>\",\n \"checksum\": \"<string>\",\n \"content\": \"<string>\",\n \"media\": \"application/fhir+json\"\n }\n ],\n \"key_information\": {\n \"crypto_alg\": \"<string>\",\n \"curve\": \"<string>\",\n \"dh_public_key\": {\n \"expiry\": \"<string>\",\n \"key_value\": \"<string>\",\n \"parameters\": \"<string>\"\n },\n \"nonce\": \"<string>\"\n },\n \"page_count\": 123,\n \"page_number\": 123,\n \"transaction_id\": \"<string>\"\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/abdm/v1/hip/care-context/data/on-fetch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entries\": [\n {\n \"care_context_id\": \"<string>\",\n \"checksum\": \"<string>\",\n \"content\": \"<string>\",\n \"media\": \"application/fhir+json\"\n }\n ],\n \"key_information\": {\n \"crypto_alg\": \"<string>\",\n \"curve\": \"<string>\",\n \"dh_public_key\": {\n \"expiry\": \"<string>\",\n \"key_value\": \"<string>\",\n \"parameters\": \"<string>\"\n },\n \"nonce\": \"<string>\"\n },\n \"page_count\": 123,\n \"page_number\": 123,\n \"transaction_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch")
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 \"entries\": [\n {\n \"care_context_id\": \"<string>\",\n \"checksum\": \"<string>\",\n \"content\": \"<string>\",\n \"media\": \"application/fhir+json\"\n }\n ],\n \"key_information\": {\n \"crypto_alg\": \"<string>\",\n \"curve\": \"<string>\",\n \"dh_public_key\": {\n \"expiry\": \"<string>\",\n \"key_value\": \"<string>\",\n \"parameters\": \"<string>\"\n },\n \"nonce\": \"<string>\"\n },\n \"page_count\": 123,\n \"page_number\": 123,\n \"transaction_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"code": 123,
"error": "<string>",
"source_error": {
"code": "<string>",
"message": "<string>"
}
}{
"code": 123,
"error": "<string>",
"source_error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
The API requires a Bearer token (JWT) for authentication.
Headers
Eka User ID (OID)
Partner User ID
Partner HIP ID
Body
application/json
Response
Accepted
Was this page helpful?
⌘I

