I am trying to test an API on delhivery logistic test environment but keep getting same result each time even I am entering API key on there testing environment.
this is there test environment code below:
const options = {
"method": "GET",
"hostname": "staging-express.delhivery.com",
"port": null,
"path": "/c/api/pin-codes/json/",
"headers": {
"Accept": "application/json",
"Authorization": "Token api-token-key Pass Token as \"Token XXXXXXXXXXXXXXXXXX\""
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
but its showing this result even I am filling both required field
login or API Key Required
link to there test environment https://delhivery-express-api-doc.readme.io/reference/testpin-codes