Fb page post to another fb page with graph api - php

is there any way that I post to my partners facebook page as my fb page? I didn't find any solution for that - I know how to post to page via graph api, but it seems that page-to-page feauture is blocked.
Anyone?
Leo

Disclaimer: I'm not sure it's a bug or by design. I already report a bug at https://developers.facebook.com/bugs/285031211633194 related to link type post at may 8 2013
Let's say you are the admin fanpage called "Iptv",so you want to post to fanpage "coca-cola".
The first step is get Page Access Token via /me/accounts API. (Put this Page Access Token inside Graph API explorer's access token field for test.)
Then you can't simply do http POST request to PAGE_ID/feed with message parameter, because you would get error message:
What you can do is post a 'link' type post, then you're able to post as page.
Success post to coca-cola page as another page called 'Iptv':

Related

in facebook api How to attach a link or reference a page in message from php

In facebook api for php, we post a message on page or user wall. If we are updating status from facebook website, we reference a facebook page in our status as #some_page, but how to reference a page from php facebook message? I tried #some_page but it displays as a text, not a page link.
You need to surround the page-mention with brackets. Like #[page-id] or #[page-url].
See also the corresponding Open Graph API section on this topic.

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

Facebook post to wall

I have a Facebook Application Profile Page that I would like to create a custom script to perform wall posts on its wall. The reason I need this is because the existing Facebook "Post to Wall" functionality does not post the pictures I want it to.
What I need is a PHP webpage that allows me to do this:
Inputs:
App ID (App ID of the Facebook App that I am looking to post to wall)
API Key
App Secret
URL of Image to post
Message Body
URL of link
Output:
the post is made to the wall of the Facebook App Profile page, so that anyone who has "liked" the page can see it.
Any ideas, brainiacs?
That's all supported by the graph api, you'd need to submit to http://graph.facebook.com/app/feed with the post submitted as POST data (message), and of course an access token. If you use Facebook's own php library, there are functions which will implement the api calls using the curl library for you.
If you haven't used the graph api before, you should start reading their developer resources at http://developers.facebook.com/docs/reference/api

post on facebook page wall as facebook admin through facebook php api

I would like to post feed to facebook page wall as page admin. I can publish post to facebook wall with publish_stream from fb php api, but it is just as a normal facebook user. May I know how can I do likewise as a page admin (meaning that the post publish from facebook page and not from other fb user on the page wall)? Thank you. It is urgent.
Regards,
Benjamin
Just come across this question. This was a know bug within the Graph API which has now been addressed. There is an additional permission named manage_pages which has been added to the list of extended permissions. If you request this permission as part of your authentication process then you should be up and running.
Further information can be found in the documentation and the bug fix that has been put in place.
it is mentioned here.
If you want to post to Page Wall as Page, use page id in the UID not in the target_id.
Pages can't post to other pages.
If you want to post to Page Wall as Application, use page id in the target_id, and the app id in the UID here

Categories