1

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);
}
bikash
  • 433
  • 1
  • 6
  • 18
  • I noticed that on pasting the url on the browser, the image is loaded successfully. I'm not sure why it fails in the messenger .... some domain issues ? – bikash Jun 19 '17 at 06:29
  • There seems to be an issue logged in https://developers.facebook.com/bugs/1536325359771371/ I'm assuming it could be a facebook platform bug – bikash Jun 24 '17 at 08:49
  • Possible duplicate of [Facebook Messenger API: "Failed to fetch the file from the url" when the file exists](https://stackoverflow.com/questions/41436779/facebook-messenger-api-failed-to-fetch-the-file-from-the-url-when-the-file-ex) – Bob Swager Jul 13 '17 at 12:10

0 Answers0