Get page's messages from a certain date range - Facebook Opengraph API - facebook

I'm trying to get the messages in a convertation, sent to a Facebook page, from a certain date, via the OpenGraph API.
for that, Im using the parameters "since" and "until".
{conversation_id}/messages?fields=message,from,created_time,shares,tags,attachments&since=4/12/2017 04:00:09 PM&until=4/12/2017 04:18:36 PM
Example from Facebook Graph Explorer
this should return only the messages between these dates in the conversation,
and used to work both in my code and in the Facebook Graph Explorer.
but recently i noticed that i get all the messages since the beginning of the conversation.
my code uses graph version 2.6, but i tested it on Graph Explorer in other versions as well, all the results are the same.
was there any change in the API that prevents this ability?

For anyone who come across this question who might want to know:
this issue was raised to Facebook as a bug, and their team accept it as a valid bug:
https://developers.facebook.com/bugs/420363721670492/
hopefully it will be solved soon

Related

Why Facebook Graph API doesn't list all public events for a page?

There're lots of events for this venue:
https://www.facebook.com/pg/ClubRoxyPrague/events/
However when requesting with Graph API we only get a few. Here's link to Graph API explorer:
https://developers.facebook.com/tools/explorer?method=GET&path=ClubRoxyPrague%2Fevents&version=v2.12
Until recently this worked well for us. Maybe it's data access restrictions Facebook announced few days ago: https://newsroom.fb.com/news/2018/04/restricting-data-access/
Why the API returns only some events? Is there any way to fetch all public events hosted by a certain page?
Due to the breaking data access changes you mentioned, it already wasn't possible to access events directly (also see: Unsupported get request in get Facebook event).
It seems like your specific issue is a logical consequence of that decision (although the /{page-id}/events was still available up to today, I personally already found it pretty strange that events were still accessible indirectly).

FB Comments. Missed old comments. Wrong comment counter number

I have a blog on Wordpress with installed "Simple Facebook comments" plugin. It working couple of years but some time ago i found out that for some posts Facebook API showing me "N" comments but display none.
I tried to add comment to this kind of post and comments counter showing "N+1" but i was able to see only one most recent comment. I was trying to receive all of existing comment via Open Graph API (example: http://graph.facebook.com/comments?id=http://blog.spafinder.ca/breaking-free-toxic-relationship/) but it returning only one comment after that i was requested comments number for the same post (REST API: http://api.facebook.com/restserver.php?method=links.getStats&format=json&urls=http://blog.spafinder.ca/breaking-free-toxic-relationship/ , GRAPH API: http://graph.facebook.com/?ids=http://blog.spafinder.ca/breaking-free-toxic-relationship/) and it told me that i have 2 comments.
I tried to clear OpenGraph cache, request comment number with another resources and it wasn't help.
Do you have any idea why it happening? I would be a very grateful if somebody will told me the possible way to solve that problem.
Thanks.
Based on the url you posted, that plugin seems to be using the Facebook Rest Server API which has been deprecated as noted below...
We announced the Graph API at f8 2010. Since that event, we have been working hard to ensure that the most important functionality that developers were using with the REST API is available via the Graph API. For the past several months we have been slowly launching new features in the Graph API to bring it up to parity with the REST API
This article is 3 years old so I wouldn't be surprised to find out that there are bugs in the existing deprecated API since they have dropped support for it. That said, be sure to read the documentation of the plugin you're using, they might have updated the plugin.
Also, if you wish to do this job manually, rather than depending on a third-party, be sure to read the documentation regarding this endpoint because permissions and default filters can affect the output...
https://developers.facebook.com/docs/graph-api/reference/v2.0/object/comments/

Receiving Facebook app error alerts - invalid parameters for "plugin:post"

Starting on July 30th, and every 3 days since, we've been getting this alert for our Facebook app, which is used on our site for Facebook Login and social posting:
In the last three hours 100% of the calls to the method plugin:post
resulted in errors.
Error Code 100
Error Description Invalid parameter
Error Count 5,971
Thing is, I have no idea what "plugin:post" is. Google and stackoverflow don't seem to know either, for that matter :) And 5,971 instances of it in 3 hours is more traffic than I would expect on our site.
Our codebase does not contain any references to "plugin:post", so I'm assuming "plugin:post" is an alias for some other functionality within the Graph API. I just don't know what. Anyone have an idea?
I did see there there is social plugin which uses an "fb:post" FBML style tag (https://developers.facebook.com/docs/plugins/embedded-posts/) that sounds like it could be related, but we don't use that plugin.
Any insight would be appreciated, thanks!
[Edit 9/13 for Azhar's question:]
I checked the July 2013 Breaking Changes, and nothing seemed like it would impact us.
[Edit 9/13 for Tobi's question:]
We're using:
- Open Graph API for social posting via the Feed dialog to either the user's news feed or a friend's news feed
- Facebook Login API to allow users to log into our site,
- Facebook Javascript api for geting user info (e.g. FB.api('/me'...), F.api('/me/friends'...), etc. ), and other data via FQL FB.api("/fql"...). I've verified that none of the FQL statements are impacted by the July 2013 changes.
I would post some code, but we have a fair amount of FB-related Javascript on the site, and I'm not sure which is the one causing the problem.
My Facebook app is receiving the exact same error message alerts from Facebook. I have exhausted all possible solutions and investigated every aspect of my logic, and I have concluded this is a bug on Facebook's side until someone can prove otherwise.
I have ignored these alerts so far and there has been no impact to my website or my users. Every integration point with Facebook works flawlessly using my personal Facebook account, test Facebook users and other non-admin users across all major browsers. Nothing appears wrong or broken.
When I investigate my Facebook app's insights and look at the developer view for activity and errors, I see plugin:post failures for the current month but when I go back one month there are absolutely zero API errors and it says "No API Errors". This is obviously wrong because I was getting alerts last month and this helps support my theory that the issue is on Facebook's side.
Turns out this was all due to a naming conflict in the HTML of our page. We had a page element with a class name of "fb-post". Facebook apparently treats this a "fb:post". Since our "fb-post" was not an actual FBML tag, it does not have the other parameters Facebook looks for in a post. So Facebook started giving alerts.
I suspect this is due to a change on Facebook's part, as we've had these "fb-post" elements in place for years now, without issue.
Incidentally, this is also the case for any elements with a class name of "fb-name", as Facebook treats that as "fb:name".

How to get Facebook page notification via Graph API

Got a issue with Facebook Graph API. I want to read page notifications via Graph API. But Facebook documentation only states about user's notification.
Following only returns a user's notification (the user who provided the access token for this.)
http://graph.facebook.com/me/notifications
I did following techniques. But no luck.
01. But i tried with different urls with access token provided by the page. (with my stupid guess work by replacing page-id for me)
http://graph.facebook.com/page-id/notifications
02. Checked with Insights API. But Insights doesn't provide a straight forward solutions. This is more like stats. But all i just need a list of latest user/fan/post actions in the page.
https://graph.facebook.com/page-id/insights/field
Some background about my App (hope no issues with this as other API's working),
Platform .Net 4.0
Library I am using is C# Facebook SDK
Facebook documentation doesn't help much. I have spent a few day on this to find a solution for this. Just wondering if any of you guys came across this issue and solved. I hope i didn't put a duplicate question here, as i did search for few days on Stackoverflow too.
Thanks.
There isn't a page notification API. I don't believe there is any way to directly query this data.
You can get notifications of changes to a Facebook page using the Real-Time API. https://developers.facebook.com/docs/reference/api/realtime/
Facebook now allows you to read Page unread notifications by querying the edge: {page-id}/notifications.
See https://developers.facebook.com/docs/graph-api/reference/v2.7/page/notifications
From the FB Page docs for the notifications edge...
Notifications for this Page. Deprecated April 30, 2019.
Looks like the only way to track Page notifications at the moment is via the realtime Webhooks for a page, which isn't the same as reading the notifications from FB but it appears to be where we're at...until FB changes their mind again. ;)
https://developers.facebook.com/docs/pages/realtime/

Facebook insights serving JSON with no 'page_fans_gender_age' data

I am using facebook insights for showing fan page analysis in my application. Since the last upgrade by facebook on 1st week of Oct 2011, i am facing issues with 'page_fans_gender_age' data values served by the Insights API. I am using graph API for this. We fetch the insights JSON on daily basis, but most of the times it do not provide values of 'page_fans_gender_age' parameter. The behavior is random, sometimes it served the required data and sometime it do not.
Anybody facing the same problem?
Yes, I'm facing a very similar problem.
Right now, I'm just simply trying to get some JSON returned from facebook, using JavaScript / AJAX and the GET method.
Are you using the Graph API? If so, how do you attach your extended permissions token to the call to facebook's read_insights?