How to i can watching live tream facebook with access_token
I want to increase the live audience video on facebook with token code.
Mostly I did not find the live view API via the token
There is no support or API end point to view a Live Stream by using Access token of user.
So, you can't increase live audience by using the access token.
It can only be increased by actual viewers viewing it.
Related
My team and I have been trying to connect to the Graph-API (Facebook) for a few days to get access to Audience Network data through our API.
Steps we follow:
Implementation of Facebook Login flow
Generation of Access Token from the Facebook Login Button in our application.
Modification of the Access Token to a Long-Term Token.
We debugged both tokens through the official tool and it is possible to observe that it is a valid token with the proper access: https://developers.facebook.com/tools/debug/accesstoken/
In the settings, the JavaScript SDK is already properly activated
The request we are using as an example is:
https://graph.facebook.com/<API_VERSION>/<BUSINESS_ID|PROPERTY_ID|APP_ID>/adnetworkanalytics/?metrics=['fb_ad_network_imp']&access_token=<ACCESS_TOKEN>
We use the following documentation as reference and tools:
https://developers.facebook.com/docs/audience-network/optimization/report-api/guide-v2?locale=en_US
https://developers.facebook.com/docs/audience-network/optimization/apis/FB-login-Reporting-API
https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived
Even after all these steps, when trying to make a request to the Graph-API, through the explorer https://developers.facebook.com/tools/explorer/, we still receive the following message:
"The way to access reporting API v2.0 has changed. You now need to implement Facebook Login for your app to access this API. See instructions here: https://developers.facebook.com/docs/facebook-login/"
Is anyone trying to implement this flow or know how to fix this behavior?
I have an application, that runs on server. On that server is background task, that will post status update on few social networks (Facebook, Twitter, G+). It must be completely server-side.
In Twitter API I'm able to use OAuth header to authorize API request. OAuth HTTP header uses consumer key, consumer secret, access token and access token secret to create the header. With this I'm able to post/update/delete tweets with no user interaction.
How can I do this for Facebook? I found a solution to obtain a long-lived access_token (2 months), but we don't want to regenerate access_token every 60 days. We want to use it for manage our Facebook page - post status updates, but completely server-side.
Am I able to do this for Facebook? Thanks for answers.
PS: I searched stackoverflow hundred-times but with no solution for my problem.
Thanks.
It is not possible for User Access Tokens (they can only be extended to 60 days and need to be refreshed by the user after that), but for posting to a Page you should use a Page Token anyway. An Extended Page Token is valid forever.
Here are some Links to help you get that Extended Page Token:
https://developers.facebook.com/docs/facebook-login/access-tokens/
http://www.devils-heaven.com/facebook-access-tokens/
http://www.devils-heaven.com/extended-page-access-tokens-curl/
A Page Token will post "as Page" btw, but that´s probably what you want. And auto-posting on user profiles is not really allowed anyway, every message has to be 100% user generated and every posting should get authorized by the user.
Pay attention to Access Tokens Expiration & Extentions.
The Page Access Token could be a good solution to only server side calls for testing and data analysis purposes.
Take your User Access Token from Graph API Tool
Extend your User Access Token
Call https://graph.facebook.com/v2.11/me/accounts with your user access token extended
*all calls are GET and this procedure does not use APP Access Token.
I'm trying to read likes on my friend's status. It is working fine if i copy the access token from the graph api explorer.
If i use the getAccessToken method. It just returns an array with the id of the status, which was passed by me.
Can anybody help me on how to pass the access tokens to the app.
You may say that why don't you continue with the token copied from graph explorer?
But due to the recent changes offline_access token has been removed, so that the token is expiring for every hour. By the way i'm using graph api with php.
The app needs a user access token if the status is not public – otherwise the API can not detect whether the current user is allowed to see it or not.
Get a long-lived access token: https://developers.facebook.com/roadmap/offline-access-removal/
I have some C# code that retrieves an access token using Facebook.JsonObject and can post to my profile wall on facebook with no problems.
However, if I try to use that same access token to retrieve details of my facebook business pages so I can post to them, then I get the message "user access token is required to request this resource".
I thought the access token I had retrieved that allowed me to post to my profile was a user access token. What is the difference, and how do I get a user access token?
This is the code I am using to get the access token:
facebook.JsonObject AuthResult = (Facebook.JsonObject)Oauth.GetApplicationAccessToken(parameters);
object Access_Token = "";
AuthResult.TryGetValue("access_token", out Access_Token);
FacebookClient FBClient = new FacebookClient(Access_Token.ToString());
More information:
I need my customer's c# application to post directly to my customer's facebook business page via code without the application "allow access" box popping up and any redirects to applicatoins taking place. Therefore I need to get the User Access Token programatically without facebook being logged in or open etc.
Any (non-sarcastic) help very gratefully received.
Thanks
I thought the access token I had retrieved that allowed me to post to my profile was a user access token.
Does that method name,
(Facebook.JsonObject)Oauth.GetApplicationAccessToken(parameters);
===========
really sound to you as if it was supposed to give back a user access token? Sorry, but to me it doesn’t …
If you are not familiar with the different types of authentication and access tokens, please read this first: https://developers.facebook.com/docs/authentication/
I'm playing around with Facebook Connect, trying to use Facebook as the means or authentication on my site. Currently my workflow looks something like this:
Go to URL
Server checks cookies for AccessToken
If AccessToken exists, automatically fill in user's name/profile picture in comment box, and leave AccessToken in hidden input
send page down to client
on submit, verify access token (which was submitted with the rest of the form) is a valid access token for a real person. If so, add comment to Database
refresh page to display new data
if no access token, replace user's name/profile picture with <fb:login-button>, along with the required <script>s.
send page down to client
When user authorizes page/logs into facebook, refresh page
(go back to top, except this time the access token should exist)
So I have a few questions:
Is this secure? I was thinking of ways i would be able to do without the double authentication with Facebook (checking once on page-generation and checking again on comment-submission), and I could not figure any other way short of maintaining my own session-state with each client. Is that worth doing?
Does the access token expire when i log out of Facebook? I'm thinking it should, but it seems I can continue to use the same access token to grab data (i.e. name, url, etc.) after I manually go to Facebook and log myself out. Is it because I'm only asking for public information, and only more intrusive permissions expire on logout?
Given that each person who wants to do something has to provide a unique token from Facebook, this should have the side effect of blocking CSRF, since every action can be traced to a valid Facebook account. Is that right?
Why don't you just use the Facebook Javascript SDK to detect if they're currently logged into Facebook? This will also make the access token available in Javascript so you can make client-side calls to the API.
You can access the same access token server side via the session cookie set by Facebook also.
I can't answer all of your questions but I can tell you that having the access token in a hidden field on your page is risky from a policy perspective, especially if your page can be read by any third-party code such as Google Analytics or AdSense. Facebook will nail you for this as it is leaking user identifying data to third parties. The Facebook userid is in the access token in plain text. Facebook has automated processes that scan for this stuff and will auto-ban your app if it is leaking userids to third parties.