Consent-request/init call giving error response

We are trying to make the consent-request/init API (https://dev.ndhm.gov.in/gateway/v0.5/consent-requests/init) call. Getting the response of something of this sort.

What should be the values that need to be passed in the body exactly? Trying to resolve the message "Invalid HIP or HIU or PHR id: "

Thanks in advance

If possible a reference implementation might help

Hey @Psingh07

please find the curl below,

curl–location–requestPOST’https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init’--header’accept: /’–header’X-CM-ID: ndhm’–header’Content-Type: application/json’–header’Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTEyMjUyMTUsImlhdCI6MTY1MTIyNDYxNSwianRpIjoiMDUzZWUzZTMtYWEwMy00NjAwLTk0NGUtZDE2ZDA1MzgyZDJlIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxYmQ0MzdkMS1jMzlkLTQ2NWYtOTYzMi00ZDhmNjIzNGMyNDAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJURVNUXzAwMiIsInNlc3Npb25fc3RhdGUiOiI1ZjdkNmExNC1jMTk3LTRkMjUtODQzYi0zOWRhNjZlMjVkYTMiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHA6Ly9sb2NhbGhvc3Q6OTAwNyJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsiSGlkSW50ZWdyYXRlZFByb2dyYW0iLCJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhlYWx0aF9sb2NrZXIiLCJoaXAiXX0sInJlc291cmNlX2FjY2VzcyI6eyJURVNUXzAwMiI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudElkIjoiVEVTVF8wMDIiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY3LjE2NSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXRlc3RfMDAyIiwiY2xpZW50QWRkcmVzcyI6IjEwLjIzMy42Ny4xNjUifQ.TPYzFRTdjwq1lhsurgAQGwcxXX9rvk9GxclE_b8kBXEYHI-xwMQ6EAp3BZmxKMRWNvGEerj_VQswq01ksCUw6LtBFc8wp4lpdF5vnHMu29bho9lW3mZgqFy8yXITwklYRpyYx0XCQ51u9DJUlPqZuLzCIIFj1MjDHj6Inrh5zYLsdsPqHAfHyArdjXKtpvCu7FKgohqFwMEX5LV25MEvBPOxldHSoO3CJ3lYv9briBk2gtoJdYkSSxb90XAC4hae50Ugni6xuBkbOV93A01bvZpZNqyvstA_AJtQGG8azwo_n4GlXfAABuF8sVkg1hXYu1A14G6JNVAhZzSlnBKj-w’–header’X-HIU-ID: IN0310000030’–data-raw’{
“requestId”: “104cd212-6367-4882-8ab0-3e6c58f7785c”,
“timestamp”: “2022-04-25T07:32:49.710000”,
“consent”: {
“purpose”: {
“text”: “Self Requested”,
“code”: “PATRQT”,
“refUri”: “”
},
“patient”: {
“id”: “anjub@ndhm”
},
“hiu”: {
“id”: “IN0310000030”
},
“requester”: {
“name”: “Dr. Pratap Singh”,
“identifier”: {
“type”: “DOCID”,
“value”: “doc29844”,
“system”: “”
}
},
“hiTypes”: [
“DiagnosticReport”,
“Prescription”,
“DischargeSummary”,
“OPConsultation”,
“ImmunizationRecord”,
“WellnessRecord”,
“HealthDocumentRecord”
],
“permission”: {
“accessMode”: “VIEW”,
“dateRange”: {
“from”: “2021-11-25T12:30:29.592Z”,
“to”: “2022-12-14T12:30:29.592Z”
},
“dataEraseAt”: “2022-12-31T12:30:29.592Z”,
“frequency”: {
“unit”: “HOUR”,
“value”: 1,
“repeats”: 10
}
}
}
}’

thanks

1 Like

Hey @Shubhanshu_Shukla thanks for responding,

We are clear with what the body should look like in this API call. Unfortunately this does not seem to help us.

  1. What should be the HIU ID we should be using in the body?
    a) Upon calling API consent-request/init with what is given in the curl provided by you -> we get 202 accepted
    b) But in response “consent-request/on-init” on our webhook URL we receive the error message that “Invalid HIP or HIU or PHR id : SBX_001384”. This can also be seen in the screen shot attached in the thread.

  2. Additionally, in what scenarios do we get this error message?

Facility id is your Serviced ID / HIP ID / HIU ID.

Can you help us with the Id that you are passing as from here we can only see service id Test-HIUe is valid for HIU .
kindly hit given API /v1/bridges/getServices from below swagger.
https://sandbox.abdm.gov.in/swagger/ndhm-devservice.yaml

thanks