Results 1 to 3 of 3

Thread: Post to a facebook page problem

  1. #1
    Join Date
    Oct 2012
    Posts
    2

    Default Post to a facebook page problem

    Hi there,

    I guess that this is something easy to do but still I cannot figure out how. I use SpringSocial to connect on facebook. The authorization is done successfully and the authorized user is administrator (Manager role) in one facebook page. What I want to do is to post on the wall of that facebook page. To do so I tried to use the following code:

    Code:
    PageOperations pageOperations = facebook.pageOperations();
    pageOperations.post("xxxxxxxxxxxxx", "Hello");
    The facebook page id used as the first parameter in the post method has been retrieved via the http call :

    https://graph.facebook.com/page_name

    I keep on getting the following exception which is rather very self-explained

    Code:
    org.springframework.social.facebook.api.PageAdministrationException: The user is not an administrator of the page with ID
    Any idea what is going wrong?

    Thanks in advance.

    D.

  2. #2
    Join Date
    Aug 2004
    Posts
    1,075

    Default

    You're right: The exception is self-explained. The access token used to create the FacebookTemplate represents a user who is not the admin of the Facebook page that you're attempting to post to.

    I need to re-educate myself on posting to pages (it's been awhile since I've last done it), but I believe that by pages can be locked down so that only page administrators can post to them or they can be open so that anybody can post to them. I'd check the permissions for that page and see if the box that says "Everyone can post to {page name}'s timeline" is checked or not. I'd also check to make sure that the user who authorized the app is an admin of the page.
    Craig Walls
    Spring Social Project Lead

  3. #3
    Join Date
    Oct 2012
    Posts
    2

    Default

    That was easier than I thought. I was just missing the "manage_pages" value from my post request. That did the trick. See below


    Code:
    <form action="<c:url value="/signin/facebook" />" method="POST">
    	<button type="submit">Sign in with Facebook</button>
    	<input type="hidden" name="scope" value="email,manage_pages,publish_stream,offline_access,read_stream" />

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •