Getting response 'Invalid HIU Id' for Creation of Consent Request

Hey we are facing an issue while creating the consent request using https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init
This is how the request looks like

This is the response we are getting (‘Invalid HIU Id’)

Our client ID ‘MB_4062191’ is registered as HIU. We have ‘HIU’ under roles in the Authentication Token

Authentication Token - eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2Mzk4MTAyODQsImlhdCI6MTYzOTgwOTY4NCwianRpIjoiMzlkNTE2NTYtNTY2OC00YWFiLTlhOGQtNjA0YmYyZDM2NzFhIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI4NjUzYjJlYi04MDU2LTRlYmQtOTBhZS0yOGVmNDY3NDE2NzciLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJNQl80MDYyMTkxIiwic2Vzc2lvbl9zdGF0ZSI6IjZhZjAzM2Y3LWEyMWYtNDM2NC05ZDRkLTU3OTY1MTgzNWJkNyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfSwiTUJfNDA2MjE5MSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRJZCI6Ik1CXzQwNjIxOTEiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY5Ljk3IiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtbWJfNDA2MjE5MSIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjkuOTcifQ.Q2qmux8Qly6rUUHIL8D21wQZwX5jzyGv6EFHZt982GRkQlO39uTG-UN08ythFP7nVDfzoSJLrZYnlbIK_xAzgxOYw7qUH44nJ6vFkYh4XvAvIGw7GPeglk7dw840wkhklsYMLZTSHPLxn6TqgYs1Wbwv0f3-ntALMVUtMnANN9Yz8tDGJi2Wf10_3FCmO3W3GVN5bHF_hZIxHBsM57560DOB5pwBseuyNnMjyIDIQ35D-7-zANnMl3u2_MQuPC-t1HnRHyxPii38jzmRip85qfCWkkEHJ9uuYK0C3tGd3T4QN9oiPklwSIbBgcJGQGObsU7QuTsjCqAWLX6mnJuceQ

Any help on this will be appreciated. Do we need to register somewhere to be a HIU?

@Shubhanshu_Shukla @Arvind_Tomar

@Shubhanshu_Shukla @Arvind_Tomar We got a new client ID and secret as well. The consent-requests/on-init worked without error for a while but that too stopped working.
Kindly help

@nishtha,

Please send us the payload you are using.

you are suppose to pass service id here rather than bridge id

Thanks

@Shubhanshu_Shukla

curl --request POST \
  --url https://dev.abdm.gov.in/gateway/v0.5/consent-requests/init \
  --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDEyMDg0NDAsImlhdCI6MTY0MTIwNzg0MCwianRpIjoiMTY1ZmVkOGItNjFlOC00MTVhLThiODYtOWY1N2NjNTY0ODgxIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZ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A7lHRnNJ-x4QB6qFaxdToFyPIxNzHtAiXgTSdVyr1vYUuPAlxDlVtJqy0P4Vka1zPtcxTmwRTYQjvgsDQZPBG9VsK1Gsj7BAFUX9RRRlJIck_RZA' \
  --header 'Content-Type: application/json' \
  --header 'X-CM-ID: sbx' \
  --header 'X-HIU-ID: SBX_001380' \
  --cookie TS011c04bd=01115a1c90a5d9be213a941ea8c374457e24b40793944e4c593cf5fc93152b6ffbc6d8c2c0fe020e0ecd5171c3986cd7ac438047e5 \
  --data '{
     "requestId": "c222211f-ec62-41b2-8a2c-41757104e95d",
     "timestamp": "2022-01-03T11:04:30.431Z",
     "consent": {
        "purpose": {
            "text": "Care management",
            "code": "CAREMGT"
        },
        "patient": {
            "id": "nishtha@sbx"
        },
        "hiu": {
            "id": "SBX_001380"
        },
        "requester": {
            "name": "Dr. Manju",
            "identifier": {
                "type": "REGNO",
                "value": "MH1001",
                "system": "https://www.mciindia.org"
            }
        },
        "hiTypes": [
            "OPConsultation"
        ],
        "permission": {
            "accessMode": "VIEW",
            "dateRange": {
                "from": "2021-09-25T12:52:34.925Z",
                "to": "2021-12-15T12:52:34.925Z"
            },
            "dataEraseAt": "2022-12-27T12:52:34.925Z",
						"frequency": {
							"unit": "HOUR",
							"value": 1,
							"repeats": 1
						}	
        }
    }
}'

@Shubhanshu_Shukla This is how we are registering HIU. Also, what is service ID and where can I get the service ID for my client Id

curl --request PUT \
  --url https://dev.abdm.gov.in/devservice/v1/bridges/services \
  --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDEyMDg0NDAsImlhdCI6MTY0MTIwNzg0MCwianRpIjoiMTY1ZmVkOGItNjFlOC00MTVhLThiODYtOWY1N2NjNTY0ODgxIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYX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orbkIk_bA7lHRnNJ-x4QB6qFaxdToFyPIxNzHtAiXgTSdVyr1vYUuPAlxDlVtJqy0P4Vka1zPtcxTmwRTYQjvgsDQZPBG9VsK1Gsj7BAFUX9RRRlJIck_RZA' \
  --header 'Content-Type: application/json' \
  --cookie TS011c04bd=01115a1c90a5d9be213a941ea8c374457e24b40793944e4c593cf5fc93152b6ffbc6d8c2c0fe020e0ecd5171c3986cd7ac438047e5 \
  --data '{
	"id": "SBX_001380",
	"name": "Medblocks Nishtha",
	"type": "HIU",
	"active": true,
	"alias": [
		"medblocks-nishtha"
	]
}'

@Shubhanshu_Shukla @Dhawal @anjub @Arvind_Tomar @neha.parnami
Need help with this
We got a third client ID and secret, it worked for like 10 days and then started giving the same error today.

One more difference we noticed in the responses is the X-HIU-ID that we’re getting in the response.

Earlier it was SBX_001211

Now we are getting bridge_SBX_001211 and it started giving the error

We think this is causing the error. Kindly help

@Shubhanshu_Shukla can you please explain what exactly is service_id ? Is it the same as clientId ?

Hey @nishtha / @sebisamuel20

Service id is basically the HIP Id / HIU Id.
It is generally different than bridge id but it’s not mandatory.

Hi @Shubhanshu_Shukla , there is some issue with calling HIU side consent APIs with the service id we have been using for a while. Lot of people are reporting the issue. Previous i where able to call consent APIs with HIU id configured during initial bridging.

Following up on this issue, @Shubhanshu_Shukla can you please help us out with this issue?

Hey @sebisamuel20 / @navaneethpk / @nishtha ,

The issue was fixed,
can you please confirm this?

Thanks

Hey @Shubhanshu_Shukla

Unfortunately no, it’s giving us the same issue

@Shubhanshu_Shukla We are still facing the same issue

@nishtha did you get any update regarding this issue?

@nishtha/ @sebisamuel20 ,

Please try hitting again and revert with latest response, will be helpful to trace logs.

Thanks

Hey @Shubhanshu_Shukla
I checked again, it’s giving the same issue.

This is the latest response

{
  "method": "POST",
  "path": "/v0.5/consent-requests/on-init",
  "query": {},
  "client_ip": "14.143.232.140",
  "url": "https://abd72c5a5e65a9ab7d387c36c5d24f84.m.pipedream.net/v0.5/consent-requests/on-init",
  "headers": {
    "host": "abd72c5a5e65a9ab7d387c36c5d24f84.m.pipedream.net",
    "content-length": "213",
    "user-agent": "ReactorNetty/0.9.7.RELEASE",
    "accept": "*/*",
    "content-type": "application/json",
    "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDM4MDA0NDYsImlhdCI6MTY0Mzc5OTg0NiwianRpIjoiZDM0NzcwNjMtMDk3ZC00NzI0LWE2MDctOTBhZjRkODBmYTFiIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJjMmQ5Y2EwMC01NDE4LTQ4ZjctODg2Zi03YjQzOTg1MGI4YzMiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJnYXRld2F5Iiwic2Vzc2lvbl9zdGF0ZSI6IjRhZDMxODU1LTZmNmMtNDU0OS1iYjZjLTY1NjE1MDVhMDNkYiIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDAzIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoZnIiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiZ2F0ZXdheSJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfSwiZ2F0ZXdheSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY3LjEzMiIsImNsaWVudElkIjoiZ2F0ZXdheSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LWdhdGV3YXkiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY3LjEzMiJ9.K53GODb1RKjXlMcWR-NskrryU2XOuQ8FKU9dob_54qiL8eb7ztZvA0tOqSay4uqvN_seBmgKVBuRUnjD4NNNlRoW6KoMWz2whc-i8pXKX7n3dKoYgqFubJGJeaJjiFFMgKwYsdvycBMM7MFCu2bJnYXMW0pGaJWAtyLONt4A97h8qmqu1-AC72voSYosTFNLq9MwlW0g-PW18ihkT9hR5lveXT_9wfyTLyb89c1ntRhln07hXO1Hmi4CzRY691Kt23uFD6NGA2eRtzljR8OLU9C_vouz3KuhpyJEXVokdMJUMwtbTfsCmCo9FlboMZmQ0qAbhxNbGU5W6fYPey3Fmw",
    "correlation-id": "03b25640-6fc2-4a08-82f4-e4f45f7e079e",
    "x-hiu-id": "bridge_MB_4062191"
  },
  "bodyRaw": "{\"requestId\":\"0d7193d8-2500-4330-86f3-8354c7d80f18\",\"error\":{\"code\":2500,\"message\":\"Invalid HIU id: MB_4062191\"},\"timestamp\":[2022,2,2,11,4,6,423482000],\"resp\":{\"requestId\":\"21bdff33-62c9-47de-aff2-989fe7976857\"}}",
  "body": {
    "requestId": "0d7193d8-2500-4330-86f3-8354c7d80f18",
    "error": {
      "code": 2500,
      "message": "Invalid HIU id: MB_4062191"
    },
    "timestamp": [
      2022,
      2,
      2,
      11,
      4,
      6,
      423482000
    ],
    "resp": {
      "requestId": "21bdff33-62c9-47de-aff2-989fe7976857"
    }
  }
}

Are you sure that you didn’t get any errors while registering the HIU ID?

Also try using any other HIU api like “/v0.5/patients/find” check what is the result. Let me know if it gives the same error

Also try following and let me know the output:

curl --location --request PUT ‘https://dev.abdm.gov.in/devservice/v1/bridges/services’ --header ‘Content-Type: application/json’ --header ‘Accept: application/json’ --header ‘Authorization: Bearer {token}’ --data-raw ‘{“id”:“test-nisha-hiu”,“name”:“Test Nisha HIU”,“type”:“HIU”,“active”:true,“alias”:[“test-nisha-hiu”]}’

Just replace your token there and try

Hey @bhaskar.dabhi
There’s no error while registering the HIU.

Also I checked again, the /v0.5/patients/find is not giving any errors.