M3 Dcoument 03 03 2025 Faf0c9aecbsandbox
M3 Dcoument 03 03 2025 Faf0c9aecbsandbox
(ABDM_Milestone 3)
Version 2.5
Create on 03.03.2025
Contents
1 Base URL and X-CM-ID .................................................................................................................................................... 3
2 Terminology Definition:................................................................................................................................................... 3
3 Gateway flow .................................................................................................................................................................. 3
3.1 Overview.................................................................................................................................................................. 3
3.2 API Information Request & Response..................................................................................................................... 3
3.2.1 Auth token API .................................................................................................................................................. 3
3.2.2 OpenID Configuration API ................................................................................................................................. 5
3.2.3 OAuth Certificate API ........................................................................................................................................ 6
3.2.4 Update bridge URL API...................................................................................................................................... 9
3.2.5 Registration of Facility & Software Linkage..................................................................................................... 10
3.2.6 Find bridge by service id ................................................................................................................................. 12
3.2.7 Find services by bridge id................................................................................................................................ 14
4 Consent flow ................................................................................................................................................................. 17
4.1 Overview................................................................................................................................................................ 17
4.2 Sequence Diagram ................................................................................................................................................. 19
4.3 API Information Request & Response................................................................................................................... 20
4.3.1 HIE-CM - Consent request init ........................................................................................................................ 20
4.3.2 HIE-CM- Consent request init - call back ........................................................................................................ 46
4.3.3 HIE-CM- Callback API to HIU when a consent request is APPROVED/REVOKED/DENIED .............................. 48
4.3.4 HIE-CM – API for HIU to respond back to consent HIU callback ..................................................................... 50
4.3.5 HIE-CM- Consent request status ..................................................................................................................... 53
4.3.6 HIE-CM - Consent request on-status (Callback) .............................................................................................. 56
4.3.7 HIE-CM - Consent request fetch...................................................................................................................... 58
4.3.8 HIE-CM - Consent request on-fetch (callback) ................................................................................................ 61
5 Data flow ....................................................................................................................................................................... 67
5.1 Overview................................................................................................................................................................ 67
5.2 Sequence Diagram ................................................................................................................................................. 67
5.3 API Information Request & Response................................................................................................................... 68
5.3.1 Data flow – Data request invoked by HIU ....................................................................................................... 68
1
5.3.2 Data flow – call back to HIU ............................................................................................................................ 72
5.3.3 Notify .............................................................................................................................................................. 74
6 Subscription flow .......................................................................................................................................................... 76
6.1 Overview................................................................................................................................................................ 76
6.2 Sequence Diagram ................................................................................................................................................. 76
6.3 API Information Request & Response................................................................................................................... 78
6.3.1 Users get subscription requests ...................................................................................................................... 78
6.3.2 User subscription request initiate................................................................................................................... 80
6.3.3 User Subscription request initiate – Call Back ................................................................................................ 82
6.3.4 Approve Subscription Request........................................................................................................................ 84
6.3.5 Approve Subscription – Call back.................................................................................................................... 88
6.3.6 Subscription Request Hiu – on notify ............................................................................................................. 91
6.3.7 Deny Subscription Request ............................................................................................................................. 92
6.3.8 Deny Subscription – Call Back ......................................................................................................................... 94
6.3.9 Edit Subscription ............................................................................................................................................. 95
6.3.10 Edit Subscription – call back ......................................................................................................................... 99
6.3.11 Subscription HIU –notify ............................................................................................................................. 100
6.3.12 Subscription HIU –On-notify ....................................................................................................................... 104
7 API listing..................................................................................................................................................................... 105
2
1 Base URL and X-CM-ID
Environment Base URL X-CM-ID
2 Terminology Definition:
Bridge ID: Is client ID which provided by NHA to HIP (Its alphanumerical eg: SBX_00XXXX)
Service ID: Is Facility ID which is generated from NHPR application (Its alphanumeric eg:
IN02100000XX)
3 Gateway flow
3.1 Overview
This is the key ABDM building block that manages ABHA addresses, maintains links to
health data for each ABHA address and manages consents provided by the user for
sharing of their health data. It also supports exchange of interoperable health data
between HIPs and HIUs.
The HIE-CM enables exchange of personal health data with consent as per the Health
Data Management Policy issued by NHA.
URL: /api/hiecm/gateway/v3/sessions
Request: POST
Header Parameters:
Property Name Example Value Required Description
3
REQUEST-ID 18235d89-cb13-479d-ad71- Yes Unique UUID for tracking the end-
7a57d5f669a8 toend request transaction
Body Parameters:
Property Name Example Value Required Description
Request Body:
Request Body
"clientId": "SBX_XXXXX",
"clientSecret": "XXXX-XXX-XXXX-XXXX-XXXXXXX",
"grantType": "client_credentials"
Response:
Response
"accessToken":
"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS
0ZrbkdiX1RCdkswIn0.eyJleHAiOjE3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5
Response:
Response
Code : 202 OK
"jwks_uri": "https://dev.abdm.gov.in/api/hiecm/gateway/v3/certs"
URL: /api/hiecm/gateway/v3/certs
Request: GET
Header Parameters:
Property Name Example Value Required Description
Response:
Response
Code : 202 OK
6
{
"keys": [
"e": "AQAB",
"kid": "AlRb5WCm8Tm9EJ_IfO9z06j9oCv51pKKFknGb_TBvK0",
"kty": "RSA",
"n": "mgmW7W5ZGF_G5cJevwYi8HiPcI-6qS_psnZxa4v3bkwAkyOoOd8-6ketrOI-
ZA2PbRbGnxFfZHiI94rdFXJ4Q9ampscsz9NocTIPMPmWydJ8A50pZaYWyikYDSJiDltq7i3WspPKSOuQHrC
5h9dMcCVveX5oeg0tO68Z79gwDlpcxiqDbFaphsqDvx-
5XkfwiqvOBaybK6_BCBPuTqWMUEuUklLYXu2X7ESHdVNFMFAjxCcCXUtP7LFdvT3nnFekRmG82QbSQSVe
4N5tPH8q0MCxSWWn2c15bDnzOF-dvfRCVPRabCzw0M-utHR9diTrWtq6Koi5buxgwM1rbk0p8Q",
"use": "sig",
"x5c": [
"MIICrzCCAZcCBgFy/3WZBjANBgkqhkiG9w0BAQsFADAbMRkwFwYDVQQDDBBjZW50cmFsLXJlZ2lzdHJ5
MB4XDTIwMDYyOTA5NDEzNloXDTMwMDYyOTA5NDMxNlowGzEZMBcGA1UEAwwQY2VudHJhbC1yZWdpc
3RyeTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJoJlu1uWRhfxuXCXr8GIvB4j3CPuqkv6b
J2cWuL925MAJMjqDnfPupHraziPmQNj20Wxp8RX2R4iPeK3RVyeEPWpqbHLM/TaHEyDzD5lsnSfAOdKWW
mFsopGA0iYg5bau4t1rKTykjrkB6wuYfXTHAlb3l+aHoNLTuvGe/YMA5aXMYqg2xWqYbKg78fuV5H8Iqrzg
WsmyuvwQgT7k6ljFBLlJJS2F7tl+xEh3VTRTBQI8QnAl1LT+yxXb0955xXpEZhvNkG0kElXuDebTx/KtDAsUllp9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MDQyODA4MjEzN1owGzEZMBcGA1UEAwwQY2VudHJhbC1yZWdpc
3RyeTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAIwznoYDM7qzUE9FiQk1jemt+Ot/biCjiztS
512XrP5E2pFoeokcZpBMSywg+zCY8/Woo0x8CLigLTgkmxTqcG6knxenTAUtnPHL9AFN6RPJEjKRiSg2fXYg
PgblK4sK/QVGElFvPkjOvEB/xwms9ppjf2fMp00OJFsPyHY/np1aZB2LatNA64hvfJekVxdQKPSndenLaDW7Y
bkGB9EUkSF57dELZuBkgGO2mzwjWuuJoq9PmrpXVPu9gyR18A6OoOThs+hDJvOmQFf6b4f+WMxaX5FA
PEytixVQJgt1KfiDMb9MjDChWY5BRgNECmDJDEwua7i2hO3HnPp4wO3SUJ0CAwEAATANBgkqhkiG9w0B
AQsFAAOCAQEABYAcXOSr+WgOxKVmygID9WjB4rDuAVDyU3GmjBvckdWhYJuBX8Vs04hNVNgf904gqy
+D5wZIQU985stK3PdogFGN2jVw2kO9G3hG4/7uwYKqciKApT/pSPMeHRltHGp/Mwr6e5poVwgQyrn+Be
H373U1Q6eB1QUYnElP+16y7bbvQhfDAS2X9sqdfurB9YIL5xZMPddZaf7pPX8oWOVlB0XH1JEZfsX125qq0Xn
K8z/Rd8KI8zTfJw6D2Kzrk1WvQSlM5KnTQmcSk3kwDlW5Dg657dT49Y68mI4azq34q17JgBhTx3IbTuf94QT w7QC5wmFtO+hc6zPVODX8JWu7
8
],
"x5t": "-HZ-fkkNBhTsPHWrhATwlZflhdU",
"x5t2": "tjVDNCTx7Fn0TfM-6uHvbwjWlIxIaFtGxiZZ6uJFxr4",
"alg": "RS512"
Body Parameters:
Property Name Example Value Required Description
9
url https://webhook.site/b7 Yes Bridge base URL
99c0b8-4e75-4545- 8eb2-
d8c2d5f0c9f6
Request Body:
Request Body
{
"url": "https://webhook.site/b799c0b8-4e75-4545-8eb2-d8c2d5f0c9f6"
Response:
Response
Registration of facility:
10
“A” (Health Professional ID (HPID) creation), “B” (Facility Registration)
Parameters:
11
bridgeId Yes Valid Bridge Id to be linked. String Alphanumeric and
validity to be
checked by HIECM
BRIDGE. • name
HIP
can not be
more
than 15
characters., No is
special
character
allowed
(%$*#@(~&!), and
it should be unique
for every bridge for
a
facility
12
URL: /api/hiecm/gateway/v3/bridge-service/serviceId/{serviceId} Request: GET
Header Parameters:
Property Name Example Value Required Description
Authorization eyJhbGciOiJSUzUxMiJ9. Yes JWT Access token which was
eyJzdWIiOiJ2YXNhbnRoY issued by ABDM session API
Wt1bWFyLmtlc2F2YW5Ac after successful validation of
2J4IiwiY2xpZW50SWQiOi client id and secret.
JzYngiLCJzeXN0ZW0iOiJ
BQkhBLUEiLCJyZXF1ZXN0Z
XJJZCI6IlBIUi1XRUIiLCJwa
HJNb2JpbGUiOm51bGws
ImV4cCI6MTY2NzI5ODEx
NSwiaWF0IjoxNjY3MjkwO
TE1LCJwaHJBZGRyZXNzIjo
idmFzYW50aGFrdW1hci5
rZXNhdmFuQHNieCIsInR
4bklkIjoiYjEwMGM4ZDMt
NTE1ZC00YWFiLTg1OWQtY
zNlMTUwOTE3ZGY1In0
Response:
Response
Code : 200 Ok
"id": 1561,
"bridgeId": "SBX_XXXX",
"serviceId": "TestClinicHIP",
"name": "TestClinicHIP",
13
"isHip": true,
"isHiu": true,
"isPhr": false,
"endpoints": {},
"active": true,
URL: /api/hiecm/gateway/v3/bridge-services
Request: GET
Header Parameters:
Property Name Example Value Required Description
Authorization eyJhbGciOiJSUzUxMiJ9. Yes JWT Access token which was
eyJzdWIiOiJ2YXNhbnRoY issued by ABDM session API
Wt1bWFyLmtlc2F2YW5Ac after successful validation of
2J4IiwiY2xpZW50SWQiOi client id and secret.
JzYngiLCJzeXN0ZW0iOiJ
BQkhBLUEiLCJyZXF1ZXN0Z
XJJZCI6IlBIUi1XRUIiLCJwa
HJNb2JpbGUiOm
14
X-CM-ID sbx Yes Suffix of the consent manager
to which the request was
intended.
Response:
Response
Code : 200 Ok
"bridge": {
"id": "SBX_XXXX",
"name": "Testing",
"url": "https://abdcb.doctor9.com",
"active": true,
"blocklisted": false
},
"services": [
15
"id": "@#$%^&*(",
"name": "hello",
"types": [
"HIP",
"HIU"
],
"endpoints": {
"hipEndpoints": [
"use": "registration",
"connectionType": "HTTPS",
"address": "https://events.hookdeck.com/e/src_3gsnEgI941mh/registration"
},
"use": "data-upload",
"connectionType": "HTTPS",
"address": "https://events.hookdeck.com/e/src_3gsnEgI941mh/data-upload"
],
"hiuEndpoints": [
"use": "registration",
"connectionType": "HTTPS",
"address": "https://events.hookdeck.com/e/src_3gsnEgI941mh/registration"
},
16
{
"use": "data-upload",
"connectionType": "HTTPS",
"address": "https://events.hookdeck.com/e/src_3gsnEgI941mh/data-upload"
],
"healthLockerEndpoints": [
"use": "registration",
"connectionType": "HTTPS",
"address": "https://events.hookdeck.com/e/src_3gsnEgI941mh/registration"
},
"use": "data-upload",
"connectionType": "HTTPS",
"address": "https://events.hookdeck.com/e/src_3gsnEgI941mh/data-upload"
},
"active": true
4 Consent flow
4.1 Overview
The service used to handle consent management before sharing the health data between
the entities (HIP, HIU, PHIU)
17
There are a couple of essential attributes required for consent artefact like Purpose, HI
Types, Access mode, Requester, Range, and Validity.
HIE-CM will validate HIU requests for authenticity, replay attack, timestamp, ABHA address,
etc. The request will be saved into the database. The consent request id will be returned
to the called HIU for future tracking purposes.
The valid requests will be broadcasted to the priority queue and sent to all the ABDM
compliance Patient HIU (PHR application). The consent notification status will be saved into
the database.
Upon successful acknowledgment, the consent artifact will be generated and saved into
the database. HIECM will further share this consent artefact with HIP and HIU.
18
4.2 Sequence Diagram
19
4.3 API Information Request & Response
4.3.1 HIE-CM - Consent request init
This is an API that will be invoked by HIU to initiate a consent request to get data about a
patient.
While requesting and exchanging health information, there are meta codes that are
relevant to you if you are a HIU.
• Purpose of Use - defines what is the purpose of use of the health information that
a HIU is requesting for. The following are subset from
http://terminology.hl7.org/ValueSet/v3-PurposeOfUse
Code Display
CAREMGT
BTG
Care Management
Public Health
HPAYMT
Healthcare Payment
DSRCH Disease Specific Healthcare Research
Self-Requested
PATRQT
20
Authorization Gateway Session Token Yes JWT Access token which was
issued by ABDM session API
after successful validation of
client id and secret
Body Parameters:
Property Name Example Value Required Description
Patient abc@abdm Yes A unique and valid
ABHA address suffix
with @abdm for live
and @sbx for Sandbox
21
Requester-name Smith yes Name of the requester
Request Body:
Request Body
22
{
"consent": {
"hip": {
"id": "HIP_ID"
},
"hiu": {
"id": "HIU_ID"
},
"hiTypes": [
"Prescription",
"DiagnosticReport",
"DischargeSummary",
"ImmunizationRecord",
"HealthDocumentRecord",
"WellnessRecord",
"OPConsultation"
],
"patient": {
"id": "abhaaddress@sbx"
},
"purpose": {
"code": "CAREMGT",
"text": "Care Management",
"refUri": "www.abdm.gov.in"
},
"requester": {
"name": "Dr. Manju",
"identifier": {
"type": "REGNO",
"value": "MH1001",
"system": "https://www.mciindia.org"
}
},
"permission": {
"dateRange": {
"to": "2024-07-17T12:05:57.151Z",
"from": "1924-07-09T12:05:57.151Z"
},
"frequency": {
"unit": "DAY",
"value": 0,
"repeats": 0
},
"accessMode": "VIEW",
"dataEraseAt": "2124-11-09T00:00:00.000Z"
},
"careContexts": [
{
"patientReference": "xxxx@sbx",
"careContextReference": "COCa496bc2f-ca6c-4af5-b973-02e915fd9815"
}
23
]
}
}
Response Body:
Response
Code : 202 Accepted
Error scenarios:
Scenarios Request Body Response
"type": "text"
To verify when [ {
invalid RequestID
is pass in header { "code": "ABDM-1030: ",
"value": "{{$guid}}zxzzxs", }
}]
"value": "sbxdvdfvdf",
"type": "text"
24
]
Verify { {
message when
"consent": { "code": "ABDM-9999",
purpose text is
empty or null "purpose": { "message": "Consent purpose text
cannot be null"
"text": "",
}
"code": " CAREMGT",
"refUri": "string"
},
"patient": {
"id": "xxxxxxxxx@abdm"
},
"hip": {
"id": "HIP_ID"
},
"careContexts": [
"patientReference": "xxxxx@tmh",
"careContextReference": "Episode11"
],
"hiu": {
"id": "HIU_ID"
},
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH10XX",
25
"system": "https://www.xxxxxx.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
26
Verify { {
message when
"consent": { "code": "ABDM-9999: ",
purpose text is
not any of the "purpose": { "message": "Invalid purpose text, it must
27
Disease },
Specific
"hip": {
Healthcare
Research, Self "id": "SBX_HIP1"
Requested },
"careContexts": [
"patientReference": "xxxxx@tmh",
"careContextReference": "Episode11"
],
"hiu": {
"id": "HIU_ID"
},
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.xxxxxx.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
28
"dataEraseAt": "2023-05- 25T08:58:09.738Z",
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
Verify { {
message when
"consent": { "code": "ABDM-9999",
purpose code is
empty or null "purpose": { "message": "Consent purpose code
cannot be null"
"text": "Care Management",
}
"code": " ",
"refUri": "string"
},
"patient": {
"id": "xxxxxx@abdm"
},
"hip": {
"id": "HIP_ID"
},
"careContexts": [
"patientReference": "xxxxx@tmh",
"careContextReference": "Episode11"
],
"hiu": {
"id": "HIU_ID"
},
29
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.mciindia.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
30
Verify { {
message when
"consent": { "code": "ABDM-9999",
purpose text is
not any of the "purpose": { "message": "Invalid purpose code, it
must be in CAREMGT, BTG, PUBHLTH,
following: "text": "Care Management",
HPAYMT, DSRCH, PATRQT"
CAREMGT,
"code": "CARE", }
BTG, PUBHLTH,
HPAYMT, "refUri": "www.ref.com"
DSRCH,
},
PATRQT
"patient": {
"id": "xxxxxxx@abdm"
},
"hip": {
},
"careContexts": [
"patientReference": "xxxxxx@tmh",
"careContextReference": "Episode11"
],
"hiu": {
},
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.mciindia.org"
},
"hiTypes": [
"OPCONSULTATION",
31
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
32
Verify { {
message when
"consent": { "code": "ABDM-9999",
the refUri is
null, empty or "purpose": { "message": "Invalid consent purpose
invalid. refURI"
"text": "Care Management",
}
"code": "CARE",
"refUri": ""
},
"patient": {
"id": "xxxxxxx@abdm"
},
"hip": {
"id": "SBX_HIP1"
},
"careContexts": [
33
{
"patientReference": "batman@tmh",
"careContextReference": "Episode11"
],
"hiu": {
},
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.mciindia.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
34
}
Verify "permission": { {
message when
"accessMode": null, "code": "ABDM-9999",
the permission
access mode is "dateRange": { "message": Invalid accessMode, it must
null. be in VIEW, STORE, QUERY, STREAM"
"from": "2023-05-09T08:58:09.738Z",
}
"to": "2023-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
Verify "permission": { {
message when
"accessMode": “VIEW”, "code": "ABDM-9999",
the permission
date range is "dateRange": null, "message": “DateRange should not be
null. null or empty"
"dataEraseAt": "2023-05- 25T08:58:09.738Z",
}
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
35
Verify "permission": { {
message when
"accessMode": “VIEW”, "code": "ABDM-9999",
the permission
date range is in "message": “Invalid from/to date. Date
"dateRange": {
future.
must be a present/before date"
"from": "2026-05-09T08:58:09.738Z",
}
"to": "2028-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
Verify "permission": { {
message when
"accessMode": “VIEW”, "code": "ABDM-9999",
the dataEraseAt
is not a future "dateRange": { "message": “Invalid data erase date.
date.
Date must be a future date"
"from": "2023-05-09T08:58:09.738Z",
}
"to": "2024-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
36
Verify "permission": { {
message when
"accessMode": “VIEW”, "code": "ABDM-9999",
the permission
frequency is null. "message": “Frequency should not be
"dateRange": {
null or empty"
"from": "2023-05-09T08:58:09.738Z",
}
"to": "2024-05-10T08:58:09.738Z"
},
"frequency": null
Verify "permission": { {
message when
"accessMode": “VIEW”, "code": "ABDM-9999",
the frequency
unit is null. "message": “Frequency unit should not
"dateRange": {
be null or empty"
"from": "2023-05-09T08:58:09.738Z",
}
"to": "2024-05-10T08:58:09.738Z"
},
"frequency": {
"unit": null,
"value": 0,
"repeats": 0
37
Verify message { {
when null,
empty or invalid "consent": { "code": "ABDM-9999",
abha address.
"purpose": { "message": “Invalid ABHA
Address, it must start with Alphanumeric .
"text": "Care Management", and _ in the middle and must be ending
"code": "CARE", with @abdm or @sbx"
}
"refUri": ""
},
"patient": {
"id": "xxxxxxxx@abdm"
},
38
"hip": {
"id": "HIP_ID"
},
"careContexts": [
"patientReference": "batman@tmh",
"careContextReference": "Episode11"
],
"hiu": {
"id": "HIU_ID"
},
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.mciindia.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
"dataEraseAt": "2023-0525T08:58:09.738Z",
39
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
40
Verify { {
message
"consent": { "code": "ABDM-9999",
when null,
empty or "purpose": { "message": “Invalid Service ID, it must
be Alpha numeric and _ or - in middle"
invalid HIP or
"text": "Care Management",
HIU service id. }
"code": "CARE",
"refUri": ""
},
"patient": {
"id": "xxxxxxxxxxxx@abdm"
},
"hip": {
"id": "SBX_HIP1"
},
"careContexts": [
"patientReference": "batman@tmh",
"careContextReference": "Episode11"
],
"hiu": {
"id": "Sub_HIU"
},
"requester": {
41
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.mciindia.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
Verify { {
message
"consent": { "code": "ABDM-1031",
when null,
empty or "purpose": { "message": “HIP is mandatory when care
contexts are specified"
invalid HIP or
"text": "Care Management",
HIU service id. }
"code": "CARE",
"refUri": "www.ref.com"
42
43
44
},
"patient": {
"id": "18443810806440@abdm"
},
"hip": null,
"careContexts": [
"patientReference": "batman@tmh",
"careContextReference": "Episode11"
],
"hiu": {
"id": "Sub_HIU"
},
"requester": {
"identifier": {
"type": "REGNO1",
"value": "MH1001",
"system": "https://www.mciindia.org"
},
"hiTypes": [
"OPCONSULTATION",
"WELLNESSRECORD"
],
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "2023-05-09T08:58:09.738Z",
"to": "2023-05-10T08:58:09.738Z"
},
45
"dataEraseAt": "2023-05- 25T08:58:09.738Z",
"frequency": {
"unit": "HOUR",
"value": 0,
"repeats": 0
This API initiated by HIE-CM to get the consent request call back to HIU
Body Paramaters:
46
Property Name Example Value Required Description
consentRequest – id f29f0e59-8388-4698-9fe605db67aeac46 No The consent request id
generated for consent
init request.
Request Body:
Request Body
{
"consentRequest": {
"id": "05f14b1d-4465-453a-8249-1382d79d271d"
},
"error": null,
"response": {
"requestId": "4213ebf8-5f8a-45e4-a014-7a2eb875f213"
}
}
Response Body:
Response
Code : 202 Accepted
47
4.3.3 HIE-CM- Callback API to HIU when a consent request is
APPROVED/REVOKED/DENIED
Once the patient grants consent to the HIU, the CM notifies the HIU system of the
consent grant via the gateway. If the patient grants for multiple HIPs, then multiple
consent artefacts are generated - one for each HIP. The HIU now first fetches all the
consent-artefacts that were generated for his request.
URL: {{callback}} /api/v3/hiu/consent/request/notify Request: POST
Header Parameters:
Property Name Example Value Required Description
Body parameters:
Property Name Example Value Required Description
status GRANTED Yes The status of the consent
artefact
48
consentRequestId 3fa85f64-5717-4562b3fc- Yes The consent request
2c963f66afa6 id
"id": “3fa85f64-
5717-4562-b3fc-
2c963f66afa6”
Request Body:
Request Body:
{
"notification": {
"consentRequestId": "e3c74829-3f82-4f94-959e-e10f57bcd57b", "status":
"GRANTED",
"reason": null,
"consentArtefacts": [
{
"id": "<consent-artefact-id>"
}
]
}
}
Response Body:
Response
Status: 202 Accepted
49
4.3.4 HIE-CM – API for HIU to respond back to consent HIU callback
This API will be invoked by HIU to respond back to HIE-CM when they received notify call
after approve /deny / revoke.
/api/v3/hiu/consent/request/notify.
URL: /api/hiecm/consent/v3/request/hiu/on-notify
Request: POST
Header Parameters:
Property Name Example Value Required Description
Body parameters:
Property Name Example Value Required Description
status OK Yes The status of the consent
notify.
50
consentId 3fa85f64-5717-4562b3fc- Yes The consent artefact
2c963f66afa6 id
"message": "unable to
connect database"
Request Body:
Request Body:
{
"acknowledgement": [
{
"status": "OK",
"consentId": "e3c74829-3f82-4f94-959e-e10f57bcd57b"
}
],
"error": {
"code": "ABDM-1001",
"message": "unable to connect database"
},
"response": {
"requestId": "6f0b4665-a915-4c92-aa36-65afb4a2cd71"
}
}
Response Body:
Response
Status: 202 Accepted
Error Scenarios:
Scenarios Headers/Body Message
51
To verify when Request ID [ Access Denied
is Blank, null or empty in
header { Code : 403 Forbidden
"key": "REQUEST-ID",
"value": "",
"type": "text"
"key": "TIMESTAMP",
"value": "",
"type": "text"
}
Code - 400Bad Request
]
52
To verify when X- CM-ID [ Access Denied
is Blank, null or empty in
header { Code : 403 Forbidden
"value": "",
"type": "text"
REQUEST-ID 18235d89-cb13-479dad71- Yes Unique UUID for track the end to end
7a57d5f669a8 request transaction
Authorization Gateway Session Token Yes JWT Access token which was issued
by ABDM session API after successful
validation of client id and secret
Body Paramaters:
Property Name Example Value Required Description
Request Body:
Request Body:
53
{
"consentRequestId": "05f14b1d-4465-453a-8249-1382d79d271d"
}
Response Body:
Response
Code : 200 OK
Error scenarios:
"value": "",
"type": "text"
]
To verify when [ {
invalid RequestID
is pass in header { "code": "ABDM-1030: ",
"value": "{{$guid}}zxzzxs", }
"type": "text" Code - 400Bad Request
"type": "text"
54
When invalid [ {
Timestamp is
pass in header { "code": "ABDM-1016: ",
"value": "{{$isoTimestamp}}jhgftytgtyu", }
"type": "text"
"type": "text"
"value": "",
"type": "text"
55
When passing { Callback : {
invalid
"consentRequestId": "002e14ac-13" "error": {
Consent
Request Id } "code": "ABDM-1039: ",
},
"response": {
code - 200 OK
When { [
passing Null
"consentRequestId":null {
Consent
Request Id } "code": "ABDM-9999: ",
When body {
missing
"code": "ABDM-1064",
TIMESTAMP 2022-10-06T10:10:00.587Z Yes Actual time when request was initiated, ISO
Date time format represents date and time.
Body Parameters:
Property Name Example Value Required Description
consentRequest-id 18235d89-cb13-479dad71- Yes Unique UUID for consent request
7a57d5f669a8
resp null
Request Body:
Request Body:
{
"consentRequest": {
"id": "7d52fcd0-a52a-4d82-b9f5-a548e5053088", "status":
"REQUESTED"
},
"error": null,
"response": {
"requestId": "e1f08798-8949-4a23-a04e-fe0054397cf5"
},
"resp": null
}
Response
Code : 200 OK
57
4.3.7 HIE-CM - Consent request fetch
This API will be called to fetch the consent artifact details.
URL: /api/hiecm/consent/v3/fetch
Request: POST
Header Parameters:
Property Name Example Value Required Description
REQUEST-ID 18235d89-cb13-479dad71- Yes Unique UUID for track the end to end
7a57d5f669a8 request transaction
TIMESTAMP 2022-10-06T10:10:00.587Z Yes Actual time when request was initiated, ISO
Date time format represents date and time
Authorization Gateway Session Token Yes JWT Access token which was issued by
ABDM session API after successful
validation of client id and secret
Body parameters:
Property Name Example Value Required Description
58
consentId 18235d89-cb13- Yes Unique UUID of the validate the consent to
479d-ad717a57d5f669a8 share the data between HIP and HIU
Request Body:
Request Body:
{
"consentId": "d6a83f24-6c96-421e-b8b8-844e5344ef69"
}
Response Body:
Code : 202 OK
Error Scenarios:
Scenarios Headers/Body Message
"type": "text"
To verify [ {
when
{ "code": "ABDM-1030: ",
invalid
Request-ID is "key": "REQUEST-ID", "message": "Invalid request ID"
pass in header
"value": "{{$guid}}zxzzxs", }
"type": "text"
59
When [ Access Denied
Timestamp
{ Code : 403 Forbidden
is Blank, null or
empty in "key": "TIMESTAMP",
header.
"value": "",
"type": "text"
When [ {
invalid
{ "code": "ABDM-1016: ",
Timestamp is
pass in header "key": "TIMESTAMP", "message": "Invalid Timestamp"
"value": "{{$isoTimestamp}}jhgftytgtyu", }
"type": "text"
"type": "text"
"value": "",
"type": "text"
60
When passing { Callback : {
invalid Consent
artefact Id "consentId": "1769c167-0898-43" "error": {
},
"response": {
"requestId": "7c4c31da-dfd0-
4348a907c08ea4016cbe"
code - 200 OK
When { [
passing Null
"consentId": null {
Consent
artefact Id } "code": "ABDM-9999: ",
When body {
missing
"code": "ABDM-1064",
61
Property Name Example Value Required Description
REQUEST-ID 18235d89-cb13-479dad71- Yes Unique UUID for track the end to end
7a57d5f669a8 request transaction
TIMESTAMP 2022-10-06T10:10:00.587Z Yes Actual time when request was initiated, ISO
Date time format represents date and time
Body parameters:
Property Name Example Value Require d Descriptio n
62
Requester-name Smith Yes Name of the
requester
63
Signature bAJUnf7nY6Yn6A7JbR1ZFHtBmqCjXDW Yes Signature of
consent aretefact
ZaQte
F+XNgEImUchTgA4qp4i5KnUBXYsWuTK
Be
USf1cLFMUXGpQuD9OZzrMqA1PRnEWyh
0
lV9i1bsEm5VMBkeZa0ghQBc4Fj8g==
Request Body:
Request Body:
{
"consent": {
"status": "GRANTED",
"consentDetail": {
"consentId": "d6a83f24-6c96-421e-b8b8-844e5344ef69",
"hip": {
"id": "HIP_ID"
},
"hiu": {
"id": "HIU_ID"
},
"hiTypes": [
"Prescription",
"DiagnosticReport",
"DischargeSummary",
"ImmunizationRecord",
"HealthDocumentRecord",
"WellnessRecord",
"OPConsultation"
],
"patient": {
"id": "xxxxxx@sbx"
64
},
"purpose": {
"text": "Care Management", "code":
"CAREMGT",
"refUri": "www.abdm.gov.in"
},
"createdAt": "2024-08-09T05:00:03.265Z",
"requester": {
"name": "Dr. Manju",
"identifier": {
"value": "MH1001",
"type": "REGNO",
"system": "https://www.mciindia.org"
}
},
"permission": {
"accessMode": "VIEW",
"dateRange": {
"from": "1924-07-09T12:05:57.151Z",
"to": "2024-07-17T12:05:57.151Z"
},
"dataEraseAt": "2124-12-09T00:00:00.000Z",
"frequency": {
"unit": "DAY",
"value": 1,
"repeats": 0
}
},
"lastUpdated": "2024-08-09T05:00:03.144Z",
"careContexts": [
{
"patientReference": "xxxxxxx@sbx",
"careContextReference": "COCa496bc2f-ca6c-4af5-b973-02e915fd9815"
}
],
"schemaVersion": "v3",
"consentManager": {
"id": "sbx"
}
},
"signature": "pktEFkcXuMBPSCEb7ZbiRAOigEx3i5fvIVNS9CxAfgm7rRF9CoxyhO0OdX9Fe
CzmcobBeiqNdLkiX2eYXdTI1oWvvEnSgMYBXVRi4q9rUgXexJr+04QK6vk4lL2iwu6AfKqPTB8u
3LF4v5kmCTXqdmtlfRof+ue9avukW48yIij19okHYhTw2lOZQ=="
},
"error": null,
"response": {
65
"requestId": "c0027971-d2d3-4323-8353-881b7c8f7d2f"
},
"resp": null
}
Response Body:
Response
Code : 200 OK
66
5 Data flow
5.1 Overview
The process of Data flow starts once the HIECM has generated Consent artefact (Consent
artefact is generated only if the status of Consent request is “Granted”) and same is notified
to HIP and HIU.
HIU sends pushback URL to HIP via HIECM. HIP now bundles the care context or Health
data of the patient as per FHIR standards and share the data via pushback data URL.
HIECM is notified the status of the data shared both by HIU and HIP.
67
5.3 API Information Request & Response
5.3.1 Data flow – Data request invoked by HIU
The HIU system initiates data request for a patient’s health information to the HIP against
the relevant consent-artefact, through the CM.
As part of the data request, the HIU’s health repository embeds three key elements within
the health information request:
The consent ID corresponding to the consent artefact against which the information
request is being made.
A data push URL, which is a callback URL that indicators where the information can be
pushed by the HIP’s health repository. This URL can be different from the HIU’s access
URL, provided at the time of registration with the gateway. The HIU can specify a different
URL for the data flow, in order to keep its identity secret to the extent possible.
68
Several parameters such as the date-time range for the requested and a set of encryption
parameters for the HIP repository to encrypt the information. The Elliptic-curve Diffie–
Hellman based encryption standard is used for encrypting health information.
Upon receipt of the data-request, CM assigns a transaction ID (txn-id) for the entire data
flow and communicates this Id to the health repositories of the HIU and the HIP.
The HIU’s health repository relays all this information to the CM through the gateway.
From the CM, the information is relayed to the HIP’s health repository (via the HIE-CM).
URL: /api/hiecm/data-flow/v3/health-information/request
Request: POST
Body Parameters:
69
Consent ID 18235d89-cb13-479d-ad71-7a57d5f669a8 Yes Valid consent ID, which
HIU must obtain to request
patient data from a
HIP
70
{
"hiRequest": {
"consent": {
"id": "004ff8e6-a9d7-4963-822b-d9762179314e"
},
"dateRange": {
"from": "1924-07-09T12:05:57.151Z",
"to": "2024-07-17T12:05:57.151Z"
},
"dataPushUrl": "https://webhook.site/2cfcc184-5d29-4e2c-974d-3e56cbaa5cc1/v3/data/push",
"keyMaterial": {
"cryptoAlg": "ECDH",
"curve": "Curve25519",
"dhPublicKey": {
"expiry": "2124-11-09T00:00:00.000Z",
"parameters": "Curve25519/32byte random key",
"keyValue":
"BCpsBW37KgfLyjxJK0zHHG26hDjxzK368DEO4PapzFhQM0cghZziKuvJh5/anTnHitVHKMn0Owr1HvcH1fm0D pA="
},
"nonce": "0ka0stPfqmXWhX+ODC/iOFMO0PXFdRjBdcEGbv55qqc="
}
}
}
71
5.3.2 Data flow – call back to HIU
This is the callback API for acknowledgment of Health information request of HIU. CM
calls this API when it has validated the Health Information request given the consent id.
Either the hiRequest or error would need to be specified. If the health info request was
valid, then the hiRequest.transactionId specifies the transaction context against which HIP
would send over the data.
URL: {callback_url/api/v3/hiu/health-information/on-request
Request: POST
requestId “f29f0e59-8388-4698- Yes Unique UUID received from HIU while initiating
9fe6-05db67aeac46” the following
hiecm/api/v3/dataflow/healthinformation/request
Error Scenario:
{
"error": {
"code": "ABDM-1092",
"message": " Invalid or already expired consent artefact id "
},
"response": {
"requestId": "b07737a8-1c79-48cc-9fb4-1476c6bb1197"
}
}
Response
Code : 202 Accepted
73
5.3.3 Notify
This API will be called by HIU and HIP to notify the CM about the status of the data
transfer.
HIP on the transfer of data would send sessionStatus - one of [TRANSFERRED, FAILED]. HIP
would also send hiStatus for each careContextReference - on of [DELIVERED, ERRORED]
HIU on receipt of data would send sessionStatus - one of [RECEIVED, FAILED]. For
example, ERRORED when data was not sent or if invalid data was sent. HIU would also
send hiStatus for each careContextReference - one of [OK, ERRORED].
TIMESTAMP 2022-10-06T10:10:00.587Z Yes Actual time when request was initiated, ISO
Date time format represents date and time
Authorization Gateway Session Token Yes JWT Access token which was issued by ABDM
session API after
successful validation of client id and secret
transactionId 87624e00-21b5-43b1- Yes Unique UUID for track the end to end
8ae7-5adcb743ef7b request transaction
74
Notifier [ Yes Entity who is notifying HIE-CM
{
"type": "HIU",
"id": HIU_ID”
}]
"hipId": “HIP_ID",
"statusResponses": [{
"careContextRefer
ence": "9ec54c2f-
2f3541d6982846a93e83564e",
"hiStatus": "OK",
"description": "Care
Management"}]}
hiStatus "OK", Yes HIU would also send hiStatus for each
careContextReference - one of [OK,
ERRORED]
{
"notification": {
"consentId": "97312afb-c6a4-483e-8456-5c9c96beb83f",
"transactionId": "97312afb-c6a4-483e-8456-5c9c96beb83f",
"doneAt": "2024-08-09T08:45:55.984Z",
"notifier": {
"type": " HIU",
"id": "HIU_ID"
},
"statusNotification": {
"sessionStatus": "TRANSFERRED",
"hipId": "HIP_ID",
"statusResponses": [
{
"careContextReference": "9ec54c2f-2f35-41d6-9828-46a93e83564e",
"hiStatus": "OK",
75
"description": "Care Management"
}
]
}
}}
Code : 202
Accepted
6 Subscription flow
6.1 Overview
HIU should initiate subscription requests so that it receives notifications/alerts whenever
new information is available for the following categories.
While seeking subscription HIU needs to use the Gateway Subscription APIs identifying
itself as a HIU.
Once user grants subscription to HIU, the HIU will be notified against the subscribed
categories.
• If the subscription category is LINK - HIU should initiate a consent request
for the notified care context. Once the user grants the consent against the
request, HIU can initiate the data-request.
• In case subscription category is DATA - then the HIU should check if any
existing consent request is available (hiType and duration etc.) and use the
same to initiate the data-request.
76
77
6.3 API Information Request & Response
6.3.1 Users get subscription requests
This is an API will be invoked by the patient/user from the PHR application to fetch his/her
subscribed HIU details.
78
X-AUTHTOKEN Login Token Yes JWT Authentication token
which was issued by
ABDM after successful
validation of
username and password
Response:
Code: 202 OK
79
{
"limit": 5,
"size": 0,
"offset": 5,
"requests": [
{
"requestId": "f29f0e59-8388-4698-9fe6-05db67aeac46",
"subscriptionId": "f29f0e59-8388-4698-9fe6-05db67aeac46",
"requestType": "HEALTH_LOCKER",
"status": "GRANTED",
"details": {
"patient": {
"id": "xxxx@sbx"
},
"purpose": {
"text": "abc@abdm",
"code": "string",
"refUri": "string"
},
"hiu": {
"id": "HIU"
},
"hips": [
{
"id": "HIP"
}
],
"categories": [
"LINK"
],
"period": {
"from": "2023-01-18 05:19:33.429",
"to": "2023-01-18 05:19:33.429"
}
}
}
]}
80
REQUEST-ID 18235d89-cb13- Yes Unique UUID for track the end to end request
479d-ad717a57d5f669a8 transaction
TIMESTAMP 2022-10- Yes Actual time when request was initiated, ISO Date time
06T10:10:00.587Z format represents date and time
X-CM-ID sbx Yes Suffix of the consent manager to which the request was
intended
Authorization Gateway Session Token Yes JWT Access token which was issued by ABDM session
API after successful validation of client id and secret
Body parameters
Property Example Value Required Description
Name
subscription "purpose": { Purpose of Use - defines what is the purpose of
"text": "Care Management", use of the health information that a HIU is
"code": "CAREMGT", Yes requesting for. The following are subset from
"refUri": "www.abc.com2" http://terminology.hl7.org/ValueSet/v
} 3-PurposeOfUse
Patient "id": "xxxxxxxxx@abdm" Yes Patient ABHA address against which the health
records are linked
Hips [ NO
{
"id": "HIP_ID",
"name": "HIP_NAME",
"type": "HIP"
}
]
81
Request Body
Request Body:
{
"subscription": {
"purpose": {
"text": "Care Management",
"code": "CAREMGT",
"refUri": "www.abdm.gov.in"
},
"patient": {
"id": "xxxxx@sbx"
},
"hiu": {
"id": "HIU_ID"
},
"hips": [
{
"id": "HIP_ID",
"name": "HIP_NAME",
"type": "HIP"
}
],
"categories": [
"LINK",
"DATA"
],
"period": {
"from": "2024-06-01T09:00:00.000Z",
"to": "2124-12-31T09:00:00.000Z"
}
}
}
Response
Response:
Code: 202 Accepted.
82
REQUEST-ID 18235d89-cb13- Yes Unique UUID for track the end-to-end request transaction
479d-ad717a57d5f669a8
TIMESTAMP 2022-10- Yes Actual time when request was initiated, ISO Date time
06T10:10:00.587Z format represents date and time
Body parameters
Property Example Value Required Description
Name
subscription {
Request "id": "34c9b142-8a2c-4f4a-
8d98c305dbdbbcbb"
}
response {
"requestId": "c8bd00d4-58d1-
4d888b88a5f0c5817f06"
}
83
6.3.4 Approve Subscription Request
This Api will be invoked by the patient/user from PHR application to approve the
subscription request raised by the HIU
URL: /api/hiecm/subscription-
requests/v3/{{subscription_requestid}}/approve
Method: Post
Request Headers:
Property Example Value Required Description
Name
REQUEST- 18235d89-cb13-479d-ad71-7a57d5f669a8 Yes Unique UUID for track the
ID end to end request
transaction
84
X- Login JWT Token JWT Authentication token
AUTHTOKEN which was issued by ABDM
after successful validation of
username and password
Body parameters
Property Name Example Value Required Description
isApplicableForAllHIPs false This value can be false or true. In case
of false this will be notified to all the
HIPs available in the system and in
Yes
case of false this will be notified to the
specific HIP only
"text": "Care
Management",
"code": "CAREMGT",
"refUri":
"www.abc.com7"
}
85
Period { Period time for approving the
"from": "2023-04- subscription
04T09:52:39.235Z",
"to": "2023-
0420T09:52:39.235Z"
}
Request Body
Request Body:
86
{
"isApplicableForAllHIPs": false,
"includedSources": [
{
"hiTypes": [
"Prescription",
"DiagnosticReport",
"OPConsultation",
"DischargeSummary",
"ImmunizationRecord",
"HealthDocumentRecord",
"WellnessRecord"
],
"purpose": {
"text": "Care Management",
"code": "CAREMGT",
"refUri": "www.abc.com7"
},
"hip": {
"id": "HIP_ID",
"name": "HIP_NAME "
},
"categories": [
"DATA",
"LINK"
],
"period": {
"from": "2023-04-27T04:03:40.079Z",
"to": "2023-04-27T04:03:40.079Z"
}
}
]
} "LINK",
"DATA"
],
"period": {
"from": "2023-04-04T09:52:39.235Z",
"to": "2023-04-20T09:52:39.235Z"
}
} ],
"excludedSources": [
{
"hiTypes": [
"PRESCRIPTION"
],
"purpose": {
"text": "Self Requested",
"code": "PATRQT",
"refUri": "www.test.com"
},
"hip": {
87
"id": "",
"name": "string"
},
"categories": [
"LINK"
],
"period": {
"from": "2023-06-20T05:19:33.429Z",
"to": "2023-06-30T05:19:33.429Z"
}
}
]}
Response
Response:
{
"subscriptionId": "b6c88154-995b-45b0-b720-838e357c8192",
"message": "Successfully approved Subscription request"
}
time format
represents date and
time
88
Authorizati Gateway Session Token ABDM Gateway
on Session Token
Body parameters
Property Name Example Value Required Description
SubscriptionRequestId "57ab7ec0-ce1a-4d408cc3-
66172ac3f6ee",
Status GRANTED
Subscription {
"id": "b6c88154-995b- 45b0-
b720-838e357c8192",
"patient": {
"id": "xxxxxxx@sbx"
},
Hiu {
"id": "HIP_ID",
"name": "HIP_NAME",
"type": "HIU"
}
Sources [
{
"hip": {},
"categories": [
"DATA",
"LINK"
]
Period {
"from": "2023-04-
04T09:52:39.235Z",
"to": "2023-
0420T09:52:39.235Z"
}
Response
Response:
{
"notification": {
"subscriptionRequestId": "57ab7ec0-ce1a-4d40-8cc3-66172ac3f6ee", "status": "GRANTED",
"subscription": {
"id": "b6c88154-995b-45b0-b720-838e357c8192",
89
"patient": {
"id": "xxxxxx@sbx"
},
"hiu": {
"id": "HIU_ID",
"name": "HIU-NAME",
"type": "HIU"
},
"sources": [
{
"hip": {},
"categories": [
"DATA",
"LINK"
],
"period": {
"from": "2024-01-09T09:00:00.000Z",
"to": "2124-12-31T09:00:00.000Z"
}
}
]
}
}
}
90
6.3.6 Subscription Request Hiu – on notify
This is the API that will be invoked by the HIU to notify HIECM that HIU has raised the
subscription request.
TIMESTAMP 2022-10- Yes Actual time when request was initiated, ISO Date
06T10:10:00.587Z time format represents date and time
X-CM-ID sbx Yes Suffix of the consent manager to which the request
was intended
Authorization Gateway Session Token Yes JWT Access token which was issued by ABDM
session API after successful validation of client id
and secret
Body parameters
91
Property Name Example Value Required Description
acknowledgement { 1. This is the
"status": "OK", acknowledgement
"subscriptionRequestId": Yes from the HIU
"2b8ddd74-5e5e-475b8778-
21603e05a8b4"
}
Request Body
Request Body:
{
"acknowledgement": {
"status": "OK",
"subscriptionRequestId": "2b8ddd74-5e5e-475b-8778-21603e05a8b4"
},
"response": {
"requestId": "a4b51f47-f70f-4291-9599-8e39b7893cfc"
}
}
Response
Response:
Code: 202 Accepted
URL: /api/hiecm/subscriptionrequests/v3/{{subscription_id}}/deny
Method: Post
Request Headers:
Property Example Value Required Description
Name
92
REQUEST- 18235d89-cb13-479d-ad71-7a57d5f669a8 Yes Unique UUID for track the
ID end to end request
transaction
Body parameters
Property Name Example Value Required Description
Reason
False Yes
Request Body
Request Body:
{
"reason": "Not authorized"
}
Response
Response:
{
"message": "Successfully denied the subscription request"
}
93
202 Accepted
Body parameters
Property Name Example Value Required Description
94
notification {
"subscriptionRequestId":
"5f3ed8a6-7d1f-
48cbbbb0b87313798526",
"status": "DENIED"
Response
Response:
{
"notification": {
"subscriptionRequestId": " 5f3ed8a6-7d1f-48cb-bbb0-b87313798526", "reason":
"Not authorized1",
"status": "DENIED"
}
}
202 Accepted
Authorization Gateway Session Token Yes JWT Access token which was issued by
ABDM session API after successful
validation of client id and secret
Body Parameters:
Property Name Example Value Required Description
hiuId MOHAN-HIU HIU who raised the
request.
Yes
96
subscriptionEditAndApprovalRequest "includedSources": [ Yes Hi types, purpose should
{ be mentioned while
"hiTypes": [ editing the subscription
"PRESCRIPTIONs"
],
"purpose": {
"text": "Care
Management",
"code": "",
"refUri":
"www.amazon.com"
},
excludedSources [ optional
{
"hiTypes": [
"PRESCRIPTION"
],
"purpose": {
"text": "Self
Requested",
"code":
"PATRQT",
"refUri":
"www.amazon.com"
97
},
"hip": {
"id": "HIP-ID",
"name":
"HIP-NAME"
},
"categories": [
"LINK"
],
"period": {
"from":
"2023-06-
23T05:19:33.429Z",
"to": "2023-
06-30T05:19:33.429Z"
}
}
]
} }
Request Body:
Request Body:
{
"hiuId": "HIU_ID",
"subscriptionEditAndApprovalRequest": {
"isApplicableForAllHIPs": true,
"includedSources": [
{
"hiTypes": [
"DiagnosticReport",
"Prescription",
"ImmunizationRecord",
"DischargeSummary",
"OPConsultation",
"HealthDocumentRecord",
"WellnessRecord"
],
"purpose": {
"text": "Care Management",
"code": "CAREMGT",
"refUri": "www.abdm.gov.in"
},
"categories": [
"DATA",
"LINK"
],
"period": {
"from": "2024-01-09T09:00:00.000Z",
"to": "2123-12-31T09:00:00.000Z"
98
}
}
],
"excludedSources": []
}
}
Response
Response:
Code: 202 Accepted
{
"subscriptionId": "f9ca6ad7-ba8f-4257-b7ad-935a82a94480",
"message": "Successful creation of Subscriptions"
}
Body parameters
Property Name Example Value Required Description
99
notification {
"subscriptionRequestId":
"5f3ed8a6-7d1f-
48cbbbb0b87313798526",
"status": "DENIED"
Response
Response:
{
"notification": {
"subscriptionRequestId": " 5f3ed8a6-7d1f-48cb-bbb0-b87313798526", "reason":
"Not authorized1",
"status": "DENIED"
}
}
202 Accepted
Body Parameters:
Property Name Example Value Required Description
Event - "57ab7ec0-ce1a-4d408cc3-
SubscriptionRequestId 66172ac3f6ee",
Event-id 17fb377f-8675-402f-9c1b-
3e8857ef1fc8
Content- patient {
"id": "abha@sbx"
}
Content- hip {
"id": "HIP_ID"
}
Content- careContexts [
{
"patientReference":
"xxxxxx@sbx",
"careContextReference":
"db4423d5-62f7-44f887d2-
5fcb25c5a814"
}
Request Body:
Request Body:
101
{
"event": {
"id": "17fb377f-8675-402f-9c1b-3e8857ef1fc8",
"published": "2024-08-09 09:03:07.059",
"subscriptionId": "b6c88154-995b-45b0-b720-838e357c8192",
"category": "LINK",
"content": {
"patient": {
"id": "abha@sbx"
},
"hip": {
"id": "HIP_ID"
},
"contexts": [
{
"careContexts": [
{
"patientReference": "abah@sbx",
"careContextReference": "db4423d5-62f7-44f8-87d2-5fcb25c5a814"
}
],
"hiType": "Prescription"
}
]
}
}
102
103
6.3.12 Subscription HIU –On-notify
This is the API that will be invoked to HIU to notify HIECM about the link new record
notification received.
TIMESTAMP 2022-10- Yes Actual time when request was initiated, ISO Date time
06T10:10:00.587Z format represents date and time
X-CM-ID sbx Yes Suffix of the consent manager to which the request
was intended
Authorization Gatteway Session Token Yes JWT Access token which was issued by ABDM
session API after successful validation of client id
and secret
Body parameters
Property Name Example Value Required Description
acknowledgement { This is the acknowledgement from the
"status": "OK", HIU
"eventId": "2b8ddd74- Yes
5e5e-475b-877821603e05a8b4"
}
Request Body
Request Body:
{
104
"acknowledgement": {
"status": "OK",
"eventId": "2b8ddd74-5e5e-475b-8778-21603e05a8b4"
},
"response": {
"requestId": "a4b51f47-f70f-4291-9599-8e39b7893cfc"
}
}
Response
Response:
Code: 202 Accepted
7 API listing
No. Flow Serial v3 API Description
API will be invoked by the
patient/user from the PHR
application to fetch his/her
Subscripti /api/hiecm/subscriptionrequests/v3/requests?statu subscribed HIU details
on 4.1 s=ALL&limit=10&offset=0
API which will be invoked
by the HIU to initiate
subscription request to the
patient/user from PHR
4.2 /api/hiecm/subscriptionrequests/v3/init application
105
API that will be invoked by
the HIU to notify HIECM
that HIU has raised the
4.4 /api/hiecm/subscriptionrequests/v3/hiu/on-notify subscription request
106
/api/hiecm/dataflow/v3/healthinformation/request This api indicates the
exchange of health data
request from HIU to HIP
Data flow 4.17
callback API for
acknowledgment of
Health information
request of HIU. CM calls
this API when it has
validated the Health
Information request
given the consent id. •
Either the
hiRequest or error would
need to be specified. If
the health info request
was valid, then the
hiRequest.transactionId
specifies the transaction
context against which HIP
would send over the data
4.18 {callback_url/api/v3/hiu/he alth-information/onrequest
API will be called by HIU
and HIP to notify the CM
about the status of the
data transfer.
107
ABDM-1001 No data found
108
ABDM-1035 OTP does not matched
ABDM-1048 Timeout
109
ABDM-9999 Unknown exception
110