I tried following the document: https://developers.line.me/en/docs/messaging-api/reference/#get-content
I tried get by Postman, i got image success. But I want get by lambda function use line/bot-sdk. My code:
//get image send by user
var http = require("https");
var options = {
method: "GET",
hostname: "api.line.me",
path: "/v2/bot/message/8073497242123/content",
headers: {
"Authorization": "Bearer 99GP35mAU2+OF4L4RYM92h9+Hbfm11TBwNG7vP9uIthDGgWbcnx8JYH5kWgEQYQDJliCCLZOvIOLblrX8kBq60F5XsK1JHBs/LDXrv1GUTH4OzabVjWigJW9akRhkF5j53EgxwYL1fNXJoyvDQsE6AdB04t89/1O/w1cDnyilFU=",
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
console.log(chunks);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body);
});
});
req.end();
But when I check response on AWS Cloudwatch, it does not return any data