Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1416 posts 1797 karma points
    Jun 02, 2016 @ 12:01
    Gordon Saxby
    0

    Not all requested fields are returned

    I have tested this set of fields in the Facebook Graph API Explorer and it returns all data (if it is present):

    /posts?fields=created_time,message,id,picture,full_picture,description,link,name,permalink_url,status_type
    

    However, when I use the same field list via Skybrud, not all the fields are returned. Particularly, I am missing "permalinkurl" and "fullpicture".

    The code I am using is:

        // Initialize a new service from an access token (user, page or app)
        FacebookService service = FacebookService.CreateFromAccessToken("my-access-token");
    
        // Make the request to the Facebook Graph API
        FacebookPostsResponse response = service.Posts.GetPosts(new FacebookGetPostsOptions
        {
            Identifier = "MyPage",
            Fields = "created_time,message,id,picture,full_picture,description,link,name,permalink_url,status_type",
            Limit = 5
        });
    

    I looked on the Facebook API page here https://developers.facebook.com/docs/graph-api/reference/v2.5/post#fields but that doesn't show a field called "permalink_url".

    I want a link to the actual post on Facebook, I am getting back a field called "link" but it links to the picture instead of just the post.

  • Anders Bjerner 476 posts 2885 karma points MVP 6x admin c-trib
    Jun 02, 2016 @ 12:17
    Anders Bjerner
    1

    Hi Gordon,

    I don't recall seeing the two properties that you mention, so they are not mapped in the FacebookPost. I have added a note to add support for this ;)

    Meanwhile, you can still access the properties, but instead via the underlying JSON object. So if post is a variable with an instance of FacebookPost, you can read the property like this:

    post.JsonObject.GetString("permalink_url")
    
  • Gordon Saxby 1416 posts 1797 karma points
    Jun 02, 2016 @ 12:32
    Gordon Saxby
    1

    Ah, OK. Currently, I'm just doing a JsonConvert on "response.Body.Data" and returning that. So, I will need to process each item in "Data" instead.

Please Sign in or register to post replies

Write your reply to:

Draft