Hi,
For the below client and secret getting the unauthorized response, attached below are the API hits.
Please check the provided client and secret key as this is not working
Client Id : docprime_001
Client Secret :4239d931-7384-4a52-afac-31072487422b
curl --location --request POST ‘https://dev.ndhm.gov.in/gateway/v0.5/sessions’
–header ‘accept: application/json’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01960242=01115a1c90a28bf1c644b063a738eefd4564a7710d729932c954ec127ebc176eb2b5fc969aead3d9fc30b59b35dcc512475fa863f3’
–data-raw ‘{
“clientId”: “docprime_001”,
“clientSecret”: “4239d931-7384-4a52-afac-31072487422b”
}’
Response -
{
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2MjkxODAwMjgsImlhdCI6MTYyOTE3OTQyOCwianRpIjoiMjNlZGEyZDktOThmZi00NjMzLWE0ZWEtYTM4YWZlNmQwYjU2IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI2NTI3Zjk4YS02N2JjLTRlZWUtYTgwYy0zMmFmZWIxYTQzZmUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJkb2NwcmltZV8wMDEiLCJzZXNzaW9uX3N0YXRlIjoiMjM2NjZiZmItZjgxMy00YzE3LTkyMWQtNzU2ZGM5ZDQzODFkIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vbG9jYWxob3N0OjkwMDciXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwiaGVhbHRoX2xvY2tlciIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImRvY3ByaW1lXzAwMSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVj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dGgvcmVhbG1zL2NlbnRyYWwtcmVnaXN0cnkiLCJzdWIiOiI2NTI3Zjk4YS02N2JjLTRlZWUtYTgwYy0zMmFmZWIxYTQzZmUiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiZG9jcHJpbWVfMDAxIiwic2Vzc2lvbl9zdGF0ZSI6IjIzNjY2YmZiLWY4MTMtNGMxNy05MjFkLTc1NmRjOWQ0MzgxZCIsInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUifQ.cCG6auETqYAU8AnPnymlXvAyU-sWif4YPz-sJqwgN3o",
"tokenType": "bearer"
}
curl --location --request POST ‘https://healthidsbx.ndhm.gov.in/api/v1/search/existsByHealthId’
–header ‘accept: /’
–header ‘Accept-Language: en-US’
–header ‘Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBbFJiNVdDbThUbTlFSl9JZk85ejA2ajlvQ3Y1MXBLS0ZrbkdiX1RCdkswIn0.eyJleHAiOjE2MjkxODAwMjgsImlhdCI6MTYyOTE3OTQyOCwianRpIjoiMjNlZGEyZDktOThmZi00NjMzLWE0ZWEtYTM4YWZlNmQwYjU2IiwiaXNzIjoiaHR0cHM6Ly9kZXYubmRobS5nb3YuaW4vYXV0aC9yZWFsbXMvY2VudHJhbC1yZWdpc3RyeSIsImF1ZCI6ImFjY291bnQiLCJzdWIiOiI2NTI3Zjk4YS02N2JjLTRlZWUtYTgwYy0zMmFmZWIxYTQzZmUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJkb2NwcmltZV8wMDEiLCJzZXNzaW9uX3N0YXRlIjoiMjM2NjZiZmItZjgxMy00YzE3LTkyMWQtNzU2ZGM5ZDQzODFkIiwiYWNyIjoiMSIsImFsbG93ZWQtb3JpZ2lucyI6WyJodHRwOi8vbG9jYWxob3N0OjkwMDciXSwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwiaGVhbHRoX2xvY2tlciIsImhpcCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImRvY3ByaW1lXzAwMSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJvcGVuaWQgZW1haWwgcHJvZmlsZSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjguOTEiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImNsaWVudElkIjoiZG9jcHJpbWVfMDAxIiwicHJlZmVycmVkX3VzZXJuYW1lIjoic2VydmljZS1hY2NvdW50LWRvY3ByaW1lXzAwMSIsImNsaWVudEFkZHJlc3MiOiIxMC4yMzMuNjguOTEifQ.CkLwI83q92ecrX-l8E6C9hsh_9taMHAPjtaSVSWZywJ6RBZpnUI2BJbhRl2BBSlLW6aUJ4FL6F0fmiXtfij96YJddBkuJz0YPueBTxOEifN9oXmONpnRoHnx8wccee3b65caX1yh3147ob0JriI2H3rl6wLidCUx5qhlihKTXOk8vYWhrgY2VvVfogayRz38Mdj47f5_ANTdgtZnEOTzI8vOhLewF_VirJJq0U8_GbXJOxxfg0EyGXaxSP4UCkOAnDqqExDphkBbwkjSNK8PybAYunvU4ubUyVxyxltVx4anmX1o1zWbLsAcNfjPsn5Ry3xNuytvqXdD5ewwEuGw6A’
–header ‘X-HIP-ID: DOCPRIME_UAT_LOCKER’
–header ‘Content-Type: application/json’
–header ‘Cookie: TS01c078b5=01115a1c901a3df006519b8151cbca13c182deee42fca11f07b6f85c1dda8a7110b4ec5c50df9001cba807b4340106b5025ba85332’
–data-raw ‘{ “healthId”: “eight.test@sbx”}’
Response from the above api using the token generated by sessions api-
{
“timestamp”: “2021-08-17T05:51:10.440+0000”,
“status”: 401,
“error”: “Unauthorized”,
“message”: “Unauthorized”,
“path”: “/api/v1/search/existsByHealthId”
}
Thanks,
Rachit