Reputation: 618
I'm following these steps to create a wall post with a picture using the FB Graph API:
access_token - my current access_token
message - a simple message like "hello"
object_id -the post_id obtained in step 1, after photo upload
The post message appears on the wall, but there is no photo:
http://img545.imageshack.us/img545/1369/screenshot6ev.png
What am I doing wrong?
I mention that i don't want to attach a link to the photo. I want the image to appear without any hiperlink, like the ones that are manually uploaded when creating a new post.
Upvotes: 3
Views: 14133
Reputation: 5
You should use /me/photos without no_story parameter. You can add your message to message parameter and it will appear on the user's story board.
Upvotes: 0
Reputation: 1120
Use you photo_id after photo upload to get photo info. Photo info includes a set of links to its thumbnails. User one of the thumbnail link to post on the wall by "/me/feed" graph API. See the link to get more details: https://stackoverflow.com/a/23199781/989896
Upvotes: 0
Reputation: 20396
It should be object_attachment
instead of object_id
.
Check the document here: https://developers.facebook.com/docs/graph-api/reference/user/feed/
Upvotes: 3
Reputation: 219
I've been struggling with the same thing - it seems like a gross omission from the APIs to leave out something which is what most people do.
The only way around it that I have found is to first create a unique serial-numbered album, and then post the photo to that album:
FB.api('ALBUM_ID/photos', 'post', params, function(response) { ... });
Where params contains the post message and the url of the photo/picture. But it's such a kludge, creating an album for a single picture! However, that way you don't get subsequently posted pictures grouped together.
There is a more complete code snippet at How to do simple Facebook status post with text and picture.
Upvotes: 1