Steps to configure callback API

Hi All,

Can someone please help with the Health Repository URL registration/configuration when building HIP?

We have followed the steps mentioned in the document here:
https://sandbox.abdm.gov.in/docs/getting_started_with_apis

Invoked the patch API using the command below:

curl --location --request PATCH ‘https://dev.abdm.gov.in/devservice/v1/bridges’ --header ‘Content-Type: application/json’ --header ‘Authorization: Bearer your-access-token-from-gateway-session’ --data-raw ‘{
“url”: “https://my-hrp-url.com
}’

But still, we are not getting any callback from the gateway for the webhook URL we configured.

Is there anything we are missing here? Has anyone faced a similar issue in past? Any help would be really appreciated.

Thanks,
Arpit

Hi @arpit please use the below curl for reference

curl --location --request PATCH ‘https://dev.abdm.gov.in/gateway/v1/bridges
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2Nzk5Njg0MzEsImlhdCI6MTY3OTk2NzgzMSwianRpIjoiY2Y4OGRlNmEtOGM1MC00ZjI3LWE5YmQtM2JmZDdjODlkYzE2IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI1OTgzYWM3Zi0xYjNiLTQ5Y2MtYjA5My05NGJhMWU5ZDU4OTAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJSQU1BTl9URVNUIiwic2Vzc2lvbl9zdGF0ZSI6IjM1NWU1MjU2LTg3NzAtNDkzZS05YTAzLWNlZWNkMjQ4YWI1YyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwicGhyIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IlJBTUFOX1RFU1QiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY4LjIwMyIsImNsaWVudElkIjoiUkFNQU5fVEVTVCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXJhbWFuX3Rlc3QiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY4LjIwMyJ9.j9iZbjmtb3gRPeWRBIhDxAyl_oE_yAWCwKrdenE8jgWgVsVwsrTFsVxald8sBWCu-Mb49tpXQCxV1fnMKIgHjadwxdd82p9RS5lACxw7oAyUKfRV7Whv5Ap5Cpf7CF4A-44Y1osTbHaEDBqHcht4GSrWNP8q3W4N9LJvNTtPVAkgZH3iiU4SVzNQC2qusVZHCKEuNf-bfV9Q4OML0H4-Ud-llbjOzvuHWvJ_WEwESVCf6uRJO1OsORTZ5o5IPiSI0RTcCLnxhA1wQ90-0MR3PK8BFPaYQkMnJ4QxGH0Z7TRpgrRtvu8hC45bqhcj7ZALP8fCwQ-x-7tQamiZzuYGfw’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS011c04bd=01445fed044fa0fe22e9686a103a5621fcbb85837b3d1ce5c12a334245f3ad65522f06525ad495f1c2469444254e1c066774d54a3a’
–data ‘{
“url”: “ENTER THE CALLBACK URL TO BE USED”
}’

Thanks

After setup Callback URL, how to get Api response in my Server ?

Suppose i set callback url is https://xyz.com/index.php

Then i call https://dev.abdm.gov.in/gateway/v0.5/users/auth/fetch-modes API using Curl.

Now i want to get response from above api in my server.

What URL should be used for get response in CURL–

https://xyz.com/index.php/v0.5/users/auth/on-fetch-modes

OR

https://dev.abdm.gov.in/gateway/v0.5/users/auth/on-fetch-modes

You will get response on
https://xyz.com/index.php/v0.5/users/auth/on-fetch-modes

what is the code for Get response from this api-
https://xyz.com/index.php/v0.5/users/auth/on-fetch-modes

i am using PHP CURL.

Can you give some demo code for Get response in PHP CURL

Hi @Ramandeep1,

Thanks for the response, we are using the same CURL to configure our webhook.site url. But we are not getting any callbacks to the url configured.

Are we doing something wrong? or missing some step?

Thanks,
Arpit

Hi @arpit kindly provide the payload.

Thanks

Hi @Ramandeep1,

Here is the payload used for callback URL registration:

curl --location --request PATCH ‘https://dev.abdm.gov.in/gateway/v1/bridges
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ’
–data ‘{
“url”: “http://webhook.site/557f7409-a836-48e9-86cb-843760d975cc
}’

Here is the payload used for HIP auth:

curl --location ‘https://healthidsbx.abdm.gov.in/api/v2/auth/init
–header ‘Accept-Language: en-US’
–header ‘Content-Type: application/json’
–header ‘Accept: /
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNV’
–data-raw ‘{
“authMethod”: “MOBILE_OTP”,
“healthid”: “arpitjain@sbx”
}’

We are getting the OTP on the registered mobile number but not getting any callback to the configured url.

Thanks,
Arpit

Hi @arpit I am not able to get you, which flow are you trying to create.
For example: HIP initiated linking or user initiated linking etc.

Thanks

Hi @Ramandeep1,
We are trying " HIP initiated linking for the patients with mobile number".

Hi @arpit you are using the wrong api base url, it seems like an understanding issue. Kindly go through https://sandbox.abdm.gov.in/docs/postman_collections and https://sandbox.abdm.gov.in/webinars for more information regarding the same.

Thanks

Thanks @Ramandeep1. Correcting the urls did the trick. We never suspected that url could be wrong as we were getting 202 response code with the old url.

Thanks for helping out. we are able to get the callbacks now. :slight_smile:

2 Likes