401 when trying to access QR Code API

Hi Team,

After creating the Abha Number and Abha Address, I am trying to get the Health Card for the user.
But when I am trying to fetch the QR Code using https://healthidsbx.abdm.gov.in/api/v2/account/qrCode
I am getting 401 Unauthorized.


I can see in some of the topics that we need to pass X-Token(HealthID Knowledge 101 - Solving Authentication (401) issues with HealthID APIs) along with Bearer token which we get using https://dev.abdm.gov.in/gateway/v0.5/sessions.

I tried following the steps mentioned in HealthID Knowledge 101 - Solving Authentication (401) issues with HealthID APIs but it is giving me different errors 401 unauthorized or Transaction Id not found etc errors.
The password passed in the request payload was the Client Secret for the below API:
https://healthidsbx.abdm.gov.in/api/v1/auth/confirmWithPassword

Can you please provide us with the detailed steps of how to invoke this API and pass the X-Token and from where we will get X-Token.
Also we need to consume profile apis to get the Health Card and download the health card.
https://healthidsbx.abdm.gov.in/api/v2/account/profile
https://healthidsbx.abdm.gov.in/api/v2/account/getPngCard

Please provide us with the steps for the same as well.

hi @TataMDABDM

steps1)
please generate the Authorization Token using this api
https://dev.ndhm.gov.in/gateway/v0.5/sessions
make sure client id and client secret should be correct

step 2)/api/v1/auth/init
please enter Abha number and authMethod such as AADHAAR_OTP,MOBILE_OTP
PASSWORD
step 3 v1/auth/confirmWithMobileOTP
or
api/v1/auth/confirmWithAadhaarOtp
please enter valid OTP and txnId
OR
/api/v1/auth/authPassword
please enter valid hid number and password for this api

thanks
areeb

Hi,

Thanks for the detailed steps. We are able to get the X Token with the above mentioned steps