How to create and edit unpublished facebook post with image?
I want to create unpublished image post on facebook and then edit the message attached to it.
I can create an image by doing:
/me/photos
url: somewhere
published: false
caption: 'abc'
This, due to documentation should return
Struct {
id: numeric string,
post_id: string,
}
But it doesn't return post_id. If published is set to false the post_id is omitted. When I visit created photo on facebook I can edit attached caption and other parameters of the photo. But when I try to do it trough API I can only edit very limited amount of parameters, described here:
https://developers.facebook.com/docs/graph-api/reference/photo/#Updating
I also tried different approaches, of which most promising was to post unpublished photo, then create unpublished post with image attached. Since I'm trying to post to a page I'm using this endpoint:
https://developers.facebook.com/docs/graph-api/reference/v2.5/page/feed
/me/feed
caption: 'abc'
published: false
object_attachment: (id-from-previous-request)
If I could do it like this I could later edit the message, and the post would look the same as when using /me/photos normally.
I cannot do
/me/feed
caption: 'abc'
published: false
url: somewhere
Because this results with link post(and requires link parameter as well), which is different in look from image post.
I cannot figure what I am doing wrong - I just want to create unpublished post with attached image and then edit it. It's possible trough webpage, but all my attempts trough API have failed.
The related post_id for photo_id is always generated like this(for page):
page_id + '_' + photo_id
In case the photo was posted into different edge then instead of page_id corresponding id is used, for example it would be user id, if it was posted onto edge user/photos.
This behavior isn't documented anywhere where I could find it, nor it is guaranteed to work in the future. I contacted facebook support yet they didn't clarify if it's intended. They only said that it's by design that post_id is not returned.
链接地址: http://www.djcxy.com/p/66142.html