Post with an image
Hi,
do you have any example for posting a text with a local image? I got this code example but I don't know which parameters include in the request.
api = GraphAPI(
app_id=FACEBOOK_APP_ID,
app_secret=FACEBOOK_APP_SECRET,
access_token=FACEBOOK_TOKEN
)
data = api.post_object(
object_id=FACEBOOK_PAGE_ID,
connection="feed",
params={
"fields": "id,message,created_time,from",
},
data={
"message": status
},
)
Thank you!
You can follow the docs to publish photos
Hello @astagi were you able to figure this out?
Unfortunately not @josylad I'd like to have a complete example with a local image to upload..
Unfortunately not @josylad I'd like to have a complete example with a local image to upload..
oh! Well, I was able to figure it out. @astagi
image_data = {"url": image_url, "message": content}
#upload an image
uploaded_image = api.post_object(object_id=page_id, connection="photos", data=image_data)
change connection to "photos" message = text you want to post on FB.
#260