Find out whether Facebook page is live streaming - facebook

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/

Related

Not able to get permission for Facebook API call

Our client wants to show the three latests posts from their Facebook wall on their website. Therefore we follow the procedure described here (the second answer) which seems pretty straight forward: How to embed a Facebook page's feed into my website
I can generate an access token easily but the call to the following URL fails and gives me the following error message:
https://graph.facebook.com/juwelierwagnervienna/posts?fields=full_picture,picture,link,message,created_time&limit=5&access_token=MY_ACCESS_TOKEN
This endpoint requires the 'manage_pages' or 'pages_read_engagement' permission or the 'Page Public Content Access' feature.
Therefore I requested manage_pages and in a separate request Page Public Content Access via the App interface. They declined both for the same reason over and over again although I made a pretty detailed description and a video to document my approach including code samples.
We determined that your app's use case for this permission is invalid, or it's not needed to support its core functionality. You can learn more about the allowed use cases by visiting our Permissions Reference or Features pages. Please resubmit your request, and ensure that you provide a valid use case with notes and screencast clearly explaining: [...]
I followed all of the instructions and resubmitted the request for approval several times already.
Would love to hear some feedback and recommendations on this one since I'm at a dead end here and the Facebook Support Chat can not help me either.

Azure Logic apps Facebook connector gives empty response

When I try to use the Facebook connector in Azure logic apps I can't seem to get the "Get user timeline" to work.
I know for a fact that the User ID is valid (I checked using this URL: https://www.facebook.com/profile.php?id=). I also know for sure that the user has posts on it's timeline. I also tried multiple user ID's.
When I open the failed request in the Logic app I get this, the response is empty every time.
Is this related to privacy settings? Why doesn't this work?
We should probably retire/remove that operation. It is not possible to retrieve the post from Facebook graph API for another user's timeline. It used to so that is why it is there. Specifically, this post might be helpful: Facebook Graph API {user-id}/feed from others empty
The connector calls the /{user-id}/feed API. You can try out the behavior in the Facebook Graph explorer as well. https://developers.facebook.com/tools/explorer/

Facebook shows news feed messages that aren't returned by any of the APIs

I noticed that my feedback news feed shows certain posts that aren't returned by any of the API's. (I tried the GraphAPI and the legacy REST API and FQL).
I can see those status updates at http://facebook.com on my news feed and I can also see them in the Facebook mobile app on iPhone and the mobile app on Windows Mobile.
Some of my friends seem to have set a privacy setting. I think it is this one: "How people bring your info to apps they use" - decheck "My Status Updates", although I can't confirm that is the only reason their posts don't show up, it seems one possible explanation.
So, what API are these facebook mobile applications using which returns the same data as the web site ? Is it possible for me to build another facebook client using that API?
Have you acquired the read_stream extended permission? This is required to see all postings. Typically without it you don't see any posts, but I think you can see posts that are marked as being completely public.

How to simulate silent login to Facebook Graph API?

I'm working on an API that will aggregate data from several website, including facebook. The API has an engine that harvests data on regular intervals, and then the client app polls the API to get the data from all websites centrally.
The problem is that the API has no way of authenticating on the regular, behind-the-scenes harvests, as Facebook insists that the user has to click on the OAuth Dialog. With the short story being that there is no way to login to graph API silently this almost means that developing such an API is not possible (except for harvesting only public data).
However, I'm not easily satisfied by "it's not possible" answers and my clients - even less so. Accessing private information on demmand is defnitely possible as Facebook apps do that. For example, the official Twitter app posts on my wall whenever I tweet. I guess apps only need a permission once and then can access the user's profile as much as they like.
So this leads me to think that I should do a combination of a Graph API client and an application that talk to each other, and whenever the API needs to harvest - it asks the app to get the data and fetch it to the API. Or maybe it should be a push model (the app sends the data whenever it's generated) rather than pull (the API requests the data at regular intervals).
Am I on the right track? Is any of these the correct design approach?
I did some searching but it's very hard to find any useful discussion on the topic as whatever keywords I try I only find "Can I login silently? No" type of discussions.
You'll want to look into the offline_access permission. This lets you access a user's data when they don't have an active session, or are offline. That's as close to "silent login" as you can get.

Outside access to Facebook events

Let's say I own/control a Facebook page where events are posted. I'd like to display these events on another website (In my case, a WordPress blog, but that's not the important part) on an "Upcoming events" page.
What I'm unsure about is: Is the Facebook API usable "externally" like this? I've downloaded the PHP library and have a demo app running that works from within Facebook (i.e. emitting FBML that facebook.com interprets and displays to the logged-in user), but in my case I want a third party (my web server) to query Facebook every so often, rather than the site visitors directly requesting data (HTML/JSON/etc.) from Facebook itself.
Is this sort of thing possible with the Facebook API? How will my web server authenticate itself? What information do I have to store?
Note: I'm looking for information more at a "sequence diagram" conceptual level, not just asking for code. That part I can figure out myself. ;) Unfortunately, Google and the FB developer wiki have not been entirely forthcoming. What do I need to know so I can start coding?
This is a basic overview of how I've done it for a few of my clients who wanted similar functionality:
Create a pretty basic app that prompts for Extended permissions, specifically "offline_access" and whatever else you need
Store the resulting Session Key in your database with the UID
Create a secure, authenticated webservice for your app which allows you to get the info you need for a UID that you supply, using the session that you've stored in your database
On the website make requests to your app's webservice, being sure to cache the results for a certain period of time and only make a new request to your webservice once the cache has expired (I use 5-10 minutes for most of mine)
So basically your Facebook app acts sort of like a proxy between the website and the user, doing all of the authenticating and requesting using legitimate means.
I've used a webservice because I only wanted to maintain one Facebook app for multiple client's needs. It works like this (in a not-very-awesome ASCII art diagram):
Facebook User 1 \ / Client Website 1
Facebook User 2 --- Facebook App --- Client Website 2
Facebook User 3 / \ Client Website 3
Note: I've only done this for users, not pages, so your mileage may vary.
You can do Events.get with the Facebook API then supply the page/profile ID you'd like to get the events for. Depending on how your page is setup you may have to authenticate, simply use your Facebook account, since you should have access to all the events. oh and make sure you do plenty of caching so your not hitting Facebook on every page load.
AFAIK other than user info, you can't fetch any other data from facebook.
But you can try it other way - say create an app that stores events and other relevant information on a webserver and then your other website can easily access that info.