Health Id Registration with Aadhar - VerifyOtp - unauthorized error

Hi

I am able to generate OTP using Aadhar number but the verify OTP API is throwing 401 Unauthorized error.

curl --location --request POST 'https://healthidsbx.abdm.gov.in/api/v2/registration/aadhaar/verifyOtp' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTU0NTM3MzYsImlhdCI6MTY1NTQ1MzEzNiwianRpIjoiYTk5ODVhMGYtOTkyMy00MjQ3LWE5ODUtOTY2NWU0MzQ2YTcwIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJjMWE3ZWIyZi0xMzZmLTQ0Y2ItOTZjZC1jOTBmOTAxZmM2NWYiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAxNzUxIiwic2Vzc2lvbl9zdGF0ZSI6Ijc1MGIyYzdlLWUzNGEtNGE1MS1hMmZjLTYxOTYyNmJkNGZiMiIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IlNCWF8wMDE3NTEiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY3LjIyMiIsImNsaWVudElkIjoiU0JYXzAwMTc1MSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LXNieF8wMDE3NTEiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY3LjIyMiJ9.isaszjRQntBDuH8OONwLKWdnAVJ2nIouYJ9iJwwbCSct03USGfCwKhTNScpSL0UFU6USsJyAdiFBl-OgD5HrIiQM8xVrBo6oXPFcu5R1YL8Yrvg-gSzwP9qrDi3bL4sbIXB8zAdhoHWK_AAAiNkPHYzAjM5pcPO-YFxmm4PboDK0XBUgH4iI6_2Lxkb949tt8umfYH6qz6ZL0WvO72YO_pwlDc4XsApCeAw4CKCJ_J3ddkUEEo8ARNivV_xUQ-xxIitOTvI7iKv1o2jN0IHIGBcwWSwHfHj2QLtXaXJ67sP1E50N7oPHFfscu5EvxIiDBEfgur8v5febBH3d5R_qRA' \
--header 'Content-Type: application/json' \
--header 'Cookie: TS01c078b5=01115a1c9088ca1da08f551b9de4c657eb3068f49fce36c2fc8f67f74136448e9242e53c7f850bc37c42e1d3e15ab00383d1b8fedd' \
--data-raw '{
    "otp": "ErWw38RXoWUTVG9HNNXYaHJQ1eQgNBu2bX/7WHRnH1TtQvBkILfpEfiLe38q64xfVd1NNBH/tc7X4VtJHa/g2ihyIJtc6HSmstJRlrsmMQlBkpE1zrCoYd2LNF1KwNbdtQCawzoyqdPGK3GDBSChll2lraWXD/yQLoxe/0vIEEFWKAP58d0BVUCwUjwu9njLNC6ZYdGWM4djjtU4F5gg+BhNjnyEYhOe5w9yCRoPrUWAerlsnsl+lcYbxnOOiAZXfArgzGm1Bc73I+Rd+ZcCe7cUhVGk/foXQf0ZuLxR/Won3y3P3ztxU1N38SIQItt8erpVGqn8z1tZylULYtvlSAvwtAiebZzX/jZhxRUdX1Hc3FAAV1XsVnVEJ6Ty5EVKVr9ijEPE6ZnnAOZyIpLXQXL/EeqOUz3CwR1VCGrBIdYnyOdroGoPq+9xkM7HkUhauX3nVo9jxI6kcTNezuvnyIjnm0jxbK9G0urFmNPg4EAHgVyP+QxH5JrAbjNapLWKGPlbZnoLL+oL0wgmem/lHiDy+RnJWEJkVcnGTCKI/Qu8Oi2za1Y4i/uTpRGfV6pFjphAM1N+0Kd/9Hy1GW3q/YJV20H7OKy5+5LwR7FLSmm3dYRFzu+XFycP9DONSylGfJIS/+kHTDqhQyiuccg6qhQxOb20MYcIkc8TAugb9Es=",
    "txnId": "e00f9a25-652a-4b31-b757-140e4651c170"
}'

Response:
{
“timestamp”: “2022-06-17T08:06:52.951+0000”,
“status”: 401,
“error”: “Unauthorized”,
“message”: “Unauthorized”,
“path”: “/api/v2/registration/aadhaar/verifyOtp”
}

1 Like

Same issue, please let me know if you got the solution

1 Like

@depakpant @Shubhanshu_Shukla @neha.parnami
These are the roles added to my client id:
“realm_access”: {
“roles”: [
“hiu”,
“offline_access”,
“healthId”,
“OIDC”,
“hip”
]

Could you please check and see if this is an access issue. Thanks

@simmi
The issue is quite silly and I figured it out quite late
There is an error in the URL. Instead of verifyOtp, it should be verifyOTP

1 Like

thanks, my issue has been fixed.