Skip to content
This repository has been archived by the owner on Feb 8, 2020. It is now read-only.

Messenger: FB API sends expects non-empty string for image title #137

Open
m90 opened this issue May 3, 2017 · 3 comments
Open

Messenger: FB API sends expects non-empty string for image title #137

m90 opened this issue May 3, 2017 · 3 comments
Assignees
Labels

Comments

@m90
Copy link
Contributor

m90 commented May 3, 2017

Overview

  • What project is this issue for?:
    broid-messenger

  • Is this a bug, security, feature request, or feedback: bug?

Steps to Reproduce

  1. Start application with settings
  2. 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?

@killix
Copy link
Collaborator

killix commented May 10, 2017

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

@m90
Copy link
Contributor Author

m90 commented May 10, 2017

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.

@killix
Copy link
Collaborator

killix commented May 10, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants