Unable to use X-Token or authToken

Hi All,

Currently authenticating via authPassword API in response I am getting token.

So when I am using the same token to access the information of profile or any cards via GET/POST method. In response, I am getting this

{
“timestamp”: “2020-09-14T08:51:44.551+0000”,
“status”: 401,
“error”: “Unauthorized”,
“message”: “Unauthorized”,
“path”: “/api/v1/account/profile”
}

Any help?

May I ask where you found this API? /v1/account/profile?
Please refer to the available APIs as documented in the sandbox website.

I found the API from this link

https://sandbox.ndhm.gov.in/swagger/ndhm-healthid.json

(See the profile section)

@sukreet has there been any change in HealthID spec?

Does It required SandBox token?

@dpnkrg hope the curl for your call is in the below format

curl --location --request GET 'https://healthidbeta.ndhm.gov.in/api/v1/account/profile' \
--header 'accept: */*' \
--header 'Accept-Language: en-US' \
--header 'X-Token: Bearer <token-from-auth-password-api>' 

The API’s are in a working state, no recent changes.

Ok. It’s working now.

I think, there is a need to add “Bearer” (prefix) in documentation and website doc also.

Website Link:
https://sandbox.ndhm.gov.in/swagger/ndhm-healthid.json

Screenshot as per my observation.

Thanks a lot, @sukreet and @angshuonline for your quick response.

Update -

The same thing is mention in API doc also.

API Security
You need Authorization Token and X-HIP-ID to consume APIs.
Note: When calling APIs, please ensure that Authorization header must have format as Bearer Token_Value . Please note that prefix Bearer followed by space before token value.

from where to generate that x toeken?
is this the the same token which we get from session api??