Facebook: How to update the status from the page profile? - php

I have a problem with cross-posting to Facebook. I can post some info to my personal wall (used parsing or Facebook API), but I need to post to the page of a group (ex: facebook.com/pages/$Pagename/$PageId ). (I am manager on this group and can post manually, but need the same functionality automatically from my site.)
And I have errors each time I try to do the posting automatically to my own group:(
1) When I use parsing I get message 'The post could not be shared.'
(from m.facebook.com/sharer.php?error=1&_rdr )
2) When I use parsing and send post-data through m.facebook.com/a/home.php?refid=$NumberID
I can post the message from the group page. But if the message contains a link, it is posted on behalf of my profile, but I want to make a post from the group page with link on my site.
3) When I make posting through Facebook API -- I get the error (#200) - "The user hasn't authorized the application to perform this action"
I make server authentication. And I want make this without permissions query of the current user (therefore tried parsing).
again:
I can update own(!) status through this three methods (with link too). I need update profile of my page (message with link).
Is it possible?
Thanks in advance.

Related

Post to Page as another Page - Facebook API

I'm looking to have my app post to a non-owned Page AS one of the user's owned pages (owned-page Posted to non-owned-page's feed).
If you log in to Facebook as your page, you are allowed to do this on the desktop platform. However, my trials (and search) have returned that it's "not possible" to execute via Facebook Graph API.
Specifically when I execute the following POST:
/{target-page-id}/feed?message=test&access_token={owned-page-access-token}
I receive the following response from FB:
(#200) Posts where the actor is a page cannot also include a target_id\n other than EVENT or GROUP
Posting to Event or Group works, but doesn't allow me to post to a target page.
Any workarounds? Having a hard time grasping that you can do it on the desktop portal but not via the API
Thanks in advance!
You might try defining who is posting to the page by adding the query string: &from=[name of page]
Ex:
/{target-page-id}/feed?message=test&from=[PageName]&access_token={owned-page-access-token}

Is it possible to display Facebook users timeline on website?

OBJECTIVE: I need to display latest 5 entries from users timeline on website, using PHP.
Please not that i speak about timeline of user profile - not fan page, not group.
SO FAR I DID THIS:
Registered as Facebook developer
Registered app
Obtained token
Opened url: https://graph.facebook.com/USER_ID/feed?access_token=MY_TOKEN
Voila. Feed of that user is displayed now, but..
PROBLEM: So now i have users feed, but it looks like its partially working.
It happens often that it don't displays some updates, sometimes it displays just date of the post and not the content.
However when i try to grab feed from some facebook fan page, then everything work normal.
MY QUESTION: Are we allowed to grab user timeline? If yes, what im doing wrong?
You won't ever see all the information that is visible inside the Facebook app via the api. This comes from how Facebook filters out the data. See this Facebook Developers blog post for more information: https://developers.facebook.com/blog/post/478/
Yes you are allowed to to grab user timeline posts, even with a limit, if your app asks for read_stream permission. Issue an HTTP GET request to the below URL:
https://graph.facebook.com/user_id/posts?access_token=token&limit=5

Facebook add POST to page

I've managed to automattically add a post to my profile using /me/feed/ , but how can I add a post to a page created within my account ?
they say " /[page id]/feed/ " how can I find the right page ID ? Do I need to use another method to post to my facebook page ?
I've searched on how to get the page ID, I've obtained and used this ID: 123397591098452 for page: http://www.facebook.com/pages/Siteique/123397591098452 but the post is not working.
Note: the application has all the right privileges.
This is the way i`m sending the post:
$facebook->api('/me/feed/','POST',$post);
Try logging into your app under the account the the page belongs to, then turn the code into an oauth token, and then use that oauth token with your request. Good Luck

Post to Facebook page feed without first liking the page

Is it possible to post to a facebook page feed without first liking the page?
I tried the feed dialog using something like the code below --
https://www.facebook.com/dialog/feed?app_id=X&to=Y&redirect_uri=Z
which resulted in an error "An invalid target was specified: Y. The target must be a page, event, or user that the actor can post on the wall of."
I also tried creating an access token from the page admin and then posting using the graph, but that resulted in the feed post coming from the admin and not the user who is posting.
I simply need the user to be able to post to the pages wall. Any ideas?
Thank you!
See the FB docs:
feed
This connection corresponds to the Page's Wall. You can create a link,
post or status message by issuing an HTTP POST request to the
PAGE_ID/feed connection. To see more details please see links, posts,
and status messages documentation.
To impersonate the Page when posting to the wall (i.e. post as the
Page, and not the current user), you must use a Page access_token with
the manage_pages and publish_stream permissions, as described under
Page Access Tokens above.
Posts may be targeted to countries, cities, regions or locales using
the targeting parameter. Please see Post for additional information.
edit:
Sorry, bad part above, correct is:
posts
Create
You can create a post on a Page by issuing an HTTP POST request to
PAGE_ID/feed with the publish_stream and manage_pages permissions and
the following parameters.

facebook post from php through graph api

i use this code to authorize me with my app
https://graph.facebook.com/oauth/authorize?client_id=myappid&scope=publish_stream,offline_access,manage_pages&method=post&redirect_uri=http://www.site.com/indexold.html
i get the access token and i use this to do the Impersonation trick
https://graph.facebook.com/oauth/access_token?client_id=myappid&client_secret=myappsecret&redirect_uri=http://www.poemsofloveapp.com/indexold.html
lastly i use this to post to my page ... not the app page but a page i have created
https://graph.facebook.com/mypageid/feed?access_token=1234|asdasdasdasd&message=hello%20world&method=post
the post is successful but it is shown as i have posted it . i want the profile picture of the group to be shown next to the post is this possible? instead mine is shown next to the post!
What you are looking for is called impersonation in facebook graph api terminology.
Check here
And, also here

Categories