0

Got response from facebook API and have Next previous in paging for next call how i can use it to get more response. I want to retrieve all Posts and likes.

I got Docs Of Cursor Based paging. https://developers.facebook.com/docs/graph-api/using-graph-api

  {
"id" : "16163671745458658991",
"name" : "XXXXX",
"feed" : {
    "data" : [{
            "id" : "16163671745458658991_16168041052819454565",
            "message" : "Today is the busy day",
            "created_time" : "2016-11-24T10:15:10+0000",
            "likes" : {
                "data" : [{
                        "name" : "XXXXX",
                        "id" : "16163671745458658991",
                        "pic" : "https://scontent.xx.fbcdn.net/v/t1.0-1/c29.0.100.100/p100x100/399548_10149999285987789_1102888142_n.png?oh=7432daa638606bdffdfdfddb0a8cd92d8607e692&oe=58AEC31D",
                        "username" : "XXXXXpage",
                        "profile_type" : "page"
                    }
                ],
                "paging" : {
                    "cursors" : {
                        "before" : "MTYxNjM2rtrttNzE3ODY1ODk5MQZDZD",
                        "after" : "MTYxNjM2rtrttNzE3ODY1ODk5MQZDZD"
                    }
                }
            },
            "comments" : {
                "data" : [{
                        "likes" : {
                            "data" : [{
                                    "id" : "16163671745458658991",
                                    "name" : "XXXXX"
                                }
                            ],
                            "paging" : {
                                "cursors" : {
                                    "before" : "MTYxNjM2rtrttNzE3ODY1ODk5MQZDZD",
                                    "after" : "MTYxNjM2rtrttNzE3ODY1ODk5MQZDZD"
                                }
                            }
                        },
                        "id" : "16163671745458658991_1627615154200860",
                        "like_count" : 1
                    }
                ],
                "paging" : {
                    "cursors" : {
                        "before" : "WTI5dGJXVnVkRjlqZAFhKemeweweIzSTZANVFl5TnpZAeE5URTFOREl3TURnMk1Eb3hORGd5TWpReE9UazUZD",
                        "after" : "WTI5dGJXVnVkRjlqZAFhKemeweweIzSTZANVFl5TnpZAeE5URTFOREl3TURnMk1Eb3hORGd5TWpReE9UazUZD"
                    }
                }
            }
        }, {
            "id" : "16163671745458658991_16168041052819454565",
            "message" : "shareing my first post",
            "created_time" : "2016-11-23T12:50:27+0000",
            "likes" : {
                "data" : [{
                        "name" : "XXXXX",
                        "id" : "16163671745458658991",
                        "pic" : "https://scontent.xx.fbcdn.net/v/t1.0-1/c29.0.100.100/p100x100/399548_10149999285987789_1102888142_n.png?oh=7432daa638606bdb0a8cd934342d8607e692&oe=58AEC31D",
                        "username" : "XXXXX",
                        "profile_type" : "page"
                    }
                ],
                "paging" : {
                    "cursors" : {
                        "before" : "MTYxNjM2NzE3ODY1OfgfgDk5MQZDZD",
                        "after" : "MTYxNjM2NzE3ODY1OfgfgDk5MQZDZD"
                    }
                }
            }
        }
    ],
    "paging" : {
        "previous" : "https://graph.facebook.com/v2.8/1616367178658991/feed?fields=id,message,created_time,comments%7Blikes,id,like_count%7D,likes%7Bname,id,pic,username,profile_type%7D&since=1479982510&access_token=EAACEdEose0cBAF3DC2WN5st6A7pFYMcMG9SErtrtrtsXuFw6ZCesYE9qdJyxdavT8UK5rDklXvebTrM6Ldzxsq5qw0V1oAh48SUrzPMARX2w7N2EMAXneAsLXVGZAkkMUZCJrttrtBnbzhM31PFvcZBfnTPPR7nQZBZBoq5zeEIfPj69kwiMgwG3OBRfBq6ra&limit=25&__paging_token=enc_AdDjWaUHswHT4a34LWMgiNzzZAOMsRjjjJwFBejKSZBDdHiwCHH8hImcCeXInucceSfUKHgFFbdeseZBhOeiWjbmplCuVouq48cPERomyL91t09RgZDZD&__previous=1",
        "next" : "https://graph.facebook.com/v2.8/1616367178658991/feed?fields=id,message,created_time,comments%7Blikes,id,like_count%7D,likes%7Bname,id,pic,username,profile_type%7D&access_token=EAACEdEose0cBAF3DC2WN5st6A7pFYMcMG9SEsXuFw6ZCesYE9qdJyxdrtrttrttrtavT8UK5rDklXvebTrM6Ldzxsq5qw0V1oAh48SUrzPMARX2w7N2EMAXneAsLXVGZAkkMUZCJBnbzhM31PFvcZBfnTrttrtPPR7nQZBZBoq5zeEIfPj69kwiMgwG3OBRfBq6ra&limit=25&until=1479905427&__paging_token=enc_AdBjxZBNJEadNwBHmz62uCBOwvgJnAR69jYjK0fNfPIhyyQAMSHZB6iR6ECZCocuqR4st5oCviPW0oQMrvLgGzR9AgQUSSNxeuuY5bYS33PLqAaagZDZD"
    }
},
"new_like_count" : 0
}

1 Answer 1

1

You can Use It by calling again API on the Next property As Below. Bit Inefficient.

me/feed?fields=id%2Cpermalink_url%2Cmessage%2Ctype%2Ccreated_time%2Cupdated_time%2Cfrom%2Cpicture%2Ccomments%7Bid%2Cmessage%2Ccomment_count%2Ccreated_time%2Cattachment%2Cfrom%2Clike_count%7D%2Clikes%7Bid%2Cname%2Cpic%2Cprofile_type%2Clink%2Cusername%7D&limit=25&until=1482470132&__paging_token=enc_AdD0urtertrt5zUYkQjANrFVG7nVMfkftKfRpIDdVVJd4RGqJy6j8I8O9kWMVOIS09uKGl5SPsg66oGZAU8ZBEc0qmnVwvLqG8qwGKbe8OfZAEJ9PgRFjZBAZDZD

Rather Than New API call. You can Use Batch API call Of facebook Batch Request at Facebook API

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .