Not getting all comments using Facebook Graph API - facebook

I'm trying to get comments using Facebook Graph API using this code
https://graph.facebook.com/post_id/comments?access_token=XXX
where XXX is replaced by my access token. The problem I'm facing is I'm not getting all the comments. It's end output is like this:
enter image description here

One of the solution through which I'm able to get all comments if using limit like this:
https://graph.facebook.com/post_id/comments?access_token=XXX&limit=1000
This solved my problem since I had only 50+ comments. Still looking for more better solution.

Related

Facebook Graph API - Getting Comments

I'm trying to use Facebook graph API to get all the comments (mine and others) on my Facebook posts.
Currently I'm testing the api using Graph API Explorer & so far I'm getting only my comments.
I want to know did they change their policy or is there a way to get all the comments?
P.S: I didn't write any code so far.
But I followed the link:
https://developers.facebook.com/docs/graph-api/get-started
to use the graph API explorer and this is what I'm getting:
the image
In the "Tools" you will find the tool. And as you can see you will get the list of the comments. I'm just showing one of my comments (testingggg) as an example.
Unfortunately, the API doesn't give me the others' comments.
Am I missing something?
Thank you.
according to the document this is the way to get all the comment docs

page_fans_city returning no results from Graph API

I'm trying to get access to the page_fans_city edge from the Facebook Graph API.
I am using the following query:
https://graph.facebook.com/v2.5/StrandTowerHotel/insights/page_fans_city/lifetime
For some reason though it keeps returning no data when I am using the Graph API explorer.
note: I am an admin/owner of the page
Whats interesting though is that if I just query https://graph.facebook.com/v2.5/StrandTowerHotel/insights/ then I get all the other metrics results returned but "page_fans_city" is not in the results.
I have read through and tried the following solutions already posted on stack overflow but they don't seem to solve the issue.
Getting number of people who like a page on facebook by city
Facebook PHP Graph API not returning complete data
facebook: permanent Page Access Token?
Many thanks in advance for any help you can give me
After much searching and bug fixing it ended up being the facebook api was just having issues. now working perfectly :(

facebook batch request to get all the photos

I want to get all the photos of the user who gave permission to the app. Currently, I tried single and batch request of Graph API but it always paginates the results. Is there a seamless way to get all the objects without following pages?
ps: I'm using PHP-SDK so answering in php is the money :)
I found out that giving limit=0 is solving the problem. It still generates paging object but they return empty data set. So, limit=0 returns the whole dataset in one shot.

Facebook publish to feed

Recently I'm working with the Graph API of facebook and I got the authentication ready, though publishing to my own feed gives me a hard time..
I'm trying to find the correct URL to do this, because I am using MonoTouch and the only way to publish is using a webrequest. I tried to check what the API said but it wasn't quite clear, I'm trying the following url:
https://graph.facebook.com/myusername/feed?access_token=mytoken?message=testmessage
What am I doing wrong ?
Thanks in advance!
You are missing the parameter method with the value post.
Try this:
https://graph.facebook.com/myusername/feed?method=post&access_token=mytoken&message=testmessage

Posting with facebook api a message containing friend's names as links

I want to do a simple thing yet it seems none of the FB api options (Graph/others) seem to be able to solve it.
Say "Johny Brown" is my friend and I want to include his name in a wall post. What I can do is type #Johny Brown then facebook shows a nice dropdown from which I can select his name.
However the same behavior cannot be mimicked using Facebook API.
Any tips will be greatly appreciated. I tried "#" before name, using full url, using "Name" etc. None of them work.
yup you're correct. in the new graph api facebook simply removed this feature (possibly due to too much spamming).