Announcement Announcement Module
Collapse
No announcement yet.
Error in feedOperations().getPost(entryId) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error in feedOperations().getPost(entryId)

    Hello,

    I'm trying to receive a single post but the call to get this post throws:
    java.lang.ClassCastException: org.codehaus.jackson.node.BooleanNode cannot be cast to org.codehaus.jackson.node.ObjectNode

    First of all, I save the id of the post:
    [CODE]String idFacebook = facebook.pageOperations().post(idPage,message,link );/CODE]

    Then, I want to get the post with this call:
    Code:
    Post post = facebook.feedOperations().getPost(idFacebook);
    Thanks

  • #2
    I've just tried the same thing (posting a link to a page and then fetching that Post object) and it worked for me. Of course, there are many variables in play here that could prevent it from working.

    It looks like Facebook is returning a boolean (most likely "false") when you fetch the post, but a JSON object is what is expected. I believe this may be Facebook's quirky way of telling you that you don't have permission to read the Post (even if you did have permission to create it). Since this was a post to a page, you should have that page as one of your user's accounts (otherwise the post() call would have failed with a PageAdministrationException). But when you post you are using a page-specific access token (all handled within the Facebook binding) and when you read you are using your user's access token. You may have admin rights to post to the page, but may not have permission to read it's feed.

    I'd be curious to know (1) what permissions your user's access token has...you can get those from facebook.userOperations().getUserPermissions(), and (2) what the value of facebookId is when you call getPost().

    In any event, the API binding should not have let that exception escape, as it indicates an internal binding error. I've created https://jira.springsource.org/browse/SOCIALFB-18 to track this.

    Comment


    • #3
      Thanks for the answer because it let me see I needed another permission (read_stream). I thought that publish_stream allows to read too.

      Comment

      Working...
      X