I'm building a facebook chatbot using nodejs platfrom.I'm also using ngrok to tunnel my request locally.I'm trying to serve Images for attachements and for Generic templates locally through ngrok. The GET and the POST request all are working fine.However on loading the image as attachment I get the following error.
{
"error": {
"message": "(#100) **Failed to fetch the file from the url**",
"type": "OAuthException",
"code": 100,
"error_subcode": 2018008,
"fbtrace_id": "A6C0kcZrdfw"
}
}
Any other urls (except the ones i'm serving locally through ngrok) is working fine.
following is the code :
var messageData = {
recipient:{
id:recipientId
}
message:{
attachment:{
type:"image",
payload:{
url: "https://" + <ngrokNo> + ".ngrok.io/image/Destination/testImg.png" // Doest not work
// url: "http://cdn2.business2community.com/wp-content/uploads/2016/06/facebook-messenger.png" // Works
}
}
}
};
callSendAPI(messageData);
}