Image Attachment

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

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 Description Required

type

image

Y

payload.url

URL of image

Y

  • We support jpg, png and gif images