Cm on-discover issue

@IntegrationSupport @Sachin

curl --location ‘https://dev.ndhm.gov.in/cm/v1/care-contexts/discover
–header ‘Authorization: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5MS0zNTYyLTUyMjctMjcwOSIsImNsaWVudElkIjoiU0JYXzAwMjM1OCIsInN5c3RlbSI6IkFCSEEtTiIsIm1vYmlsZSI6Ijk2MDg3MzQ3MzYiLCJoZWFsdGhJZCI6InVqam\sImhlYWx0aElkTnVtYmVyIjoiOTEtMzU2Mi01MjI3LTI3MDkiLCJpYXQiOjE3MDU1ODA2NTB9.oKSD04-iwnWB-7fw8ond4Bxu7w14E9PLcADXw2oPpXb5vnopEXF2xdBEfdiRRK-PpK8jgAW3gG_kGD9b3xs1fsMc5KDx5D-i8YWXLVBATUAaLby7RCgXvVrsPQPCMZ7elwtb3dXHace4lHwj111EjuY2tEHxSEh3jA7PAPha8uDyqLB3AWJEm1GyL044ZnmUpYrKfeiFjE7FMGycGhgT9hzwq_bX_dGq7Gar-qTqEYwSD3JUY74MkOjEhoQg_iIsQhctxaFaBJCWzMny92JG6liMf5IX6yfnGzE6yilWOiIZz2SHHbQOTuLFjUaSVWZxOehm3cZixMtH0zqEo13awooe3hYaKyPinySANFB1RQ6iKWQtGsA0SIDVrd3qGS9uBOOXNXLE3zeIe9feyXSvZmwKy5T2O5tq7PAjC3_ftLUr_UtT828RouxQ_ggQXo-sZ8dDqWrD5F_’
–header ‘X-AUTH-TOKEN: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5MS0zNTYyLTUyMjctMjcwOSIsImNsaWVudElkIjoiU0JYXzAwMjM1OCIsInN5c3RlbSI6IkFCSEEtTiIsIm1vYmlsZSI6Ijk2MDg3MzQ3MzYiLCJoZWFsdGhJZCI6InVqamF3YWwyMUBzYngiLCJleHAiOjE3MDU1ODI0NTAsImhlYWx0aElkTnVtYmVyIjoiOTEttb3dXHace4lHwj111EjuY2tEHxSEh3jA7PAPha8uDyqLB3AWJEm1GyL044ZnmUpYrKfeiFjE7FMGycGhgT9hzwq_bX_dGq7Gar-qTqEYwSD3JUY74MkOjEhoQg_iIsQhctxaFaBJCWzMny92JG6liMf5IX6yfnGzE6yilWOiIZz2SHHbQOTuLFjUaSVWZxOehm3cZixMtH0zqEo13awooe3hYaKyPinySANFB1RQ6iKWQtGsA0SIDVrd3qGS9uBOOXNXLE3zeIe9feyXSvZmwKy5T2O5tq7PAjC3_ftLUr_UtT828RouxQ_ggQXo-sZ8dDqWrD5F_Qz2IayWxzNaWTmPKiIpMihZCLy7xXY8VsJvqYwP4V4-_a-0KbZnlLQgePjsc4ykqz75nLqT8EE7WVInG5upg9eIgnNrlBz97TkUqqRoKY4R82J0WGFXuNNTzdB65X8Dli3NIt-MobueqHyd-AfXXGEo_7gaJPwsSwWZ7WKAxESRH9SDPscRg_hk_AD2jTrg-MSYSiTMabrIocXDJ5jZ2MBOKrXZuPTfs’
–header ‘Content-Type: application/json’
–data ‘{
“hip”: {
“id”: “Test-hip-0001”
},
“requestId”: “bc123582-401f-479c-a018-007b6d741893”,
“unverifiedIdentifiers”: []
}’

we are getting this error

{

"error": {

    "code": 1401,

    "message": "Token verification failed"

}

}

Hi @pritamsingh07100
The token which you are using is wrong. Please use the correct token received

@IntegrationSupport @Sachin @ayadav33 we are using login token as X token and the session token as authorization token is that correct?

Yes that is correct but token which you have copied is wrong or you might have missed something. Try to decode that token in jwt.io. Make sure you have copied entire token

@ayadav33 yes i know token is wrong i removed some line from the token just for security purpose

My login token received from this api - https://dev.abdm.gov.in/cm/v1/apps/phrAddress/auth-confirm has all account information. I think token which you are using has only mobile number

@ayadav33 yup am using M1 apis login token this is api i am using /v2/registration/mobile/login/userAuthorizedToken

You are developing M2 or PHR?

@ayadav33 This is for M2

If it is for M2 which means you are an hip, then for discovering care context use this api - https://dev.abdm.gov.in/cm/v0.5/care-contexts/discover
https://dev.abdm.gov.in/gateway/v0.5/care-contexts/on-discover

Please refer this link - https://sandbox.abdm.gov.in/sandbox/v3/documentation?doc=build_hip

@ayadav33 yes am using same urls

@pritamsingh07100

As we can see you are not passing the correct token. please pass cm api token for this flow.

Here I am providing the API and documentation for generating the correct token.

https://sandbox.abdm.gov.in/sandbox/v3/new-documentation?doc=LoginPHRApp