Technically I have two questions:
1st - Is there any way to get Facebook access, through an account, without having to create a Facebook App ?? Like having an account access token instead of an App token.
2nd - Through Facebook Graph API can I get my friends list ? I use the permission "user_friends" and I request"me/friendlist" and I only get 3 friends out of more than 400 on my friends list.
Thanks in advance.
1) No, without any App you can´t get Access to anything. Even the most simple Access Token needs an App: https://developers.facebook.com/docs/facebook-login/access-tokens
2) Since April 2014, you can only get the friends who authorized the App too, for privacy reasons: https://developers.facebook.com/docs/apps/changelog
Related
How can I get user's friends (from his access token) who authorized the app as well?
$ https://graph.facebook.com/<uid>/friends?access_token=<token>
{"data":[]}
I have two friends using my app and we are all receiving an empty array.
Am I missing something ?
Thanks a lot
In order to make this work, both users (you and your friend) need to authorize the app with the user_friends permission. You can also use /me/friends btw.
I need to build a scraper that takes as input the Facebook credentials of a user and than scrapes all the friends of the user to do some statistical computations. How can I go with this? I get to know that graph API don't allow to access friend list of a user. So do I need to signin the user and then scrape the friendlist ?
I want to find the date/time they became friends, for each of the user's friend.
takes as input the Facebook credentials of a user
Never ever ask a user for his credentials. Always use Facebook Login to authorize users: https://developers.facebook.com/docs/facebook-login
scrapes all the friends of the user
Scraping is not allowed on Facebook: https://www.facebook.com/apps/site_scraping_tos_terms.php
The only way to get access to the friends of a user is to authorize the user with the user_friends permission and use the /me/friends endpoint. You can only get a list of friends who authorized your App with that permission too. The date/time you became friends is not available though.
More information: Facebook Graph Api v2.0+ - /me/friends returns empty, or only friends who also use my app
Not that long ago this link worked:
http://graph.facebook.com/https://www.facebook.com/my_fanpage_name
and I was able to get basic information about the page, likes and shares. Now I see error: "An access token is required".
Has facebook changed something recently? Is there other way I can get the number of likes of the facebook page without access token?
Yes, you need to use an Access Token for that call now, and you need to specify the fields you want to get:
http://graph.facebook.com/my_fanpage_name?fields=name,likes&access_token=xxx
You can use an App Access Token, which is just App ID and App Secret with a pipe in the middle:
App-ID|App-Secret
Changelog: https://developers.facebook.com/docs/apps/changelog
More information about Access Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Don't think as developer yet. I'm a Facebook "normal user" and I'm logged. Then I access a friend 'X' profile. As a friend, I can see all the friends of friend X through this url:
https://www.facebook.com/friendx/friends
Fine... I can close the browser and, when I open it again, I can access the same url and see my friend's friends. And it's fine, because there is a cookie telling the server who I am.
But now, I'm still logged and I wanna retrieve all the friends of friend X throught graph api request, so i access this url:
https://graph.facebook.com/friendx/friends
And the error is, according to the documentation, expect:
An access token is required to request this resource.
I can't understand why facebook needs an access token. I'm logged in both cases. That cookie, in the second situation, is useless when I try to access the same information through graph api request.
What I wanna mean is: I don't wanna parse a whole html page to know who are friends of my friend. Parsing json is much easily.
The Facebook API requires authentication from the user to make that GET request, therefore you need an access_token saying that the user gave permission for you to access their friends list.
You cannot get an access_token from your cookies as it has to be generated via the API after the user approves your app.
If you want to test the graph API consider using the Graph API Explorer to generate an access token and generate the request but you should not use this as a solution to your answer.
consider reading the facebook documentation on access_tokens to further understand how the facebook API and authentication work.
The facebook GraphAPI doesnt allow us to collect the data which belongs to someone else. As you said you can access the friend's friend but at that time you are not collecting data for personal use, so that is allowed. That data is public so you can access, but I certainly doubt that they do allow us to access that data through GraphAPI or any other API. Also scrapping Facebook data is not against the facebook policies.
is it possible to get the friend lists from an user with the APP secret(not with the access token) by using the open graph?
The User has already installed the APP.
Thanks in advance.
PS:
If I understand aright ...
-> graph API = only works with the acces token
-> FQL = works with access token and app secret
Right?
I´ve never heard that you can use an app secret with FQL. Theoretically it is impossible to get the friend list from a user with the app secret only, because the app secret is the same for all users. There are only different access tokens (page token, app token, user token), but to get the friends of a user you will always need a user access token.
Btw, you don´t really need to worry about that if you are using one of those SDKs (PHP SDK, JS SDK...).
Also, it is best practice to use the Graph API if there is a possibility, and FQL only if there is non (good) way with the Graph API.