Mahmoud Salama
Mahmoud Salama

Reputation: 11

How to send an animated GIF in a card like this in Facebook messenger API?

I tried using the generic template, but it does not animate the GIF - this is needed for showing a 'Powered by Giphy' banner in the bottom of the card - like image below.

animated GIF received in a messenger card/bubble

Upvotes: 0

Views: 1477

Answers (2)

Ram
Ram

Reputation: 327

Two bubbles. First is the image, the second is the advert.

Upvotes: 0

sotirelisc
sotirelisc

Reputation: 392

You have to send an attachment of image instead of a generic template, like this:

curl -X POST -H "Content-Type: application/json" -d '{
  "recipient":{
    "id":"USER_ID"
  },
  "message":{
    "attachment":{
      "type":"image",
      "payload":{
        "url":"https://petersapparel.com/img/shirt.png"
      }
    }
  }
}' "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN"

Check out this page: https://developers.facebook.com/docs/messenger-platform/send-api-reference/image-attachment

Upvotes: 2

Related Questions