Image Attachment

You can send images by uploading them or sharing a URL using the Send API. Supported formats are jpg, png and gif.

Supported Image Types

We support the following image types:

  • JPEG
  • PNG
  • GIF

If you are having issues with gif rendering, please try to reduce the file size. For best results we recommend keeping the number of frames below 75.

Examples

URL send

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"    

File upload

curl  \
  -F 'recipient={"id":"USER_ID"}' \
  -F 'message={"attachment":{"type":"image", "payload":{}}}' \
  -F 'filedata=@/tmp/shirt.png;type=image/png' \
  "https://graph.facebook.com/v2.6/me/messages?access_token=PAGE_ACCESS_TOKEN"    

Fields

attachment object

Property Name Type Description

type

String

Must be image.

payload.url

String

URL of the image.

payload.is_reusable

Boolean

Optional. Saves the asset for later use. Set to true to save the asset and return an attachment_id.


For more information, see the Attachment Upload Reference.