I have a Facebook page at https://www.facebook.com/xxxx and a web site at http://xxxx.com. How do I make a status update to the facebook page to correspond with every new posting on the actual web site? That update should be authored by the page, and not by my personal Facebook account.
I know it might seem like this is a duplicate question, but hear me out. I have been working on this for hours. I’ve found a lot of help on this topic, but all of it is incomplete or out of date. Most answers tell me what I need to do, but not how to do it.
The closest thing I could find to what I’m looking for is this note in the official docs.
https://developers.facebook.com/docs/opengraph/#publishing
Here’s what I’ve been able to do so far. I created the facebook page. I created a facebook application. I added the app to the page. I added the app to my personal account and granted it the manage_pages permission. I tried to grant it manage_pages permission from the perspective of the page user, but that doesn’t seem to be possible.
I can use this to get an access key for the application:
curl -s -F grant_type=client_credentials -F client_id=APPID -F client_secret=APPSECRET https://graph.facebook.com/oauth/access_token
Then I try to do this to actually make a status update.
curl -s -F access_token=ACCESS_TOKEN -F message='test' https://graph.facebook.com/xxxx/feed
This returns a message that the user hasn’t authorized the application to perform this action. I assume that’s because I’m trying to post as the page user and not as my personal user.
How can I get the correct access key to make a post on the page as the page user? Also, how can I be sure that access key won’t expire? Once I have the access key, how do I actually make the post so that it shows up in the right place?
Here’s how the
manage_pagespermission works.manage his page.
manage_pages,publish_stream, andoffline_accesspermissions (just like a normal connect app). You must make sure you ask foroffline_access, otherwise the access token will expire.https://graph.facebook.com/uid/accounts/?access_token=bobs_access_tokenand look for the “Awesome-O” page to get the proper access token.I’ve made a method that simplifies this a little bit for you.
Once you have the actual access token, the following HTTP POST will actually create the status update.