V0.5/consent-requests/init : max retries exceeded error

Hi,

I am trying to call the https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init

API from the code deployed in a container (GCP

Cloud run https url) but it is giving me the following error :

HTTPSConnectionPool(host=‘dev.abdm.gov.in’, port=443): Max retries exceeded with url: /gateway/v0.5/consent-requests/init (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x3ee93f598850>: Failed to establish a new connection: [Errno 110] Connection timed out’))

But from my laptop (localhost) the code is working, I am able to call the API and get the Callback Request.

(i.e. there is no problem in request header and body)

Code deployed in a containerised environment works perfect with https://dev.ndhm.gov.in

Is there any kind of whitelisting needed at Dev.abdm.gov.in to serve the request originating from a specific url. Could somebody kindly help with documentation on setting this up.

Hi @sebisamuel20

Could you please send API curl? The image is not loading.

Thanks

Hi @Arvind_Tomar

Following is the Curl for which the API does not work:
curl --location --request POST ‘https://abdm-callback-url-flqcuu6xbq-uc.a.run.app/v1/healo-hiu/consent-requests/init
–header ‘Content-Type: application/json’
–data-raw ‘{
“requestId”: “0a5f15eb-4b0b-4f45-8110-b596c1c7a9bd”,
“timestamp”: “2022-02-12T07:55:42.852000”,
“purpose”: {
“text”: “Testing the flow”,
“code”: “CAREMGT”
},
“patient”: {
“id”: “navaneethpk@sbx”
},
“hiu”: {
“id”: “avyaan-hiu”
},
“requester”: {
“name”: “Dr. Navaneeth”,
“identifier”: {
“type”: “REGNO”,
“value”: “MH1001”,
“system”: “https://www.mciindia.org
}
},
“hiTypes”: [
“OPConsultation”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “2020-08-09T10:36:21.160Z”,
“to”: “2021-08-08T10:36:21.160Z”
},
“dateEraseAt”: “2022-08-08T10:36:21.160Z”,
“frequency”: {
“unit”: “HOUR”,
“value”: 1,
“repeats”: 1
}
}
}’

And following is the Curl for which the API works:

curl --location --request POST ‘http://localhost:8000/v1/healo-hiu/consent-requests/init
–header ‘Content-Type: application/json’
–data-raw ‘{
“requestId”: “37562ec4-1be5-423d-8041-2953f64657a6”,
“timestamp”: “2022-02-12T07:55:42.852000”,
“purpose”: {
“text”: “Testing the flow”,
“code”: “CAREMGT”
},
“patient”: {
“id”: “navaneethpk@sbx”
},
“hiu”: {
“id”: “avyaan-hiu”
},
“requester”: {
“name”: “Dr. Navaneeth”,
“identifier”: {
“type”: “REGNO”,
“value”: “MH1001”,
“system”: “https://www.mciindia.org
}
},
“hiTypes”: [
“OPConsultation”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “2020-08-09T10:36:21.160Z”,
“to”: “2021-08-08T10:36:21.160Z”
},
“dataEraseAt”: “2022-08-08T10:36:21.160Z”,
“frequency”: {
“unit”: “HOUR”,
“value”: 1,
“repeats”: 1
}
}
}’

Thanks for looking into this issue and hope this gives you a clear idea.

Hi @sebisamuel20

Please follow the curl given in below.

curl --location --request POST ‘https://dev.ndhm.gov.in/gateway/v0.5/consent-requests/init
–header ‘accept: /
–header ‘X-CM-ID: sbx’
–header ‘Content-Type: application/json’
–header ‘Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDQ5MjUyODksImlhdCI6MTY0NDkyNDY4OSwianRpIjoiMWZmMThiYjYtYTQ4NC00ZWE5LTg4YTQtYjQ1MWNjOGFjMjIyIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxYmQ0MzdkMS1jMzlkLTQ2NWYtOTYzMi00ZDhmNjIzNGMyNDAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJURVNUXzAwMiIsInNlc3Npb25fc3RhdGUiOiJjNTQ2YTFkNS04NDY2LTQyMjItODVlMi0xMGQ2ZTUyMzczNTIiLCJhY3IiO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22GmqCsBIrLC5JLCoS-Dn1l1oKF19MdPnwwrSxDvQSoQYszKdX7VsTQWtPbQhW50YEoLCLamcoLgyMU3o1JEPLC9XKlfJOYMcAY5zl0FMaoQP2xp6kzy6ZRBJ7Fr6vcwoM5I_Xl-cALWr5Dg_SqoqvuAEolKcwRhKEVlpW2JcLLu03eNw0eivtZr44plBase1cIETd_Wxd_-F401tGOMvb-WuYJaZpEhXGzcmdXhhdO4ku71h-qrtFYr38ppvhtQr4IfHjAFaOzK3bZCh4ym9zbiSUSGKTQ7A60zVPPO4MIde3RPKQTA’
–header ‘Cookie: TS01960242=01115a1c90d56d99ce88667090cc2bf7b229699d19c80da51308901e172e52e20f973017e8d99fa891441a99f018fd11bf3f8cb2d3’
–data-raw ‘{
“requestId”: “afcac6cd-0e55-45b5-81f2-4c3ca8a29df2”,
“timestamp”: “2022-02-15T11:37:10.130000”,
“consent”: {
“purpose”: {
“code”: “PATRQT”,
“text”: “Self Requested”,
“refUri”: “string”
},
“patient”: {
“id”: “arvind.t@sbx”
},
“hip”: {
“id”: “Demo_001”,
“name”: null
},
“hiu”: {
“id”: “TEST-DEMO”
},
“requester”: {
“name”: “Dr.Arvind”,
“identifier”: {
“type”: “REGNO”,
“value”: “MH1002”,
“system”: “https://www.mciindia.org
}
},
“hiTypes”: [
“Prescription”,
“DiagnosticReport”,
“OPConsultation”,
“DischargeSummary”,
“ImmunizationRecord”,
“HealthDocumentRecord”,
“WellnessRecord”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “2021-12-02T04:39:04.368Z”,
“to”: “2025-12-03T04:39:04.368Z”
},
“dataEraseAt”: “2124-12-11T05:58:07.740443”,
“frequency”: {
“unit”: “HOUR”,
“value”: 1,
“repeats”: 1
}
}
}
}’

Please let us know if it is working fine.

Thanks

Hey @Arvind_Tomar, sorry for the late reply

Can you tell me from where do we get the X-Auth-Token?

Hi @sebisamuel20

X-Auth-Token same as an authorization token no need for X-Auth-Token. It is working fine with Authorization. please try the given curl without X-Auth-Token and let me know is it working.

Webhook Response

{
“requestId”: “a1ff39e5-af9a-41f8-b753-52ac2976d77d”,
“timestamp”: “2022-02-19T12:28:40.324473”,
“consentRequest”: {
“id”: “d82589ec-7971-4623-8f6a-95144488ea92”
},
“error”: null,
“resp”: {
“requestId”: “cdf4aaea-6a22-4821-ac8f-377f68a2a4ec”
}
}

Thanks