Question

I created a Facebook app that I will use to programatically post information to Facebook. I've got it working so that I can post to my wall, but not the page I'd like it to go to (for which I am 1 of 2 administrators).

this posts to my page just fine:

FacebookClient facebookClient = new DefaultFacebookClient("<ACCESS_TOKEN>"); 
FacebookType publishMessageResponse = facebookClient.publish("<MY_FB_NAME>/feed", FacebookType.class, Parameter.with("message", "Testing..."));

but if I try to post the page, I get an error:

com.restfb.exception.FacebookOAuthException: Received Facebook error response of type OAuthException: (#200) The user hasn't authorized the application to perform this action

The code is the same, except I replace my name with the page's ID:

FacebookClient facebookClient = new DefaultFacebookClient("<ACCESS_TOKEN>"); 
FacebookType publishMessageResponse = facebookClient.publish("<THE_PAGE_ID>/feed", FacebookType.class, Parameter.with("message", "Testing..."));

The app is listed as one of the apps for the page.

Thanks for any help with this, Frank

Was it helpful?

Solution

Are you sure you have the correct (publish_stream) Permission?

You'll need that to post as the user to places other than their own profile.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top