integrations
integrations copied to clipboard
Messenger: FB API sends expects non-empty string for image title
Overview
-
What project is this issue for?: broid-messenger
-
Is this a bug, security, feature request, or feedback: bug?
Steps to Reproduce
- Start application with settings
- Send message
Use the messenger integration to send an image like:
{
type: 'Image',
url: 'http://example.net/image.jpg'
}
Observed
Facebook API responds with:
error: 400 - {"error":{"message":"(#100) Param [elements][0][title] must be a non-empty UTF-8 encoded string","type":"OAuthException","code":100,"fbtrace_id":"F8DlzRhbyZE"}}
Expected
The integration should send an image.
It looks like the empty string in the helpers cannot be used as a fallback value. Maybe the key needs to be omitted in that case?
It's expected, Media title is mandatory by facebook API. One workaround is to add a piece of code to generate via the URL a title for the media. look here https://github.com/broidHQ/integrations/pull/144/files
I really have no clue how it is done, but when you use api.ai to hook into Messenger, you can send images without any sort of text attached. Don't know if that's feasible in this context though.
You right, API.ai use the Image FB template for the attachment. I did the fix to use this template when the name if not fill. Otherwise, i use the generic template.