Inadequate Webhook response for Health Locker auth-init api

Hi @adnan_360,
We are not getting the request ID needed in /cm/authorization-requests/{request-id}/approve api in the Webhook object that comes in response to gateway/v0.5/users/auth/init api call. Here is the Webhooks response:

{
requestId: ‘c0cb7143-6682-4fde-bae8-48d1f6c57d45’, // this request id does not work in
// /cm/authorization-requests/{request-id}/approve api.
timestamp: ‘2022-04-29T16:16:45.187023’,
auth: {
transactionId: ‘cdb1049d-8783-491e-8d42-cba6ade2fd8f’, // this id does not work in
// /cm/authorization-requests/{request-id}/approve api.
mode: ‘DIRECT’,
meta: { hint: null, expiry: ‘2022-04-29T18:16:45.187035’ }
},
error: null,
resp: { requestId: ‘db936898-3c13-4770-a07e-31415cff8565’ } // this is the same request id which we // sent in auth-init api call. It is not the one which is needed in /cm/authorization-requests/{request-id}/approve api.
}

We need to call /cm/patients/requests api in order to get the request id needed in /cm/authorization-requests/{request-id}/approve.

Hi @arpan,

Please use below API flow if in case any issue please let me know.

/v0.5/users/auth/fetch-modes

curl --location --request POST ‘https://dev.ndhm.gov.in/gateway/v0.5/users/auth/fetch-modes
–header ‘X-CM-ID: sbx’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTg0MDM3MTcsImlhdCI6MTY1ODQwMzExNywianRpIjoiMGFkMDc2ODgtYTA1Zi00ODNkLWEwYTUtODgwNDJlNDk0ZjY0IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxZWNkZGZiZS02ZTZhLTQ4YjAtYWI2My03ODY1Y2I3MzM4YTAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJHT1ZJTkRfTFRJIiwic2Vzc2lvbl9zdGF0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491817b322f235679f20c728227b4181c377114f9f07925cd227ff2dbdbc7417a5afd99116577ba94bd207e45ae’
–data-raw ‘{
“requestId”: “60e118bd-df8c-4935-864b-41fe2f20f94a”,
“timestamp”: “2022-07-21T11:32:53.527000”,
“query”: {
“id”: “govinddeshmukh@sbx”,
“purpose”: “KYC_AND_LINK”,
“requester”: {
“type”: “HIP”,
“id”: “GDeshmukh-HIP”
}
}
}’

/v0.5/users/auth/on-fetch-modes

{
“requestId”: “c5185480-c82a-43e5-8583-5afda9cb16a3”,
“timestamp”: “2022-07-21T11:32:54.543015”,
“auth”: {
“purpose”: “KYC_AND_LINK”,
“modes”: [
“DEMOGRAPHICS”,
“PASSWORD”,
“MOBILE_OTP”,
“AADHAAR_OTP”
]
},
“error”: null,
“resp”: {
“requestId”: “7daae484-324c-41c1-81c2-ba15a79f5d14”
}
}

/v0.5/users/auth/init

curl --location --request POST ‘https://dev.ndhm.gov.in/gateway/v0.5/users/auth/init
–header ‘X-CM-ID: sbx’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTg0MDM3MTcsImlhdCI6MTY1ODQwMzExNywianRpIjoiMGFkMDc2ODgtYTA1Zi00ODNkLWEwYTUtODgwNDJlNDk0ZjY0IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxZWNkZGZiZS02ZTZhLTQ4YjAtYWI2My03ODY1Y2I3MzM4YTAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJHT1ZJTkRfTFRJIiwic2Vzc2lvbl9zdGF0ZSI6Ijc4MjA4ZjkwLTQ2MmEtNGU2Mi04NjMzLTZiYTE1YWYxNWNhNyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImNtIiwiaGVhbHRoSWQiLCJPSURDIiwiZ2F0ZXdheSIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfSwiR09WSU5EX0xUSSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRJZCI6IkdPVklORF9MVEkiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY4LjIwNyIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LWdvdmluZF9sdGkiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY4LjIwNyJ9.hJ-IJu6TcKc0wxeyxodqPd6d4elJ6h8Mrjsj3Icerx238eEpoP9JeEGkPgHeDJhGPXKtWCyqukmgwvHH10DJQ91C_a131OaIDrbX3VSBcl8fFYlyYnK0UXabihh1c21c_xK7Uld2dvqliyctMT38jA4WbkKsjotLvKJdrUPXBSSVMGRMvMgFaqdzUuEIneA5WSqMT4E2pZnBr60VXOL21uckIMVqbvumoxiLhqt9HQt9geXOUOpF-7UAJjL9RmrgNA4VQ4MKecf87Mjo2yVM-7VbtTY5W6n2N2mLRHCKGxyhUpENJ1Bsb-0smbII6QBhRPn0bOUJae6S3MaVIAgOgw’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01960242=01115a1c90f5e48491817b322f235679f20c728227b4181c377114f9f07925cd227ff2dbdbc7417a5afd99116577ba94bd207e45ae’
–data-raw ‘{
“requestId”: “fc0c5203-1c56-4580-a448-301171de8946”,
“timestamp”: “2022-07-21T11:34:57.781000”,
“query”: {
“id”: “govinddeshmukh@sbx”,
“purpose”: “KYC_AND_LINK”,
“authMode”: “MOBILE_OTP”,
“requester”: {
“type”: “HIP”,
“id”: “GDeshmukh-HIP”
}
}
}’

/v0.5/users/auth/on-init

{
“requestId”: “b2d079aa-5c67-478e-9954-bcb1ce992b74”,
“timestamp”: “2022-07-21T11:34:58.35481”,
“auth”: {
“transactionId”: “dc6fc2e8-b0d1-4477-964c-3b32db186733”,
“mode”: “MOBILE_OTP”,
“meta”: {
“hint”: null,
“expiry”: “2022-07-21T13:34:58.35482”
}
},
“error”: null,
“resp”: {
“requestId”: “02749aaa-8fef-428f-966b-86ae78429fc1”
}
}

/v0.5/users/auth/confirm

curl --location --request POST ‘https://dev.ndhm.gov.in/gateway/v0.5/users/auth/confirm
–header ‘X-CM-ID: sbx’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTg0MDM3MTcsImlhdCI6MTY1ODQwMzExNywianRpIjoiMGFkMDc2ODgtYTA1Zi00ODNkLWEwYTUtODgwNDJlNDk0ZjY0IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiIxZWNkZGZiZS02ZTZhLTQ4YjAtYWI2My03ODY1Y2I3MzM4YTAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJHT1ZJTkRfTFRJIiwic2Vzc2lvbl9zdGF0ZSI6Ijc4MjA4ZjkwLTQ2MmEtNGU2Mi04NjMzLTZiYTE1YWYxNWNhNyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImNtIiwiaGVhbHRoSWQiLCJPSURDIiwiZ2F0ZXdheSIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfSwiR09WSU5EX0xUSSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRJZCI6IkdPVklORF9MVEkiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY4LjIwNyIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LWdvdmluZF9sdGkiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY4LjIwNyJ9.hJ-IJu6TcKc0wxeyxodqPd6d4elJ6h8Mrjsj3Icerx238eEpoP9JeEGkPgHeDJhGPXKtWCyqukmgwvHH10DJQ91C_a131OaIDrbX3VSBcl8fFYlyYnK0UXabihh1c21c_xK7Uld2dvqliyctMT38jA4WbkKsjotLvKJdrUPXBSSVMGRMvMgFaqdzUuEIneA5WSqMT4E2pZnBr60VXOL21uckIMVqbvumoxiLhqt9HQt9geXOUOpF-7UAJjL9RmrgNA4VQ4MKecf87Mjo2yVM-7VbtTY5W6n2N2mLRHCKGxyhUpENJ1Bsb-0smbII6QBhRPn0bOUJae6S3MaVIAgOgw’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01960242=01115a1c90f5e48491817b322f235679f20c728227b4181c377114f9f07925cd227ff2dbdbc7417a5afd99116577ba94bd207e45ae’
–data-raw ‘{
“requestId”: “8714702a-c645-4b27-8a80-8c89ae90a69e”,
“timestamp”: “2022-07-21T11:35:55.430000”,
“transactionId”: “dc6fc2e8-b0d1-4477-964c-3b32db186733”,
“credential”: {
“authCode”: “153139”
}
}’

/v0.5/users/auth/on-confirm

{
“requestId”: “ea29e9ea-1f26-4760-b5c5-bd9ba3fe9f00”,
“timestamp”: “2022-07-21T11:35:56.249891”,
“auth”: {
“accessToken”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJnb3ZpbmRkZXNobXVraEBzYngiLCJyZXF1ZXN0ZXJUeXBlIjoiSElQIiwicmVxdWVzdGVySWQiOiJHRGVzaG11a2gtSElQIiwicGF0aWVudElkIjoiZ292aW5kZGVzaG11a2hAc2J4Iiwic2Vzc2lvbklkIjoiYjQ3YTUxZTUtY2JiNi00ZDM5LTgzZGItYTJlMTNjYTdmZDM1IiwiZXhwIjoxNjU4NDg5NzU2LCJpYXQiOjE2NTg0MDMzNTZ9.jBAvJaCCzKJ04tgPLdTU2EHbIWF1FrFngCQ8zrPVji39vbShRdl4KQ-ROj9ukEGSHCstWgH9G8PrG1UMvs7YdLEjSQKrRFA7yQI5HTQnwHR80s0tr-N_DMoLgbAhFRmqZ95skOTWrVW7O1FGG4L-jeUxiktB5RFTDd2VW3ZDsjUqaL1CesvjwUt_zWtuAVVmUlPyhMVulUVUV6gw5exs4gO9aOQ4bcPydSiY4VTEA4jHm79-jXdtM4o_1AfeJvtlQ9nAFzHp855cKLDfuymIsnpfKGMGsqWT2IgmP2ksOzZzAsp37ugLPbd3relk-ZEpz6IpwcrDDoa1lOp_qcG4WQ”,
“patient”: {
“id”: “govinddeshmukh@sbx”,
“name”: “Deshmukh Govind Nanasab”,
“gender”: “M”,
“yearOfBirth”: 1993,
“monthOfBirth”: 11,
“dayOfBirth”: 5,
“address”: {
“line”: null,
“district”: “NANDED”,
“state”: “MAHARASHTRA”,
“pincode”: null
},
“identifiers”: [
{
“type”: “MOBILE”,
“value”: “7013061970”
},
{
“type”: “HEALTH_NUMBER”,
“value”: “58-5412-3783-0306”
}
]
}
},
“error”: null,
“resp”: {
“requestId”: “b75b2c5e-b991-460a-bc39-f9e694039075”
}
}

Thanks,
Govind D.

What is the expirey time of long term linking token as on webhook it shows as one year

Hi @BushraKhan,

it could be expire within 2 to 3 minutes as we have tested please check once.

Thanks.

Hi @Govind_Deshmukh
If the expiry is within 2 to 3 mins then why on webhook we get the expiry time as 1 year.Secondly for any user its practically impossible to link 1 lakhs(field name is limit in webhook response) care context using the access token which we get on webhook response within 2 to 3 mins.Please refer to below screenshot:
Long term linking token webhook response:
{
“requestId”: “631dd80e-242f-4487-894b-a7385688598d”,
“timestamp”: “2022-05-19T06:30:54.225122”,
“auth”: {
“transactionId”: “20a86d31-eeca-4d1a-bb73-7f44c49d00ca”,
“status”: “GRANTED”,
“accessToken”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJhYWthc2hAc2J4IiwicmVxdWVzdGVyVHlwZSI6IkhFQUxUSF9MT0NLRVIiLCJyZXF1ZXN0ZXJJZCI6ImhlYWx0aC1sb2NrZXIiLCJwYXRpZW50SWQiOiJhYWthc2hAc2J4Iiwic2Vzc2lvbklkIjoiMWNhMDUzNTEtYmRhYS00MTcxLWE2ZTAtZjczNDQzNjg5NDU0IiwiZXhwIjoxNjg0NDc3ODU0LCJpYXQiOjE2NTI5NDE4NTR9.b0m1i9EvsvMpGy4bRtcnHdnpAYvg8d9ZmW4ldVjwmcxCX2brwi_0x4oRGw3burIoXTqOMCjhB4IZuYToIDWlbffGe-4H1BBzotXlA7-DZVSLiMoK4HsJRbW_ga6lOunWtSfulmg-17v30B6uExlX0GK4E9EYr98HKkN_0_OaH8gmDO1zeVxWqJ3IEWQiiYG_1oSyjmZRay8kzrusy_iVSwWOgXg7Dk4cL9RgVxZ00mb5IOcGgumDv3d79xexW4mLOUgbZdRDDNKMXwuJbIB-K0DurWGasu40kzCls_Vl1AgTVQJ1hwYDLnS9DSK5mEAZEecvB5E3w8ORd_wowhGjFA”,
“validity”: {
“purpose”: “LINK”,
“requester”: {
“type”: “HEALTH_LOCKER”,
“id”: “health-locker”,
“name”: null
},
“expiry”: “2023-05-19T06:30:54.225032”,
“limit”: 100000
},
“patient”: null
}
}
This webhook I get once I approve the locker setup request.

Hi @BushraKhan,

Please let me know on which api your getting those things because if I’m testing on Sandbox its accepted for one time as per the written in code also.

“accessToken”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJnb3ZpbmRkZXNobXVraEBzYngiLCJyZXF1ZXN0ZXJUeXBlIjoiSElQIiwicmVxdWVzdGVySWQiOiJHRGVzaG11a2gtSElQIiwicGF0aWVudElkIjoiZ292aW5kZGVzaG11a2hAc2J4Iiwic2Vzc2lvbklkIjoiZWI3MGYxZjUtM2RmZC00NTE3LWIxOTktYjQwNGY1NmVkMzNiIiwiZXhwIjoxNjYwMjkzNTk1LCJpYXQiOjE2NjAyMDcxOTV9.BEqjW6J3FUaumXbd1PcMEbm0mTC8xG5x3DUOXLOa1RWoaKk5wJPJVtwENP-QXwEIuPiwvcuErczCUYDowoGw3s1CPKGeN2djiiJFoh2HDeRvufbP5tFIsglYmmv0_AU1ZLlZkSfHp53HnykjWlW5Jox53OopaDvsq5eapLVMbPHma9ZPiW6kc0i39kv4uFBmnJQLuz33Wb3hTRVsF2x_EeHUmhwjmRm4dyHx0w2ocl4dRK8xD1ctqjQZr0pJN9pSrJTlrKA6LMGnOWqg5X_UxKRocbmkQxkH8ea31dOzs2PZjZhZtqmdlG1HhAiOeAhSkF4KpMTgzFfGLPmtppnQkA”,

Thanks,
Govind D.