generateOPT| 401 Unauthorised

Following are the steps been executed.

  1. Access Token Generation
    https://dev.abdm.gov.in/gateway/v0.5/sessions

curl --location --request POST ‘https://dev.abdm.gov.in/gateway/v0.5/sessions
–header ‘cookie: TS01960242=01115a1c90742941214ea5840ea13136a2417446c4bc37194d7d57b6ad13ee712e43c2356243bcc489fb4aa8db4996ed0ef46b45e1; TS011c04bd=01115a1c904942d0887e433e3a650042a9690ec14dbf2963873c0508172221bff940f8c19d459a31b61c56c1eb036a626e4dbf46e2’
–header ‘Content-Type: application/json’
–data-raw ‘{
“clientId”: “CVLLPT_XXXXX”,
“clientSecret”: “XXXXXXXX-abd0-4b75-810d-XXXXXXXXX"
}’

the access token received based on the above call is used in the below call (Generate OTP).

curl --location --request GET ‘https://healthidsbx.abdm.gov.in/api/v1/registration/aadhaar/generateOTP
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTEwNTk0OTksImlhdCI6MTY1MTA1ODg5OSwianRpIjoiOTQ3YWU0ZTAtYjlkNy00MjNjLWI5ZjMtNGNkYzJhZmNkNmNiIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI0MzhkN2MxOS05MjkzLTRlN2MtOGM3Yy02MDcwMjc4ZDY5MzAiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJDVkxMUFRfMzI0MTU2Iiwic2Vzc2lvbl9zdGF0ZSI6Ijg3YjM2NjI1LWU4MWItNDIxZi1iNTgyLTQ3ZmVjZDI1NzNmNSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhlYWx0aElkIiwiT0lEQyIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IkNWTExQVF8zMjQxNTYiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY3LjE2NSIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwiY2xpZW50SWQiOiJDVkxMUFRfMzI0MTU2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LWN2bGxwdF8zMjQxNTYiLCJjbGllbnRBZGRyZXNzIjoiMTAuMjMzLjY3LjE2NSJ9.kll_0jFI6pwbzWiilx2vYE35qBDvcNUG6C-_0tcW9PlB35gicsLHuVtoRFaJI-zxosqFfrMCKKp0bYbLO3voEj5_sO_oHEaI2AtbAzhW-5pAMSJL2jFU_IB7a5L7OjkxsYjzz92M-OYn6RTt7Tk52F2RwghBdUZnkt6-3ORx-baAu7ZiiLGuqfRVdJA6tanBffZ34Gb4_nQe_kfei-VTz8Ey9tsYjwuIHqfL1qorIA7WlqqL4X8-ybMJ5npxIwKFyQVY6trbRT2s12p2DB2izib2J4mRx5SSCsp34BE4QLftxJJPPUHAwK-GbxJnZJKTLEUZhnm4i7IXeRYQxDxYrQ’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01c078b5=01115a1c905bf58560501ff058c53e87079eb2c821d043d916bb17afb90db4d7cc0a094e93f3e2b3fcb6c38381a67068c3ac8a583c’
–data-raw ’
{
“aadhaar”: “262510410026”

}'

Response Received :

{
“timestamp”: “2022-04-27T11:29:29.116+0000”,
“status”: 401,
“error”: “Unauthorized”,
“message”: “Unauthorized”,
“path”: “/api/v1/registration/aadhaar/generateOTP”
}

@depakpant / @suraj08 / @Dhawal

can you take this up.

thanks

@Shubhanshu_Shukla Any fix for this I am facing the same issue

@NGM any fix for this I am facing the same issue

Hi,

I am also having the same issue. Can anyone help on this please. My client id already has the HID role

@Selvalakshmi are you encrypting the Aadhar number? Also make sure you are correctly passing the bearer token in header Authorization.

@rahul260792

Yes this worked for me after passing the bearer token in the header Authorization.

Can you help to understand the difference between ABHA Number (Health ID Number) and ABHA address (Health ID)?

How these are interlinked to each other?

How can I create ABHA address alone? Please help to share the API for this?

Also, How can see the multiple ABHA addresses linked to my mobile number