While hitting /account/getPngCard we are getting this response can anyone help me out…!!
Hi @sidsinghal,
https://healthidsbx.abdm.gov.in/api/v1/account/getPngCard
https://healthidbeta.ndhm.gov.in/api/v1/account/getPngCard
API is working fine in both beta and sandbox environments.
Please find below Curl
curl --location --request GET ‘https://healthidsbx.abdm.gov.in/api/v1/account/getPngCard’
–header ‘X-Token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIzMi0zMjE3LTY4MTEtODA0NiIsImNsaWVudElkIjoiaGVhbHRoaWQtYXBpIiwic3lzdGVtIjoiQUJIQS1OIiwibW9iaWxlIjoiNzA3NTczNjMzMCIsImhlYWx0aElkIjoic3Jpbml2YXNzYngxMjNAc2J4IiwiZXhwIjoxNjU2NjcwNzM0LCJoZWFsdGhJZE51bWJlciI6IjMyLTMyMTctNjgxMS04MDQ2IiwiaWF0IjoxNjU2NjY4OTM0fQ.nNkDk4ckas_A1JD-4XKAwzBZ2Jv5Hu02p5ZkCSUoq_cY4Q6LSB__IpsKVSZyeOToiV_LR1ty3ZkU_R5YOl_aFOu8b2lAwa-LBnQQVU28a4sIumHoFYCnTMz7gC-daBFjzVlvgpznDXLYcBk4ZFrc32hv6aMaXyX9m7f8oZVqeicn2JMnyD3TI6yLDvCGgYXxSgkHjL_EyHqJ0RVXN_d-nGx_IT2stsGehAS9IfXKKVEEeaNPq6PC-pHSXbVk8ANa-7XttKceQTOvCl5DgOzfrwJTdCxHcSb-QLOdWOZ8zZ0PbiHe_RRvF2cCFEL2MR_cEYvE-r9FBBMVxxhbj9S18bd9aM-AwAr-RlxNsr3DAdyCNgWCusZtR-9tvZPlGLTx2QGuAoNbv5H8EoPd6YcYls-yZBLsGsfdDOyTnnqiR1OhS_M_ALsh24epbY1Zt02TMvaFxByT58s2BK0wuxr3ig3doK7PM3un6857vqi8PkOG058odc2wNEp1i8iexqNdaO0G3c-9EaRJZc0Ve0JwF2TJjT8JxZ61YdTupwRxXa3YCcPlXTkzWtTQNHWFs54_xkdqIGT0Yp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pbGUiLCJjbGllbnRJZCI6ImhlYWx0aGlkLWFwaSIsImNsaWVudEhvc3QiOiIxMC4yMzMuNjcuMjQxIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtaGVhbHRoaWQtYXBpIiwiY2xpZW50QWRkcmVzcyI6IjEwLjIzMy42Ny4yNDEifQ.FP1QSeFfETg9mpVVDyDPkjCCHOfX5aPx1l2X5pgyJw3armw1PTqCA9PEOJoxXCM-O8wMzASglPOnlZZ0kb2LOoriZG_TussPXLZedYBOr217zbD5crK1Rc8PA9-J_vG_aO3PgVS-TOI51F0hIwNesYDzKfB7Q9RYh-FDsvAPJrS1zkJZFKhuIuIjldLJB-Tbn1TiThQ08_KpAi5rhLxjiDjqrhg-tm_ERQFYbtG6WVDcYAPZJVNAnaY3Dh5NI5Kyi8VQhfR_YpvifE8s2LU9dHcO54HgHzJh2MkiZa392CprbMhRNdO5AA0SnQw1Pg_bpZQdtYMaLIpU-rRXMeXjkA’
–header ‘Cookie: TS01c078b5=01115a1c90fb623183b7f5946cdce3a4f9838e87b676d7eab041b845ccaebe75f8eb111254e76df40d3d40dfa4b9a22948180340be’
curl --location --request GET ‘https://healthidbeta.ndhm.gov.in/api/v1/account/getPngCard’
–header ‘X-Token: Bearer eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI3MC0zMDY3LTYwMTEtNTYzMCIsImNsaWVudElkIjoiaGVhbHRoaWQtYXBpIiwic3lzdGVtIjoiQUJIQS1OIiwibW9iaWxlIjoiNzA3NTczNjMzMCIsImV4cCI6MTY1NjY3MDk0OSwiaGVhbHRoSWROdW1iZXIiOiI3MC0zMDY3LTYwMTEtNTYzMCIsImlhdCI6MTY1NjY2OTE0OX0.r2bpRR6dON2KPeX3pdw0AkSix1soL8gFQgB_BYkm7_Zwg_lu9jYCdA3wBkkVIQIZoZKfUDiSznIjk–D_T22w_q3b3OJqyMYrLimJz5a8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getPngCard", function (req, res) {
var authToken = "Bearer " + NDHM_accessToken;
axios({
method: “GET”,
url: “https://healthidsbx.abdm.gov.in/api/v1/account/getPngCard”,
headers: {
Accept: “*”,
“Accept-Language”: “en-US”,
“Content-Type”: “application/json”,
Authorization: authToken,
“X-Token”: req.body.token,
},
})
.then((d) => {
console.log(“Response:data”, d.data);
const keys = Object.keys(d.data);
console.log(keys);
res.render(‘plastic’, { title :‘Plastic Card’, img : d.data });
})
.catch((errors) => {
console.log(“Response:Errors”, errors.status);
res.status(500);
});
});
if we print the d.data then it gives the response as shown by sid singhal in image and if we set in the image tag as < img src = “<%= d.data %>” alt=" Png Image" > then in the view it shows the alt text only. Please tell us how can we decode this PNG image and display it in the view engine.
going through same problem, can you please help us
@VSrinivas same as above i got successfully response from
https://healthidsbx.abdm.gov.in/api/v1/account/getPngCard Api as PNG encoded format , i try to encode the above code its give error . please can you let us know how to view/show above pngcard in html page .
Hai, Is this got resolved. We are also getting the pngCard output in this format and not able to process this content.
Using authentication api’s.
I am using https://healthidsbx.abdm.gov.in/api/v1/auth/authPassword
For authentication.
Hey did you got any solution for this,Kindly reply if yes.
@vidhya86 @SagarSawant You guys also,did you got any solution for this??
Use the https://healthidsbx.abdm.gov.in/api/v2/registration/aadhaar/createHealthIdByAdhaar, if you are generating the new id. In the response json “token” is the x-token that has to used in getCard api