Reputation: 333
I am trying to make a post to a Facebook page using the Graph API that includes an image. I have successfully done it with a two step process:
However, when I do that, FB posts the image to the page first and then posts the message with the image in it. Not ideal; I only want a single post with message and image.
I then tried keeping the image unpublished (adding &published=false to my image post). That worked to keep the image from posting on the page and I got an OK message with the image id back from FB. However, I received an error code (1 - "An unknown error occurred") from the FB API when I went to post the message with image.
I also tried to keep the image unpublished and flag that as temporary (adding &published=false&temporary=true to my image post) with the same result.
Anyone know how to post a message with image to a page without first posting the image to the FB page?
Upvotes: 1
Views: 1336
Reputation: 96306
The no_story
parameter can be used to suppress the automatic creation of a feed story for the photo upload.
https://developers.facebook.com/docs/graph-api/reference/photo#Creating:
no_story
boolean
If set to true, this will suppress the News Feed story that is automatically generated on a profile when people upload a photo using your app. Useful for adding old photos where you may not want to generate a story
Upvotes: 2
Reputation: 1462
You can add a caption
to your image post.
Or add the image as form data while creating the post.
Which Framework do you use?
Upvotes: 1