Unable to retrieve ABHA Profile

HI @IntegrationSupport,

I am trying to retrieve a user profile using V3 APIs, however the

https://abhasbx.abdm.gov.in/abha/api/v3/profile/account

URL initially gives 403 Forbidden, and after a few tries it gives X-Token expired.

I am attaching screenshots of the same.


Please advise

Hi @satyadeep
Here you to add both authorization token and also X-token in headers

HI @ayadav33,

I am already doing that
> GET /abha/api/v3/profile/account HTTP/1.1

Host: abhasbx.abdm.gov.in
User-Agent: insomnia/2023.5.8
REQUEST-ID: dd3c457a-5a03-4bd2-b296-0d2a84dd0b0e
TIMESTAMP: 2024-01-17T03:37:34.614Z
X-token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5NzExNDc1MTU2IiwiY2xpZW50SWQiOiJhYmhhLXByb2ZpbGUtYXBwLWFwaSIsInN5c3RlbSI6IkFCSEEtTiIsIm1vYmlsZSI6Ijk3MTE0NzUxNTYiLCJ0eXAiOiJUcmFuc2ZlciIsImV4cCI6MTcwNTQ2MjYzNSwiaWF0IjoxNzA1NDYyMzM1fQ.FfzUT7yUQxrROJ4cdjk1u1DGygKmydaA4pMfMFzsW0MuakVfg3AJtI9jDiNk4XnfTY18SgNvz5CoGBLDJOdzKMaiqts0ciVUxwZTwO7GmgaY58Mh5PGZGcSXihY1nQ_nWYMu6XH9IUz0v1vh7n5ubvX-ubFWe0dru3TvxKU3v4VyqnRKXn0xOLbdl5oa1f-K4jpC3ShdMcxrViThEe8kQRtCymtDQ7gUV9TY_8mKdwGJoB0JyUUSbX8C2T-XqaP3_IthfvFuKUV7fBrqGD6ZtvboATnAYZJQxwPYK7z72YBxyBYbbsxPYKh1F5h8uUGayz_Nz7OI_zUO5h1l-KpM35TGAtFzddrvtyDPMTXtT2UwSmy8r7Upw3gLea2lgp-4xoX7y2SLEc2s9_k4ZVyIc-_IrFxaHLTcTx8_LuPo8Svr25kbjP0vJtKTDfYZzdNPezZ0ldxvaRHvB1xKuz24e8zsp0raGeXc6RLI6HXmZrLO6ydUvZlAFMRBwdxp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2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudElkIjoiU0JYXzAwMTg1NCIsImVtYWlsX3ZlcmlmaWVkIjpmYWxzZSwiY2xpZW50SG9zdCI6IjEwLjIzMy42Ny4xNDIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtc2J4XzAwMTg1NCIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjcuMTQyIn0.SQ9u7B3SxgI6Hs2e4gw3y5QMxLz_sJDIT8LQ32HZK9i8_agOfW7QiZHk3pr2vXs2SCgOZCc187AyV5Ny0n5vLh4mzRSmTGksZTh3N62_MrEctHPDeoZIFDulnv5DQspbFiwBwM8gigH0yHDxG8FeqDvQlVex-vsHhTFO_4LzuvyDoyT4zLHbfDGSj0jo3QGDXtirYabzmc-xCafHLrotCqYmUBY3Z8wYxNrcduY97kEXneLGqQpfoSqEK3l0G_wUKtCY5QLsuTSKuKhjOaZ0ixuiy6Lc-BdJkYtKFy2kk6MBTj11f2b3VsYu4FLwhbwAbckD0Pu60v-RadNNgfuSBg
Accept: /

  • TLSv1.2 (IN), TLS header, Supplemental data (23):
  • Mark bundle as not supporting multiuse

< HTTP/1.1 401 Unauthorized
< expires: 0
< x-envoy-upstream-service-time: 50
< access-control-allow-origin:
< vary: Origin,Access-Control-Request-Method,Access-Control-Request-Headers
< access-control-allow-methods: GET
< x-frame-options: DENY
< permissions-policy: geolocation=(self)
< access-control-allow-headers: authorization,Content-Type,SOAPAction,apikey,Internal-Key,TIMESTAMP,REQUEST-ID,TRANSACTION_ID,Authorization
< pragma: no-cache
< strict-transport-security: max-age=31536000 ; includeSubDomains
< activityid: bcc2e153-6ae2-4255-adaa-a772aae2043a
< access-control-expose-headers:
< content-security-policy: form-action ‘self’
< x-content-type-options: nosniff
< x-xss-protection: 1 ; mode=block
< referrer-policy: no-referrer
< content-type: application/json
< cache-control: no-cache, no-store, max-age=0, must-revalidate
< date: Wed, 17 Jan 2024 03:37:35 GMT
< Transfer-Encoding: chunked
Still 403/401 . ANy idea what am I missing

Hi @satyadeep
Token which you are using is wrong.
May I know which token you are using. Token must have information about abha address, number and mobile also

My API sequence is :
https://dev.abdm.gov.in/gateway/v0.5/sessions – Authorization
https://healthidsbx.abdm.gov.in/api/v1/auth/cert
https://abhasbx.abdm.gov.in/abha/api/v3/profile/login/request/otp
https://abhasbx.abdm.gov.in/abha/api/v3/profile/login/verify – X-Token
https://abhasbx.abdm.gov.in/abha/api/v3/profile/account

Please correct me if I am missing anything

Hi @satyadeep
Use the token received from creation of abha number
Received from this API - api/v3/enrollment/enrol/byAadhaar

HI @ayadav33,

YOu mean X-Token = token from enrol/byAadhaar?

@satyadeep
Exactly. Use that token as X-token

But the doc says:
X-token JWT Access token which was issued by ABDM login APIs

When I tried token from login api, even I got token expired error. So I tried with this Token. It was working fine

1 Like

@IntegrationSupport can you please confirm on this?

Dear @IntegrationSupport we are stuck here . Can you please help?

@IntegrationSupport have been waiting for your input for last 2 days, can you please clarify on this?

@satyadeep

Please use unique request id and current ISO timestamp, We will reqiest you to test it on postman and use the variables {{$isoTimestamp}} for time stamp and {{$randomUUID}} or {{$guid}} for request ID.

@IntegrationSupport

Hi @Sachin/ @IntegrationSupport,

I am still getting the same :

My request is :

GET /abha/api/v3/profile/account HTTP/1.1
Host: abhasbx.abdm.gov.in
User-Agent: insomnia/2023.5.8
REQUEST-ID: f5eb5689-4485-474b-b661-60c9d3edbaf7
TIMESTAMP: 2024-01-22T04:33:33.989Z
X-token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5NzExNDc1MTU2IiwiY2xpZW50SWQiOiJhYmhhLXByb2ZpbGUtYXBwLWFwaSIsInN5c3RlbSI6IkFCSEEtTiIsIm1vYmlsZSI6Ijk3MTE0NzUxNTYiLCJ0eXAiOiJUcmFuc2ZlciIsImV4cCI6MTcwNTg5ODIxNywiaWF0IjoxNzA1ODk3OTE3fQ.JOv-FYBGKXVTXeOLm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-RadNNgfuSBg
Accept: /

  • TLSv1.2 (IN), TLS header, Supplemental data (23):
  • Mark bundle as not supporting multiuse

< HTTP/1.1 401 Unauthorized
< x-request-id: 1beabb49-ee0c-4c45-b123-8e2a0bee2582
< x-forwarded-proto: http
< access-control-allow-origin:
< access-control-allow-methods: GET
< www-authenticate: null Bearer realm=“WSO2 API Manager” null, error=“invalid_token”, error_description=“The provided token is invalid”

Here X-Token is what I am getting out of login/verify

Can you please help me on this!

Thanks

@satyadeep

Please drop a mail to me on abdm.pc20@nha.gov.in for further debug and resolve this issue, Please add this devforum link in the mail.

@IntegrationSupport

HI @Sachin,

I have fixed the issue , as the API call sequence was missing the call to https://abhasbx.abdm.gov.in/abha/api/v3/profile/login/verify/user
which is required when verifying a user login by Mobile OTP but is not required when verifying a user login by Aadhaar OTP.
Thanks