I am trying to post a feed on page along with photo,text posts without any error but picture doesnt get uploaded.
Also similar to Milestones it gets posted but how do i attach/upload a photo to it.
I am trying to Post a Milestone on FB using RestFB.
FacebookType publishResult = facebookClient.publish("pagename" + "/milestones",
FacebookType.class,
BinaryAttachment.with("photo", fileToUpload),
Parameter.with("title", title),
Parameter.with("picture", ""),
Parameter.with("description", description),
Parameter.with("start_time", new Date())
-......
But it posts the milestone without posting photo
It appears this is a (deliberate?) limitation of the Facebook Graph API. See Upload image to Facebook Wall / Feed via Graph API
You may post image data directly to a photo album but the feed endpoints only accept image URLs.
Related
I want to get the links of Facebook photos in albums posted from a page that I am managing. I tried to use facebook graph API. I could get the names and ids of albums via "{page_id}/albums/" . Then I tried to use the album id/?fields=photos{link} to get the link. But here it will provide facebook link (eg:https://www.facebook.com/page_name/photos/a.193909724216/193907241065159/?type=3)
But I want to show this images on a page. So I want the real image path. (eg:https://scontent.fcmb1-1.fna.fbcdn.net/v/t1.0-9/38801583_193907078972459378765588463616_o.jpg?_nc_cat=0&oh=6bdfdfc0cc225a1f035295bb2e2a8&oe=5BF8A013).
Can I get them using Facebook graph API?
I am try to publish link on Facebook fan page using graph API but it displayed as attachment not as normal feed which display thumbnail.
Where as when I try to publish same link on users wall it display properly showing image thumbnail.
Can any one tell me why Facebook graph API work differently.
Feed publish on FB fan page :
Feed on user wall :
Thanks to all, I am finally able to solve this issue, the issue was I am using {page_id}/feed method to publish link for video and image, which displayed as attachment on Facebook fan page.
Solution : {page_id}/links with parameters [link, message, picture]
Pls provide params you include in request to facebook. Maybe providing params as shown in answer to following question helps, i.e. picture?
Posting an embedded video link using the Facebook Graph API
I was using FB api to post photos to my fanpage's news feed (http://www.facebook.com/MyApp/photos_stream), but from some time it stopped posting it to news feed and it just uploaded photos to some album (http://www.facebook.com/MyApp/photos).
This is the api command I was using before and after it was working, nothing has changed on my side.
$result = $facebook->api('/123456789/photos', 'post', $attrs);
So the question is, how to post photos to fanpage wall (timeline) properly and why it stopped working by itself?
Thanks
I had the same problem a few times ago.
In fact it was working but you have to go to your photo folder and accept the uploaded image.
In the album Facebook will show you a panel saying you have to approve those photos.
By doing this Facebook will publish the images on the timeline.
I know this is very annoying but I didn't find a better solution (I think Facebook has added a new security to avoid some abuses).
EDIT:
Look at the Facebook documentation.
You can post photos to a Page's Wall by issuing an HTTP POST request
to PAGE_ID/photos with the publish_stream and manage_pages permissions
and the following parameters.
Make sure you are using those two permissions and that your parameters are correct.
Here's what I've done:
Get page access token from /me/account
Paste in on the graph explorer tool.
Make a post request with parameters named message, url (trying to upload via url) to http://graph.facebook.com/{albumid}/photos.
Graph returned a Id.
Figured out the problem. We need to approve the photos from by going to the album as the Page.
Is there a way to post a photo to an album, but do it in a way that it is hidden from the Timeline.
I am able to post Photos using the Graph API to the album and then manually go and hide a newsfeed post resulting from the timeline for the Wall.
Is it possible to do this at the time of posting the Photo itself. Is there a field/attribute that I can set which will prevent the Photo Post from showing on the Timeline ?
Thanks!
Yes, add no_story:1 to your POST data, images will be uploaded but not shown in timeline.
check out http://developers.facebook.com/blog/post/482/