Stop receiving real time updates for a Facebook page - facebook

I have followed the instructions on this page:
https://developers.facebook.com/docs/reference/api/page/#realtime
But I can't get the Deleting an App section to work.
This is the case with both the PHP SDK and with Facebook's Graph API Explorer.
First I add an app to get real time updates by POSTing to
/<page_id>/tabs
with the app_id parameter set to my App ID. I also pass an Access Token for the page.
This returns 'true' in the Graph Explorer, and '1' with the PHP SDK, which I understand means success in both cases. I know this is true as I have received data to my real time endpoint.
However, I also need to be able to delete these subscriptions, per page.
The documentation suggests this is done by performing a DELETE to
/<page_id>/tabs/app_<app_id>
Again passing the same Access Token as before.
In both the Graph Explorer and the PHP SDK, this returns:
(#100) Tab is not installed or not removable: <The same app_id I passed>
I've seen a couple of other people reporting the same issue, but apparently no solutions. If anyone has managed to figure this out, I would hugely appreciate your thoughts.

There are two possible alternatives:
Go to https://www.facebook.com/{page_id}/settings?tab=apps and manually remove the application from the page. If the app is not there, it has already been removed.
Or:
You can use the Real-time Update documentation and use a DELETE API call to unsubscribe the page from real-time updates. However, if your application is used with more than once page, it will also unsubscribe the other pages.

Related

Graph API empty events list of page [duplicate]

Using the latest version (2.12) of the Facebook API I'm trying to get (public) events for a page, using the Graph API Explorer.
However, I can't seem to get it working:
When I hover over the greyed out "id" or "name" on the left, it says "Field is empty or disallowed by the access token".
Now the page I'm using as an exmple here is Techcrunch, and they have plenty of events coming up. So "empty" doesn't seem to be the issue.
On the "disallowed" side I've checked the API reference on https://developers.facebook.com/docs/graph-api/reference/page/events/.
However, I can't seem to find any issue here either. It says "Reading Page events requires a valid Page access token or User access token with basic permissions.".
What am I missing here? Any hints are greatly appreciated!
Visit https://developers.facebook.com/docs/graph-api/changelog/breaking-changes#pages-4-4
Currently Facebook is not returning events for pages using Pages API unless you use an user accesss token and that user has been invited to any of the events of the page or is attending/interested in any of the events of the page.
As unknow_b said :
currently to access events you can also use a user endpoint such as ‘/me/events’ or ‘/me/events/not-replied’ using an access token valid for that user. you can get the events that the user was invited to or is going/interested
But the access token user, is only working for 1 hour !
Does someone have another better idea?
I'm trying to do the same thing: getting public events from a page. Related to the above suggestions:
I tried the short-lived user access token two weeks ago, which worked for a short time. Now it does not anymore. Does it for any of you?
Both the long-lived user token, a page token generated with either a short- or long-lived user token do also not return any events.
At https://developers.facebook.com/docs/apps/review/#platforms, Facebook states:
Beginning April 4, 2018, all apps, including those formerly approved, must undergo App Review in order to gain access to the Events API, Groups API, and Pages API. Apps accessing the Events API and Groups API will lose access and require review once App Review resumes.
So being reviewed might help. I will report further.
Update 1: an answer on this related bug reports states it more clearly:
App review required to use the following edges: GET /page/events and GET /me/events
Meanwhile they cancelled all pending review requests for the Graph API 3.0 changes, so I have to resubmit.
Update 2: My project got rejected & I'm not bothering to continue it now.
Yep. Facebook has taken down the Graph API for page access tokens. I had this code in production for 2 years and it worked great. The only way to retrieve data (or was a week or so ago), was a temporary user token that lasts about 2 hours. It's totally broken my band's schedule page. I've been through every avenue and even spoke with a facebook ad team employee on the phone that was aware of it. She seemed to empathize but had no solution for me. I would count on it being down for a while.
I just created a python script, you can see here. It queries the given facebook page and it's events, and puts the data into a mysql table.
It looks like it won't be working anymore due to the scandal with Facebook Analytics (see Why does Facebook Graph API say my account is non-active?).
In the popular plugin facebook-events-by-location-core, you can take a look into the issue#29 discussion. It's well explained there, and I don't think so there's a way we'll get the data in a public API available anymore.
There were also some rumours it was a competition for their (dead?) Facebook Local app, but not sure about this.
I have finally figured out a work around for this. On your fb application, you have to disable the secret key requirement. This can be found under the advance settings of your fb application console. It's called " Require App Secret".
Once you generate a fb PAGE access token, you get a fb page token, and then extend it. here is the token debugger: https://developers.facebook.com/tools/explorer/
You can extend the access token programmatically as explained here: https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension
AND
https://developers.facebook.com/docs/facebook-login/access-tokens/#pagetokens
OR
There is also an extend tool in the access token debugger (just click on the debug and the extend button is bottom left): https://developers.facebook.com/tools/accesstoken/
Yes , we had a working product back in 2016 ( almost like it's successor Fb Local ) . We were monetised and ready and selling events tickets on the messenger chatbot.
Idea was to solve discovery + booking for hyperlocal events. We went out of business and now its a heart ache to see Fb local.
enter image description here

Facebook Page Creation API throttle limit

I am building an application for clients to be able to create Facebook Page in their account using my own Admin Access Token.
I have Standard Access approved for my Facebook application already.
I tried to create a few test pages using FB Graph Explorer and I succeeded.
I ran into a problem when I tried to create a page using Code in Classic ASP, it says Have reached page creation api throttle limit
FR- https://www.screencast.com/t/hTd4RDozov
I tried to search into the Facebook documentation to find out that when I can get out of this error, but couldn't find any response.
Are there anyone person who has got this error before? Or can someone tell when I can get rid out of this error?
Many thanks
Currently experiencing the same behavior. Talking to Facebook support they say the default limit for page creation is 2 pages per month. This number might be negotiable depending on your usecase.

Find out whether Facebook page is live streaming

Is possible to find out whether some facebook page is live streaming right now? I was looking at Facebook API and from there it seems to me that it is not possible since /{page_id}/live_videos seems to be working only if you are an admin of the page (or you have been granted the access) since you cannot read live videos of public without page access token.
Yes, you can. This is actually called a WebHook (simultaneous notification of a certain app/user about changes made on the page). To do this you will have to create a Facebook App that will be subscribed to the changes made on a certain page that you want to track.
You can simply do this from the dashboard of the app or through Graph API 2.7(since this version supports live_videos) calling {app-id}/subscriptions and choose any of Page Object Subscriptions, which are available through Facebook API(in your case live_videos).
For this kind of subscriptions your app needs to be whitelisted in order not to spam or re-transmit the information received from a certain page.
To get more information about WebHook implementation please read Facebook API documenation: https://developers.facebook.com/docs/graph-api/webhooks
I know this is quite late already but for those that may stumble on it like I did, Yes it's possible.
As clearly stated in the documentation
Page Live Videos - Facebook API Documentation
You will need to make a GET Request to the endpoint below with the appropriate parameters:
https://graph.facebook.com/v6.0/{page-id}/live_videos
Where page_id is the Facebook Page ID you with to check for active Live Stream
The endpoint also expect broadcast_status whose value for your use case would be LIVE
Note: You will need and app setup on Facebook for developers platform and your query would have to be via the app
Further details can be found in the documentation whose link I provided at the initial part of this answer.
You might be able to get a returned string if there is any, from:
GET /v2.7/{page-id}/live_videos HTTP/1.1
Host: graph.facebook.com
You can read more in: https://developers.facebook.com/docs/graph-api/reference/page/live_videos/

Remove facebook user from within the application

Prior to the may updates (we were using the offline tokens because they did not expire), I was able to send a delete request to facebook and remove the user's facebook link from within our software, after turning the disable offline access to enabled (disabled the old functionality), this no longer works. I am trying to figure out what may have changed. There are no current posts on the subject and all the posts I do find are VERY conflicting in answers.
i.e.
Remove the application from a user using graph API
vs
Facebook account delink or deauthorize facebook app and check status of linking from facebook app
This is also documented on the graph documentation as saying this command should work, I have tried a few different syntaxes (its not actually stated which syntax to use in the documentation - nice job Facebook, it just says "send a delete request").
Long story short, does this work? I keep getting the 400 error "bad request" when attempting to fix this feature.
I have tried the following two urls:
https://graph.facebook.com/userId/permissions?access_token=someToken&method=delete
https://graph.facebook.com/me/permissions?access_token=someToken&method=delete
Those questions aren't inconsistent, one of them was answered before the Graph API had support for this
https://developers.facebook.com/docs/reference/api/user/#permissions is the documentation, the example is:
(javascript)
FB.api("/me/permissions","DELETE",function callback());
I've done this many times and it definitely works
Sorry for having answered my own question:
Apparently I was actually getting random errors rather than actual errors.
I am unsure if /me/ works, because I did not go back to re-test it, but I am certain now that using the format:
https://graph.facebook.com/userId/permissions&access_token=someToken
Does indeed work correctly for deauthorizing your own application in facebook.

Facebook graph API returns empty data for a page

I have an application that is retrieving data from Facebook. Users authorize the application to read and write to their pages, and we read their data and post to it from our application. All interaction occurs via the PHP interface that Facebook supplies.
For the last few months our application has been performing this task flawlessly. However in recent days we have started noticing an issue with certain pages.
We go out and retrieve data for a specific page, and we no longer get any data. Instead Facebook returns us an empty result. This obviously causes problems in our application which needs to read this data.
We can still write data just fine.
I am at a point where I'm not sure what this could be. Any common scenarios or recent Graph API issues that could cause this?
This sounds odd. The only thing that comes to mind is that the page owner has put a restriction on the audience for their page, which would then require you to pass in an access token to access data about the page. An example would be a beer company that wants to limit access to their FB page to users that are older than 21. Since there is a restriction on who can access the page content, we enforce that restriction on the FB platform. In this case you would need to pass in the access_token of a user who is 21 or older to access the page details via the graph api.
Adding to Jeff's answer, I found that any kind of restriction whatsoever will return a blank data object. I was banging my head on every single setting on my company's page and found that we had it set to only show in certain countries (Manage Settings > Country Restrictions). Removing all of them from the list started to return all the data we needed.