Consent Approve
curl --request POST \
--url https://api.eka.care/abdm/v1/consents/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent_artefacts": [
{
"access_mode": "view",
"care_contexts": [
{
"display": "Heart Rate 2020",
"id": "heart-rate-2020"
}
],
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": [
"<string>"
],
"hip_id": "<string>"
}
],
"id": "<string>",
"access_mode": "view",
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": [
"<string>"
]
}
'import requests
url = "https://api.eka.care/abdm/v1/consents/approve"
payload = {
"consent_artefacts": [
{
"access_mode": "view",
"care_contexts": [
{
"display": "Heart Rate 2020",
"id": "heart-rate-2020"
}
],
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": ["<string>"],
"hip_id": "<string>"
}
],
"id": "<string>",
"access_mode": "view",
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": ["<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({
consent_artefacts: [
{
access_mode: 'view',
care_contexts: [{display: 'Heart Rate 2020', id: 'heart-rate-2020'}],
duration: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
erase_at: '2023-11-07T05:31:56Z',
hi_types: ['<string>'],
hip_id: '<string>'
}
],
id: '<string>',
access_mode: 'view',
duration: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
erase_at: '2023-11-07T05:31:56Z',
hi_types: ['<string>']
})
};
fetch('https://api.eka.care/abdm/v1/consents/approve', 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/consents/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consent_artefacts\": [\n {\n \"access_mode\": \"view\",\n \"care_contexts\": [\n {\n \"display\": \"Heart Rate 2020\",\n \"id\": \"heart-rate-2020\"\n }\n ],\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ],\n \"hip_id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"access_mode\": \"view\",\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/abdm/v1/consents/approve");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"consent_artefacts\": [\n {\n \"access_mode\": \"view\",\n \"care_contexts\": [\n {\n \"display\": \"Heart Rate 2020\",\n \"id\": \"heart-rate-2020\"\n }\n ],\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ],\n \"hip_id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"access_mode\": \"view\",\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\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/abdm/v1/consents/approve")
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 \"consent_artefacts\": [\n {\n \"access_mode\": \"view\",\n \"care_contexts\": [\n {\n \"display\": \"Heart Rate 2020\",\n \"id\": \"heart-rate-2020\"\n }\n ],\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ],\n \"hip_id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"access_mode\": \"view\",\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ]\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 manager
Consent Approve
This endpoint is used to approve the consent
POST
/
abdm
/
v1
/
consents
/
approve
Consent Approve
curl --request POST \
--url https://api.eka.care/abdm/v1/consents/approve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"consent_artefacts": [
{
"access_mode": "view",
"care_contexts": [
{
"display": "Heart Rate 2020",
"id": "heart-rate-2020"
}
],
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": [
"<string>"
],
"hip_id": "<string>"
}
],
"id": "<string>",
"access_mode": "view",
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": [
"<string>"
]
}
'import requests
url = "https://api.eka.care/abdm/v1/consents/approve"
payload = {
"consent_artefacts": [
{
"access_mode": "view",
"care_contexts": [
{
"display": "Heart Rate 2020",
"id": "heart-rate-2020"
}
],
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": ["<string>"],
"hip_id": "<string>"
}
],
"id": "<string>",
"access_mode": "view",
"duration": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"erase_at": "2023-11-07T05:31:56Z",
"hi_types": ["<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({
consent_artefacts: [
{
access_mode: 'view',
care_contexts: [{display: 'Heart Rate 2020', id: 'heart-rate-2020'}],
duration: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
erase_at: '2023-11-07T05:31:56Z',
hi_types: ['<string>'],
hip_id: '<string>'
}
],
id: '<string>',
access_mode: 'view',
duration: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
erase_at: '2023-11-07T05:31:56Z',
hi_types: ['<string>']
})
};
fetch('https://api.eka.care/abdm/v1/consents/approve', 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/consents/approve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"consent_artefacts\": [\n {\n \"access_mode\": \"view\",\n \"care_contexts\": [\n {\n \"display\": \"Heart Rate 2020\",\n \"id\": \"heart-rate-2020\"\n }\n ],\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ],\n \"hip_id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"access_mode\": \"view\",\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ]\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.eka.care/abdm/v1/consents/approve");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n \"consent_artefacts\": [\n {\n \"access_mode\": \"view\",\n \"care_contexts\": [\n {\n \"display\": \"Heart Rate 2020\",\n \"id\": \"heart-rate-2020\"\n }\n ],\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ],\n \"hip_id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"access_mode\": \"view\",\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\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/abdm/v1/consents/approve")
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 \"consent_artefacts\": [\n {\n \"access_mode\": \"view\",\n \"care_contexts\": [\n {\n \"display\": \"Heart Rate 2020\",\n \"id\": \"heart-rate-2020\"\n }\n ],\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ],\n \"hip_id\": \"<string>\"\n }\n ],\n \"id\": \"<string>\",\n \"access_mode\": \"view\",\n \"duration\": {\n \"from\": \"2023-11-07T05:31:56Z\",\n \"to\": \"2023-11-07T05:31:56Z\"\n },\n \"erase_at\": \"2023-11-07T05:31:56Z\",\n \"hi_types\": [\n \"<string>\"\n ]\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
Query Parameters
OID is used to Identify the user.
Body
application/json
List of consent artefacts.
Show child attributes
Show child attributes
Unique identifier of a consent, also called the consent ID.
Available options:
view Show child attributes
Show child attributes
Response
No Content
Was this page helpful?

