I am trying to receive an event from the Facebook Graph Api By Id with following request:
https://graph.facebook.com/{eventid}?access_token={app_accesstoken}
I am using an app-accesstoken. The Event is a public event and according to the Graph Api docs I should be able to receive public events with any access token: https://developers.facebook.com/docs/graph-api/reference/event/
Nevertheless I receive following error-response:
Unsupported get request. Object with ID '{eventid}' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api
I have tried with multiple events with the same results
In April 2018, following the Cambridge Analytics scandal, Facebook decided to greatly reduce the information available through Facebook API.
In particular regarding Events API, here the official statement.
Events API: Until today, people could grant an app permission to get information about events they host or attend, including private
events. This made it easy to add Facebook Events to calendar,
ticketing or other apps. But Facebook Events have information about
other people’s attendance as well as posts on the event wall, so it’s
important that we ensure apps use their access appropriately. Starting
today, apps using the API will no longer be able to access the guest
list or posts on the event wall. And in the future, only apps we
approve that agree to strict requirements will be allowed to use the
Events API.
After that change you will not be able to get events of Facebook Pages, using the Facebook API like in the old days.
You could be able to get the data of a page you own if you have user_event permission (https://developers.facebook.com/docs/graph-api/reference/user/events/) but your app need to pass the App Review process.
Source: https://newsroom.fb.com/news/2018/04/restricting-data-access/
Related
This looks a kind of duplicate question but actually NOT.
So the problem is https://www.facebook.com/julytalk/ has events, for sure.
But when I tried on Facebook Group API toolkit, it returns empty array.
https://developers.facebook.com/tools/explorer/145634995501895?method=GET&path=204859706228731%2Fevents&version=v2.12
Why is this happening?
I could not find any Facebook API endpoint modification notice, at all.
It was working okay before.
Please help me.
https://developers.facebook.com/blog/post/2018/04/04/facebook-api-platform-product-changes
Access to the Events API is not possible at the moment:
...apps currently accessing Events and Groups APIs will lose access today
Update: After Facebook did a lot of changes, it seems to be possible to get events again. You can get events from Pages you manage easily in dev mode. If you want to get public events, you may want to read the answer in this thread: Facebook pages API: "Page Public Content Access" review screencast
The above answer was misleading for me, not because its wrong but because so many things have changed on Facebook's side and I needed further clarification.
This is the current state based on my research (25.08.2020.).
There are several types of events available based on where the event destination is:
User events
Documentation terminology: "Events on User"
API endpoint:
me/events
Page Events
Documentation terminology: "Events on Groups"
API endpoints:
me/groups
group_id/events
Group Events
Documentation terminology: "Events on Pages"
API endpoint:
me/accounts
page_id/events
App Events
Documentation terminology: "Events on an App"
API endpoint:
{application-id}/events
About app events.
The list is taken mostly from Facebooks API event endpoint.
The documentation is wrong on event limitations:
Access to Events on Users and Pages is only available to Facebook
Marketing Partners.
The current state is that "Access to Events on Users and Pages is available to":
A) App Admins (verified with testing)
B) App Developers (verified with testing)
C) App Testers (not verified)
D) Facebook Marketing Partners (not verified)
What does this mean?
This means if your query the "me/accounts" endpoint which will give you a list of page ids.
When you select a page id and then query "your_selected_page_id/events" you will receive:
An empty list if you are not A-D)
A list of events which is not the same as your users.
A lot of confusion and frustration because there is no error message thrown.
I have tested this with different API versions 4.0 - 8.0 and the results were the same.
I have also tested this with a different but similar set of permissions, resulting in the same empty array response.
SOLUTION(S):
TODO: UPDATE: Clarify who needs to become FMP.
To query for page events "someone" needs to be a Facebook Marketing Partner.
https://developers.facebook.com/support/bugs/352704275741601/
Invite your users to become testers.
Helpful links:
Read more on Facebook Marketing Partners.
Officially on Facebook Marketing Partners.
Facebook Graph Explorer.
Facebook Batch Requests.
Additional notes:
Page event fetching has the same requirements as user events fetching.
Group event fetching works for all users (ignores A-D).
Creating batch requests with no FMP will result in response sections that only have empty arrays.
I set up a Facebook Webhook to notify my app of changes to my business page. Then I did the same with the Messenger platform. Then when I started posting as a user of my page, and sending messages, I found out that the user IDs are different across different pages and apps.
So, facebook provides two endpoints: ids_for_apps, and ids_for_pages. There are quite a few "but"s to use these endpoints, but at least in development mode, and for IDs sent by the Messenger webhook, it works. I get the notification and I'm able too look up the IDs and match to an app id (because maybe the user commented on a photo before contacting me via Messenger)
Now if I try to do the same with a sender_id that I got from the Facebook Webhooks, "feed" subscription, I get the "singular links API is deprecated for versions v2.4 and higher"
The url I try to access, even with Graph API Explorer tool is GET /2.9/{sender_id}/ids_for_apps
What's going on here?
I am using /me/feed and /me/home to get my feed and my homepage feed respectively.
But the /me/home only shows updates from my friends. I am following many people but not friends with them. My facebook homepage shows all the updates including my friends and the people I am following.
How to get the news feed exactly like the one appears in the fb website?
As #Fabio said, the Graph API does not support it as of now (and I don't think it'll do that in the future). You can only obtain yours and your friends' feeds using the Graph API.
In order to obtain the feeds from a specific person who's not in your friend list, you need a valid User Access Token from that user with a read_stream permission.
There is however a way to read the public feeds of user status updates and page status updates as they are posted to Facebook. This can be done by using the Public Feed API. This will include all feeds that have their privacy set to ‘public’ are included in the stream. Also, you cannot apply to use the API at this time as its access is limited. Its page says:
Access to the Public Feed API is restricted to a limited set of media
publishers and usage requires prior approval by Facebook. You cannot
apply to use the API at this time.
But I think it's just a fancy way of saying that this API is not free and you'll be charged few dollars (which you can find out by getting in touch with someone at Facebook) for using this service.
I wish to create an application which me and my friends would subscribe to and which in turn can monitor a count of items in the news feed using the required permissions (kind of a social network statistics).
I read the developer documentation, but I couldn't find out if it's possible. Subscribing to my application (and allowing the permissions) is a one-time process for my friends. From then on, can my application read the fields mentioned in Graph API for the subscribed users at any time (without the user's involvement)?
You might be interested in using the Real-Time Updates API from Facebook. Using this, you will no longer have to continuously "poll" the Graph API. Rather, Facebook will send the updates to your server.
Here are some sample implementations of the API, https://github.com/facebook/real-time/tree/master/samples.
No.
Facebook used to have the "offline_access" permission which would let applications have an access token that does not expire.
Not a while ago though Facebook deprecated this permission as stated in Removal of offline_access permission.
The longest (that I'm aware of) that a token is valid for is 60 days. If you want to extend that time frame you'll have to get the user to interact with your application.
I know how to use graph api - https://graph.facebook.com/{id}/feed|posts to get user's and page's feed.
I also know that facebook provides an subscription API. But I can not use it to check feeds of users i am interested but not our application users (ex: A super idol I am interested but who is not our application users. I want to check not only posts by him but also messages posted by his fans)
Is there a notification service to notify me (callback) the updating of user's feed, such that I don't need to pull graph api periodically to check the updating?.
Thanks.
"I want to check not only posts by him but also messages posted by his fans" and "but not our application users"
This sounds like a stalker app. http://developers.facebook.com/policy/ Facebook says you are not allowed to do that.