Data On Fetch
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));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();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\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}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
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>"
}
}Consent and data flow
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
Data On Fetch
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));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();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/abdm/v1/hip/care-context/data/on-fetch");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\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}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
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>"
}
}Used in
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?

