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.
Related
I would like to post a photo to the Timeline of a Facebook Page via Graph API. My setup is node-based and written in coffeescript. My current implementation is this (error handling ommited):
sendImageToFacebookTimeline = (user, message, imageURL, callback)->
url = "https://graph.facebook.com/#{pageID}/photos"
params =
access_token: user.accessToken
url: imageURL
message: message
request.post({url: url, qs: params}, (err, res, body)->
body = JSON.parse(body)
callback(body.id)
)
This succesfully posts the photo to my Page. But instead of appearing on the timeline it appears in the "Photos of PAGE".
How can I post to the Timeline?
EDIT:
I found out that by posting to /page_id/feed with option "picture" you can send a photo to Timeline. This shows up the same way as og:image and the view is similar to a link.
EDIT 2:
If you upload to a album, it will show up on Timeline. I have created an album and trying to post to it. But the API doesn't seem to accept URL for source when posting to /album_id/photos.
To post to own Timeline you need to acquire Page access token from /me/accounts and not by getting a user token or exchanging token for a long term token.
With that and album ID you can post to an album, which shows up on the Timeline.
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.
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.
Is it possible to post on a page with a url scheme?
I currently have this, fb://profile/325899700848032
But this only opens the page ofcourse. What i mean is something like this
fb://profile/325899700848032/PostMessage/"test message" or ../PostImage/image
Is anything like this possible to do?
Thanks!
To post on facebook page you need to ask first for the famous manage_pages authorization. Once you have it you make a FBRequest on the openGraph for me/accounts which return an array of the current user pages and other application. You parse this json for each page and you pick the token_access and the id. You then set the page token access on your facebook manager and then you can post for example a picture to the page with the "{id}/photos" POST graph request {id} being the page id.
If you view facebook page, they are link left-bottom shows rss feed for facebook page, but unfortunately, the feed only shows status update by page owner, is there anyway to get feed from everyone who post the new status in the page....
There's another way to get the feed from a public Facebook page as RSS, which is entirely public and can be retrieved anonymously; i.e. requires no Facebook connect or other stuff. The format for the URL of the RSS feed is:
https://www.facebook.com/feeds/page.php?id=PAGE_ID&format=rss20
Where PAGE_ID is the Facebook ID of the page. Or even better, as JSON:
https://www.facebook.com/feeds/page.php?id=PAGE_ID&format=json
Use http://developers.facebook.com/docs/reference/api/, get the access_token like this: Facebook: post image and description to wall and in page album via php
These guys seems to be providing an API as well here - https://randomtools.io/developer-api/