Getting 401 on profile APIs if X-token is taken from Gateway facing Authentication APIs

Hi Team,
In our recent discussion with NHA team we were told to use Gateway facing Authentication APIs to get patient healthId profile details instead of APIs listed in Authentication section of Health ID Service Swagger documentation.
But the the accessToken received in respective callback is not valid for APIs listed in Profile section of Health ID Service Swagger documentation.
Please find below the required curls
Gateway API CURLs -

  1. curl -L -X POST ‘https://dev.ndhm.gov.in/gateway/v0.5/users/auth/init
    -H ‘accept: /
    -H ‘X-CM-ID: sbx’
    -H ‘Content-Type: application/json’
    -H ‘Authorization: {{authorization}}’
    –data-raw ‘{
    “requestId”: “f55d36a5-0146-4f17-b251-c8f32dc03b45”,
    “timestamp”: “2021-06-21T12:03:18.411Z”,
    “query”: {
    “id”: “priyanka.gupta@sbx”,
    “purpose”: “KYC_AND_LINK”,
    “authMode”: “MOBILE_OTP”,
    “requester”: {
    “type”: “HIP”,
    “id”: “DUMMY_DP_HOSPITAL”
    }
    }
    }’
    Respective callbacks -

  2. http://ndhmxxxxxxxxxx.com/dp/v0.5/users/auth/on-init
    payload =
    {requestId=da024892-fd21-4d8a-b968-a9c91c6cc6b1, timestamp=2021-06-21T11:40:36.627727, auth={transactionId=14844872-66f8-4735-9e63-e7ac643e3ec4, mode=MOBILE_OTP, meta={hint=null, expiry=2021-06-21T13:40:36.627733}}, error=null, resp={requestId=2037a460-54b8-43b4-9d44-1214b982eaee}} and X-HIP-ID : DUMMY_DP_HOSPITAL

  3. http://ndhmxxxxxxxxxx.com/dp/v0.5/users/auth/on-confirm
    payload =
    {requestId=a19f5eee-d3f2-40a1-aee0-7d20abc7549d, timestamp=2021-06-21T11:42:53.696047, auth={accessToken=eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIxNS0wNzg3LTQ1NjctMjUxOCIsInJlcXVlc3RlclR5cGUiOiJISVAiLCJyZXF1ZXN0ZXJJZCI6IkRVTU1ZX0RQX0hPU1BJVEFMIiwicGF0aWVudElkIjoiMTUtMDc4Ny00NTY3LTI1MTgiLCJzZXNzaW9uSWQiOiJjMmJkZTM3Zi02MjU5LTQ1ZDEtYjIzMy1iMTg1MzdhZTNjOTAiLCJleHAiOjE2MjQzNjIxNzMsImlhdCI6MTYyNDI3NTc3M30.RfNNfU5RlN__pLnPDhvNTakPISbJMlbSJzUyiBgN8GanscWbhVG24ubf4wBNoz2nY0HLMbRcecVzHOYotiHL1QNm6ud3sPP-fEy6j4ZqWcDExH0JaSYype-Q99fJxm8qe7OXWDfSNxPSBfZk4fvO79l1xKdfAqqEOFvNRHUrC2gN5EGNFuo43AywpyftoI3Wbx1dsoaKgTL7bhP2ElV_T3V-WEeIJBoRiKdcUrtYh6ztBBpBLb3YZwkn_I40jeKxxaqi2xNYeB3gNi9KZFc-nugaP6eOWNFqv2Lz6iLoWUpsj53KwUEVkVGeP0Y5Z-3WfQ3wJ846XFDtT9zBu_shZw, patient={id=priyanka.gupta@sbx, name=Priyanka Gupta, gender=F, yearOfBirth=1990, address={line=null, district=CHANDIGARH, state=CHANDIGARH, pincode=null}, identifiers=[{type=MOBILE, value=9xxxxxxx84}, {type=HEALTH_NUMBER, value=15-0787-4567-2518}]}}, error=null, resp={requestId=568e386d-a7dd-41f3-997d-e898e9589079}} and X-HIP-ID : DUMMY_DP_HOSPITAL

HealthId APIs CURLs-

  1. curl -L -X POST ‘https://healthidsbx.ndhm.gov.in/api/v1/account/token
    -H ‘accept: /
    -H ‘Accept-Language: en-US’
    -H ‘Authorization: {{authorization}}’
    -H ‘X-HIP-ID: DUMMY_DP_HOSPITAL’
    -H ‘Content-Type: application/json’
    –data-raw ‘{ “authToken”: “eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIxNS0wNzg3LTQ1NjctMjUxOCIsInJlcXVlc3RlclR5cGUiOiJISVAiLCJyZXF1ZXN0ZXJJZCI6IkRVTU1ZX0RQX0hPU1BJVEFMIiwicGF0aWVudElkIjoiMTUtMDc4Ny00NTY3LTI1MTgiLCJzZXNzaW9uSWQiOiJjMmJkZTM3Zi02MjU5LTQ1ZDEtYjIzMy1iMTg1MzdhZTNjOTAiLCJleHAiOjE2MjQzNjIxNzMsImlhdCI6MTYyNDI3NTc3M30.RfNNfU5RlN__pLnPDhvNTakPISbJMlbSJzUyiBgN8GanscWbhVG24ubf4wBNoz2nY0HLMbRcecVzHOYotiHL1QNm6ud3sPP-fEy6j4ZqWcDExH0JaSYype-Q99fJxm8qe7OXWDfSNxPSBfZk4fvO79l1xKdfAqqEOFvNRHUrC2gN5EGNFuo43AywpyftoI3Wbx1dsoaKgTL7bhP2ElV_T3V-WEeIJBoRiKdcUrtYh6ztBBpBLb3YZwkn_I40jeKxxaqi2xNYeB3gNi9KZFc-nugaP6eOWNFqv2Lz6iLoWUpsj53KwUEVkVGeP0Y5Z-3WfQ3wJ846XFDtT9zBu_shZw”}’
    =>Response-
    false

  2. curl -L -X GET ‘https://healthidsbx.ndhm.gov.in/api/v1/account/qrCode
    -H ‘accept: /
    -H ‘Accept-Language: en-US’
    -H ‘X-Token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIxNS0wNzg3LTQ1NjctMjUxOCIsInJlcXVlc3RlclR5cGUiOiJISVAiLCJyZXF1ZXN0ZXJJZCI6IkRVTU1ZX0RQX0hPU1BJVEFMIiwicGF0aWVudElkIjoiMTUtMDc4Ny00NTY3LTI1MTgiLCJzZXNzaW9uSWQiOiJjMmJkZTM3Zi02MjU5LTQ1ZDEtYjIzMy1iMTg1MzdhZTNjOTAiLCJleHAiOjE2MjQzNjIxNzMsImlhdCI6MTYyNDI3NTc3M30.RfNNfU5RlN__pLnPDhvNTakPISbJMlbSJzUyiBgN8GanscWbhVG24ubf4wBNoz2nY0HLMbRcecVzHOYotiHL1QNm6ud3sPP-fEy6j4ZqWcDExH0JaSYype-Q99fJxm8qe7OXWDfSNxPSBfZk4fvO79l1xKdfAqqEOFvNRHUrC2gN5EGNFuo43AywpyftoI3Wbx1dsoaKgTL7bhP2ElV_T3V-WEeIJBoRiKdcUrtYh6ztBBpBLb3YZwkn_I40jeKxxaqi2xNYeB3gNi9KZFc-nugaP6eOWNFqv2Lz6iLoWUpsj53KwUEVkVGeP0Y5Z-3WfQ3wJ846XFDtT9zBu_shZw’
    -H ‘Authorization: {{authorization}}’
    -H ‘X-HIP-ID: DUMMY_DP_HOSPITAL’ \
    =>Response
    {
    “timestamp”: “2021-06-21T11:55:06.795+0000”,
    “status”: 401,
    “error”: “Unauthorized”,
    “message”: “Unauthorized”,
    “path”: “/api/v1/account/qrCode”
    }

Please guide us on how do we use Profile APIs by using Gateway facing authention method?

@IntegrationSupport Same problem get. Please provide option.
i follow - System X-Token values as different Link details again same problem come.

@pragati.varshney did you solution for it ?