V0.5/patients/profile/share

I am getting following error while calling “https://dev.ndhm.gov.in/cm/v0.5/patients/profile/share”.

{
“error”: {
“code”: 1401,
“message”: “Token verification failed”
}
}

Can you please help me with the error?

Hi @bhaskarocta

After successfully creating a session please use authorization token X-Auth-Token: Bearer token in the API header.

Thanks

Hello @Arvind_Tomar

Passed the token as above but still getting different error now.

Please resolve this.

Hi @bhaskarocta

Please share the CURL with us.

Thanks

Hello @Arvind_Tomar

Below is the cURL

curl --location --request POST ‘https://dev.abdm.gov.in/cm/v0.5/patients/profile/share
–header ‘Content-Type: application/json’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NDY2NTMwMjMsImlhdCI6MTY0NjY1MjQyMywianRpIjoiZmNmMTA3MDEtZmJjOS00MGY5LWExM2MtZWExYWY1NjcwYjczIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJlNGZjNDI2Yy00Njk4LTRmZTYtOTNhMS0wMGNiODliZGMxOTkiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAwMzcyIiwic2Vzc2lvbl9zdGF0ZSI6IjcyNzRmMmVkLTZmY2MtNDMzZS04M2NkLTI2ODg0YmIwYTIxYyIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJIaWRJbnRlZ3JhdGVkUHJvZ3JhbSIsImhpdSIsIm9mZmxpbmVfYWNjZXNzIiwiaGVhbHRoSWQiLCJPSURDIiwiaGVhbHRoX2xvY2tlciIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7IlNCWF8wMDAzNzIiOnsicm9sZXMiOlsidW1hX3Byb3RlY3Rpb24iXX0sImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUiLCJjbGllbnRIb3N0IjoiMTAuMjMzLjY4LjcxIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6IlNCWF8wMDAzNzIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtc2J4XzAwMDM3MiIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjguNzEifQ.Dyar3Awce4gNKykMSh_6BgTYIqgUuVi7IET4yHBeBC_dOoCB3WbwOpxW1vhcRRRfLuWvLacu-pyDLt-sSNgeeWfZ-ODQWqNwgmmoan7fdUOX_hzW6FhzoZwim2SYPyBxWdtDVZAG-zO0gmT8qBzAucku8UaLgVHAn1iqcppAxJO29IobLZ0jbx9k7WaOD6NzCfuqW0a1XC-7JVgR9QpPNXW8fADr-upyx3323Bpruv_U_-wXmmrMRnGZtF190RhBCJnYWtajDLjOBTncB90VqK-RW4V_OxwzxQt_ITT390PQ7UeAgaPvxye9XA_YzhfZbJ0Cw9FsulAv2nIJCHzZ3w’
–header ‘X-CM-ID: sbx’
–header ‘X-HIP-ID: octa-health-hip’
–header ‘X-HIU-ID: octa-health-hiu’
–header ‘X-Auth-Token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIyNi00MDMwLTA2NzEtODc0MiIsImNsaWVudElkIjoiU0JYXzAwMDM3MiIsInN5c3RlbSI6IkFCSEEtTiIsIm1vYmlsZSI6Ijc3NTM4NTY1MTUiLCJoZWFsdGhJZCI6ImJoYXN0ZXN0OEBzYngiLCJleHAiOjE2NDY2NTQzMjEsImhlYWx0aElkTnVtYmVyIjoiMjYtNDAzMC0wNjcxLTg3NDIiLCJpYXQiOjE2NDY2NTI1MjF9.aQsV1VWNKHSfVGcGCFPlM2a_U1li1JrWbNRcvJz7AgBKhkaHNJrT9RhHm0_3E-GEXm1HN0VpBGAdDG6GldlJOWvPdYVjPXRLjJdIpUxzXn_Y0EpshIxpZSnXVkVgrGdyBtSF4wg15X3EEkisARupWQ69ewER9_C-8hbhNgkIs5uBvE8eadZMLx39xrw8HRai8w0oBmjB6IjlP15yujAIJlIIqGG8hDZx46s3owDuw9I2s1mKEJT-Xa4mwzA-Q-fBj4Stm_sF7dPMf8V1jU7uyIJS2WWNTowu7NKfNFW7o9KCFHfWnYp8dO6LC9eg0–PZky3QxmDB91RyxAKqqu–hhi8pJho9JYt05ixDzp4NFEHBAGFWFT7StaGpgpTFi6z-3E8WZXnm1nO_u4hF24G-XA_8R_xMWXaPAUeb1a3tKHbJN_E5STwcCZwCl7lGE1SLTHMBqXRIlEo0SlopEh1Y1JaAOiFfAQG0yIIx5Q2u3sHjkv9Xw8Td6hxbDEoAqzUrPLeUntv_T7GLpqBRKG1GWmMIMaJg4jS9k_rC61azzIyH5leHog6AifilCZgxRmYWK6rmY2JWfbpqa3WvYJ2u00LlNEn1PHKkHvYkJmd79rYdjxKb_t9wV_JIVrcdjUIAt6Ea0UCSwUKG3B4ahv7f8FcLuHPLWkFfUIJopCqjU’
–header ‘Cookie: TS011c04bd=01115a1c9070924497de8712538774acb9ea9a50f9b1ccf5f64e974ab996a43f4f25a3dbd432bfe41903eb967d16d904f9ec520945’
–data-raw ‘{
“requestId”: “499a5a4a-7dda-4f20-9j97-e84589627061”,
“timestamp”: “2022-03-07T11:32:28.009000”,
“profile”: {
“hipCode”: “1”,
“patient”: {
“healthId”: “bhaskardada@sbx”,
“healthIdNumber”: “26-4030-0671-8742”,
“name”: “Bhaskar Pathak”,
“gender”: “M”,
“address”: {
“line”: “C/O Kamla Prasad Pathak Laukapur”,
“district”: “Amethi”,
“state”: “Uttar Pradesh”,
“pincode”: “227413”
},
“yearOfBirth”: “1995”,
“dayOfBirth”: “06”,
“monthOfBirth”: “10”,
“identifiers”: [
{
“type”: “MOBILE”,
“value”: “+917753856515”
}
]
}
}
}’

@bhaskarocta,

What are theses two different authorization token?
you are only suppose to send CM-Session Bearer Token

thanks

@bhaskarocta The URL is incorrect. You are using a Consent manager host.

{{GATEWAY_HOST}}/v0.5/patients/profile/share
Request payload is correct as defined in documentation. In Header you have to pass X-HIP-ID
https://sandbox.abdm.gov.in/swagger/ndhm-hip.yaml

for CM api URL is
{{CM_HOST}}/patients/profile/share
Request Payload
{
“requestId”: “3fa85f64-5717-4562-b3fc-2c963f66afa6”,
“hipDetails”: {
“id”: “string”,
“customCode”: “string”
}
}

https://sandbox.abdm.gov.in/swagger/ndhm-phr-app.yaml


You can use the below curl:
curl --location --request POST ‘https://dev.abdm.gov.in/cm/patients/profile/share
–header ‘X-AUTH-TOKEN: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJhbmp1QHNieCIsImNsaWVudElkIjoiUEhSLVdFQiIsInN5c3RlbSI6IkFCSEEtQSIsInJlcXVlc3RlcklkIjoiUEhSLVdFQiIsInBock1vYmlsZSI6bnVsbCwiZXhwIjoxNjQ3MzQyNDc5LCJpYXQiOjE2NDczMzUyNzksInBockFkZHJlc3MiOiJhbmp1QHNieCIsInR4bklkIjoiMDZjZDc4YjQtOTM4ZC00OGJkLWE0YTctNWQ1YmNkMzY2YzE4In0.Eliqk4eLh3bvjqAkV6s7GlpCTIZSHa-mlsYpSghatn-WfnMkWnhXsDrAcSP96iuYGUYsq9bqq-MKPpIhlPnP9jXIMvbGNwStFik_zCW8h8Y8FIH5vKZFNKZrfnKE7-ZZa_V7ShRISmp-eHIaQtdH362Z3adSKdcdVLORGlHp0vuP1ekkJfJgaKOTJ2uD-HdW_FJMqXVvxg6YaHx3_IdCA7IvDWWfjpshGgZYj55lCmN8LOpYxfsyiEc9DualRytanBq8tRRMBbzptTD_2cIEHPYsRM1ZsC0QGh-sE9OI4hW0FkuUOP1F1hcCqdcB7jEc5u-7-Y1x48vcR_L011SyDg’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS011c04bd=01115a1c902e69d35f2ba13b5bea36c8d3438d3b70adab1f7a460cee5042f5cfe96196fefe970fa52c81222a0d152a6c59ca124edc’
–data-raw ‘{
“requestId”: “8c0b3f26-6f54-4259-b93b-e4f4f202db48”,
“hipDetails”: {
“hipId”: “IN3410000238”,
“code”: “12345”
}
}’

The above cURL worked. Thank you so much.

Thanks for the curl @neha.parnami but we are still getting {“error”: {
“code”: 1500,
“message”: “Unknown error occurred”
}}
We are stuck here
Kindly help

I have attached the curl below
curl --location --request POST ‘https://dev.abdm.gov.in/cm/patients/profile/share’ \

–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2NTk1OTc2MTcsImlhdCI6MTY1OTU5NzAxNywianRpIjoiOTNjMmYwMmEtMzYyMS00MTQ3LWJjNDQtNDZiOWQ3YWMyZDEyIiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiJhM2MxNjExNS1jMmNhLTRiNTUtOWQ5Yi0zZjhmMjVmODBhZmIiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJTQlhfMDAxMjMwIiwic2Vzc2lvbl9zdGF0ZSI6IjY0NTg3MzJiLWRmNzAtNGQ2Mi05ZGY4LTRlMGFmODI1M2JiNiIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo5MDA3Il0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJoaXUiLCJvZmZsaW5lX2FjY2VzcyIsImhl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HJlc3MiOiJtYW5hbi4wODAzMDFAc2J4IiwidHhuSWQiOiI5ZWRjYzA1OC1mMTk4LTQwODktOGI5Zi00ZGUyZTJjNjdjNWUifQ.JiFNjCWUAv42jv_jh1f-nUwI6G0n3fgO8on4VMsSCZ3DbbrCDB8T82Pv61-ntqtHTnBvkVfFA3s0zzVuckh68w0aSKaebd9y5TPsLPM1B_9LXmLAshuXKg6TDde-oHgpKP1F_VAZ6tNqUukWfXF9iGey7ch3Vy306hX3Z9le2ksiG1pavVcGMRxuZxL-yfgeOBly635oBlq19YUQMQCTdYPzR_r6Cd_uFbX9VT16OAAixdkflVPkD2KIOhjWTlXeZsWeB5Ell4Ab-abf8TaobmU4B9Axn4u-_aGU1MQkkNxqZ7_N4oHoR2ylWmSabMrCszQbZ8pAn_7TDFMtHfNcTw’ \

–header ‘Content-Type: application/json’ \

–header ‘Cookie: TS011c04bd=01115a1c907bd4b9997271b08cce468f25297a43630baf54fdfa9e240383567fcd7c7efb8a70497687c3a8d10c1bfc43835b2bb553’ \

–data-raw '{

"requestId": "683d58df-1320-409b-a0b3-78cd0d37a05c",

"hipDetails": {

    "hipId": "SBX_001230",

    "code": "random helpful information"

}

}’

Can you please share the curl?

Thank you