Facebook returned empty data for me/feed - facebook-graph-api

I have a problem with Facebook graph API. First time when I try to get home feed with URL https://graph.facebook.com/XXXXXXX/home/??access_token=accesstoken&until=1354639369&limit=40 all is good, I have a data. But when I diving deeper into the feed with changing "until" value (loading older messages) at some moment Facebook returned for me empty result:
{
"data": [
]
}
I can not find the reason of this problem. May be it is Facebook restrict?

Facebook (as stated in the other answer) indeed returns for maximum a months worth of data. If your until timestamp is >30 days in the past it will return an empty result. A solution would be to use batch requesting and get 30 days at a time.
You can read more about batch requesting in the Facebook Graph API documentation here: https://developers.facebook.com/docs/graph-api/making-multiple-requests

facebook provide data for last 15 post or a month which one is maximum.

Related

Why can't I get all comments by a specific user using the YouTube Data API?

The question
My application needs to check if a specific comment, on a known video was successful sent by a user of the app.
To do this, I need to use the YouTube Data API (or perhaps so other method).
There seems to be two ways I can do this:
I get all comments sent by the channel, and filter for the specific video.
I get all comments from the specific video, and filter for the specific channel.
CommentThreads (list by channelId)
CommentThreads (list by videoId)
However, "list by video" isn't ideal since if the video has a large amount of comments, it'd be hard to find the comments by the user / take longer.
To be clear, it's not a random user, the user will give the YouTube scopes required to find such information.
The Problem
When I use the samples with the API Explorer from the YouTube Data API reference page, it simply doesn't work.
Here's the error I get:
{
"error": {
"code": 400,
"message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. Check the structure of the \u003ccode\u003ecommentThread\u003c/code\u003e resource in the request body to ensure that it is valid.",
"errors": [
{
"message": "The API server failed to successfully process the request. While this can be a transient error, it usually indicates that the request's input is invalid. Check the structure of the \u003ccode\u003ecommentThread\u003c/code\u003e resource in the request body to ensure that it is valid.",
"domain": "youtube.commentThread",
"reason": "processingFailure",
"location": "body",
"locationType": "other"
}
]
}
}
To be clear: I'm using the pre-made samples provided by Google themselves.
1st screenshot of "code"
2nd screenshot of "code"
So, how would I fix this and make CommentThreads (list by channelId) work?
Similar Questions
Get list of all comments made by a given user with Youtube Data API? - This question isn't exactly answered,
and since it seems they don't want to request the user's consent the comments say that it's against YouTube policy and don't really mention the YouTube Data API. But most importantly, does not mention CommentThreads (channelId). For this reason, mainly the difference in consent, I don't think my question is a duplicate.
How to get comments posted by a specific account (channel) through YouTube Data API? - This question is much closer to mine, and even mentions CommentThreads, but they ignored the obvious "list by channelId" (unless it was implemented into the API after the question was asked), regardless there was no answer to my question.
Thanks to the suggest made by #Marco Aurelio Fernandez Reyes, I looked at the IssueTracker and found that an issue that explained that this is an intended feature.
"CommentThreads (find by channelId)" is no longer supported and hasn't been for several months now.
Source material

Beacon scheduling in google beacon dashboard

I'm working with 1 beacon advertising in Eddystone-URL and Eddystone-UID at the same time.
No problem with Eddystone-URL.
With UID, I set up several lines in the google beacon dashboard. With targeting options on all of them.
1 for Monday that opens instagram app, 1 for Tuesday-Sunday 3PM-5PM with a URL. Instagram app for Tuesday-Sunday 12AM-11AM, another URL for some other times of the day and week, etc. Not going into the whole details, it's quite complex.
As an example here is a copy of the raw JSON for one of the lines:
{
"title": "Get a FREE Pop at XXXXXX!",
"url": "https://mybitlylink",
"targeting": [
{
"startTimeOfDay": "15:00",
"endTimeOfDay": "16:59",
"anyOfDaysOfWeek": [
2,
3,
4,
5,
6,
7
]
}
]
}
All my 4 URLs are bitly links so I can track the number of clicks I get on each. I haven't found a way to track the number of Instagram app opens.
I set up all my lines to not be redundant, meaning each line is for 1 unique part of the day and week. I have 15 lines total covering almost every minute of the whole week.
My problem is this: a few minutes after I saved my config, some clicks were registered on all my bitly links, whereas only one was supposed to show. Now - 2-3 hours later, all links still collect clicks, making me think all messages are triggered despite the targeting. What is curious is that each of them is collecting the same amount of clicks. I don't know if the instagram app was also shown because the beacon is installed at a customer site remote from me.
Do you think it could be a bitly click count error or that really 4 messages (+ potentially the Instagram open in app message) are broadcasted by Eddystone-UID?
If you are getting clicks from "Mountainview California" It's Google crawler.
The way these notifications work is before displaying them on your phone, the device connects to a Google resolver to find URL, website name and description and an icon. This resolver crawls your website and caches the details (including the icon image).
This is registered as a hit/click on bitly, and that is what you see :)
And unfortunately it is not possible to get stats for app intents.

Facebook ad statistics - can't get facebook keyword stats

I have created a campaign, specified the interests in the ad and successfully executed the campaign which lasted 2 days. I have got around 9 website clicks and the reach was approximately 35000. I am trying to retrieve keyword stats through api but I am getting empty json object. I followed this link.
Here is the cURL command:
url -G -d "access_token=abcd" "https://graph.facebook.com/v2.7/ad_id/keywordstats"
And here is the result:
{"data":[]}
Why am I getting empty json object. Where am I going wrong? I need some assistance.
The keywordstats api only show the breakdown statistics for the ads that resulted in enough stats. In case some interests haven't resulted in any stats, they won't be included in the breakdown statistics .
As a rule of thumb, there is an average delay of 24 hours (before the stats are available). However, we've noticed that it can be less or more as well. Only Facebook will know the exact logic behind that.

Facebook Graph API 2.1 feed attachments

According to Facebook Platform Changelog
/v2.1/{post-id} will now return all photos attached to the post: In previous versions of the API only the first photo was returned with a post. This removes the need to use FQL to get all a post's photos.
Though this statement is applicable only for separate API calls per post that looks follows:
https://graph.facebook.com/v2.1/{post_id}?fields=attachments
Since I need to retrieve all possible data that user posts to timeline, I use corresponding feed edge to do so.
https://graph.facebook.com/v2.1/me?fields=feed
So when I make a post with more than one picture attached to it, retrieved API response doesn't reflects that (and as I understand it's is per design). However I found that Graph API Explorer allows to choose attachments edge while constructing feed query that in this case appears like this
https://graph.facebook.com/v2.1/me?fields=feed{attachments}
but execution of such request triggers "Unsupported get request" exception.
Summing it up, the whole issue with the approach to make separate API calls for pictures is that it will dramatically increase number of calls which in turn not only decreases overall performance of the processing algorithm, but also leads to failing API call limits restrictions that in my case is unacceptable.
So I'm curious, is there any possibility to retrieve all post attachments (i.e. pictures) while working with feed edge or any alternative approach?
Thanks.
This should work.
me/home?fields=attachments,<other stuff>
The issue eventually resolved itself.
I found that Graph API Explorer allows to choose attachments edge while constructing feed
query that in this case appears like this
https://graph.facebook.com/v2.1/me?fields=feed{attachments}
but execution of such request triggers "Unsupported get request" exception.
It seems like non-working attachment edge for feed was unimplemented feature or a bug, because, surprisingly, now all attachments are retrieved successfully as subattachments collection.
Thanks, everybody.

Missing items in Notifications response

I'm trying to retrieve the list of all notifications using FQL. I have manage_notifications permission. If I do a query, like:
SELECT notification_id, sender_id, created_time, updated_time, is_unread, title_html, title_text, href, icon_url from notification where recipient_id = me()
it works. But the returned list is missing some items, seemingly at random. Some notifications that are present on the Facebook website just don't appear in the output. I can't spot any pattern in which ones are being skipped. But if I use the regular Graph API to call /me/notifications?include_read=1 exactly the same entries are missing.
I'm getting the same result whether I call from my code or using the Graph Explorer. What's more, if the skipped notification is unread, I can query the unread count and get "1", even though the notification in question does not appear in the list.
Does anyone have any idea what might be wrong here?
I think this is a bug, possibly related to newer notifications from Timeline etc. You should file a report in the Facebook Platform Bug Tracker and link back here to let everyone know where the issue is being tracked.