Search code examples
c#facebookfacebook-graph-apifeedfacebook-graph-api-v2.1

FACEBOOK - c# UserID/feed GET post comments Picture URL


I'm using c# sdk to get facebook wall content: Username/feed
In response I recive all messages and activities on the user’s wall. In message or story data we can find a Picture attribute which is a URL address to picture. In each message i have a list of coresponding comments, but I can't find the Picture URL in comments data.

How can I get the Picture URL which was added in a comment ?

The best solution for me would be to get all necessary data (including comment pictures) by asking only one GET(Username/feed) question to FACEBOOK API. Please HELP ME !


Solution

  • You can use attachment edge on comments node, so final query will appear like this:

    [user_id]/feed?fields=[comma separated fields],comments{attachment,[comma separated fields]}
    

    For each comment with attached pictures there will be attachment.media.image object with src field that is exactly what you're looking for.