Announcement Announcement Module
Collapse
No announcement yet.
Post to a facebook page problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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" />

      Comment

      Working...
      X