fbbotw.post_image_attachment

fbbotw.post_image_attachment(fbid, img_url, is_reusable=False, messaging_type=’RESPONSE’, tag=None)[source]

Sends an image attachment

Usage:
>>> # Set the fbid of user you want to send the attachment
>>> fbid = "<user page scoped id>"
>>> # Set the url for the hosted image
>>> img_url = "http://i.imgur.com/uAUm3VW.jpg"
>>> # Send the image
>>> response = fbbotw.post_image_attachment(
        fbid=fbid,
        img_url=img_url
    )
>>> # If you want to make this attachment reusable, send
>>> # a third parameter as is_reusable=True and the response
>>> # object will have the attachment id to be used later.
Parameters:
  • fbid (str) – User id to send the image.
  • img_url (str) – Url of a hosted image (jpg, png, gif).
  • is_reusable (bool) – Defines the attachment to be resusable, the response will have an attachment_id that can be used to re-send the attachment without need to upload it again. (You can use the post_reusable_attachment method to upload using the id).
  • messaging_type (str) – Identifies the message type from: RESPONSE, UPDATE AND MESSAGE_TAG (Default: RESPONSE, if MESSAGE_TAG, tag param is required)
  • tag (str) – Tag classifying the message, must be one of the following tags
Returns:

Response object

Facebook docs:

/image-attachment