Retrieve a facebook secret group feed - facebook

I'm building a PHP application on a website to allow members of a secret Facebook group to retrieve all the YouTube links posted on the group wall. To do that I need to retrieve the feed of the group which I did using open graph. I generate an access_token thanks to graph API explorer and I managed to display the feed but it relies on the access_token which is eventually going to expire.
How can I do to be able to call the API's functions at any time with a valid access_token?
I was thinking about asking the visitors to connect with their Facebook account onto the application so that they can make a request with their own token.
Do you have leads on how I could do that?

Thanks i just created a dum app on facebook to allow oauth on my website and that did the trick.

Related

User Instagram Graph API without Facebook Login

I'm trying to use the Instagram Graph API from Facebook. I need the media, stories and some profile information like follower. The problem is, that many users have no Facebook page which is connected to a instagram account.
Is it possible to use the Instagram Graph API without Facebook Login? The best solutions would be a login via Instagram or login via Facebook but without required page. Have anyone a suggestion?
I read through the documents and did a bunch of testing.
Here's what I think is necessary for using instagram Graph API as of 21-01-2021:
A facebook login to get fb access token
A page that connect to a business/creator account
We can get the connected instagram business/creator account's data by the token.
If users do not have facebook page is your concern, consider to use the instagram basic api instead.
I think it is possible to get ig data without facebook technically. Hope facebook get provide a clearer instruction and docs for developers in the future.

Querying Facebook Status Updates of a profile

I have a website that query Facebook graphApi and get the available public data of pages.
I have some profiles, where graphApi does not return any data i.e. post/status data marked public on profile.
Even when I try to visit profile manually i.e. by typing url in IE - https://www.facebook.com/ndalloul, it redirects me to Facebook login page.
But when I do it manually i.e. login to my Facebook Account and try to view the profile Ex:https://www.facebook.com/ndalloul shows me the data marked as public.
How to get this data from Facebook using API or Library?
Any help is appreciated.
Thanks.
Apart from the fact that Facebook is switching to the Graph API 2.0, you should not get any kind of redirect to login if you use your app access tokens and talk to the graph via cURL 8ro qeuivalent) .
The endpoint to get public statuses from fan pages, is page_id/feed/ You need an access token from an app with with read_stream permission and only those who grant you that permission will show the latest posts. More info here
You may now have to be approved by facebook to read the stream, by the way.

No access token facebook application authentication

I'd like to show my facebook wall posts on my website.
So i don't want to authenticate users with a dialog, to grant them some rights, i just want to show him my wall with comments (no ability to add comment just read only access).
As i know there isn't unexpired tokens now so is it possible to access just my data without requesting token every time it expires?
I'm using asp.net mvc but i think this sultion doesn't depend at platform at all.
You should:
Make your Facebook Posts public
Call the API endpoint: https://graph.facebook.com/{your_id}/feed?access_token={app_access_token} with your user_id and valid application access_token
Show the results on your website.
The App Access Token doesn't expire so you won't have a problem. As long as the posts are public, the API will be able to pick them up. In theory, your posts should be public anyway so anonymous users can see this.
This also gives you the ability to share stuff privately and not have it show up on your website.

Can i get access token from facebook without using AppId?

I am using facebook C# SDK 5.3.2 for desktop application. I created an application on the facebook to get AppId. I can get accsess token using this appid. And i can also post my facebook wall. But i also want to post my friends's wall. How can i do that without using AppId? My senerio is add all friends to app getting accsess token and post mesages to their walls using this tokens. Is that possible? How can do that?
You have to get authentication from users in order to retrieve an access token that will work for them. You have to use your APP_ID in order to authenticate your application with a user.

How to get the access_token for Facebook with no application

On the documentation page for Facebook Graph API there are a lot of example links such as https://graph.facebook.com/me/likes?access_token=SOME_AT
Could anyone explain how the access_token for these links are generated?
All I've read in the documentation were about getting access_token only for applications, but on that page everyone could get an access_token without one.
You can use the graph API to get public information. People set privacy settings on facebook, so to prevent social freaks from stalking you, they(fb) created Autorisation.What I believe is that on the documentation, they are generating the access token using the Developers App. You can generate this Access token by making an application and asking a user to Authorise your application to access his data using OAUTH dialogs. Usually people reading at developer.facebook.com have enabled the Developers app so it easily opens your information.
The Graph API as such allows you to
easily access all public information
about an object. For example,
https://graph.facebook.com/btaylor
(Bret Taylor) returns all the public
information about Bret. For example a
user's first name, last name and
profile picture are publicly
available.
To get additional information about a
user, you must first get their
permission. At a high level, you need
to get an access token for the
Facebook user. After you obtain the
access token for the user, you can
perform authorized requests on behalf
of that user by including the access
token in your Graph API requests:
The access_token in these links are generated using your Facebook identity and an application ID (presumable associated to "developers.facebook.com"). If you go to the same page with another Facebook account, you will see different access tokens.