Facebook access_token for stranger account - facebook

is there a way to get an access_token to get a stranger account photos, albums and friends?
As i can see you can get (with the right access_token) all the information belonging to you and your friends using:
https://graph.facebook.com/[User_ID]/friends?access_token=[A_T]
https://graph.facebook.com/[User_ID]/albums?access_token=[A_T]
https://graph.facebook.com/[User_ID]/photos?access_token=[A_T]
what about the friends of your friends and perfectly stranger? Are they reachable in such a way?
I ask this because using the normal browser i can get the public photos of unfriend account, so i thought that can be a way to get that information through the API.

It is not possible, the facebook privacy is to tight to do such a thing.

Related

How to get my own Facebook user timeline using Graph API?

I would like to get all the posts and updates that are normally displayed in FB official application for MY account (this includes updates from my friends and liked pages).
I wasn't able to find any details how to get that, the only thing I've managed to get is my own posts.
Anyone got any experience with that using current Graph API verion (3.3)?
All the alternate FB clients (ex. Friendly) must be doing this somehow.
There is no way to get ANY data of users who did not authorized your App. Which means, there is no way to get posts of friends. You can only get your own friends, with the user_posts permission and the /me/posts endpoint. If some Apps access friend data without their authorization, they are most likely doing something that is not allowed.
Here is what I found in their API docs:
There are two scopes:
The user feed requires the user's permission
The public feed has fewer capabilities but doesn't require perms

How to get OTHER users' photos and albums with Facebook Graph API

Scenario: logged with my Facebook account and using a browser, I'm able to see some photos and albums of some users which aren't friends of mine (with a privacy setting of public or similar) and quite all their past profile photos.
For example the URL
https://www.facebook.com/<userid>/photos_all shows those photos.
I want to replicate behaviour with Graph API but GETting
https://graph.facebook.com/<userid>/photos?access_token=...
Gives me an empty data array.
Same scenario using tagged or albums instead of photos
I've tried to use site scraping but FB website uses AJAX to populate gridview of photos, so It's very difficult.
On Graph API Explorer I've requested and use an access token with all permissions and also a debug access token but I'm still unable to get other users' photos.
It's possibile to get photos of users which aren't in friend list with Facebook Graph API? Am I missing something?
For privacy reasons, it´s not possible to get the photos of OTHER users with the API. Even for the authorized user, you need the user_photos permission.
Scraping is not allowed btw: https://www.facebook.com/apps/site_scraping_tos_terms.php

Facebook SDK Get Friend's Photos

In the FB Graph Explorer, I run a graph for me/friends, returning the ids of all my friends. Then, I choose the id of a friend whom I know as photos visible to me in an album and run the request [friend's id]?fields=photos.
Almost all the time, none of the friend's photos' ids are returned in the explorer, even though I can plainly see them on through my FB account. All I get back is the friend's id. I have both the general user access token and friends_photos permissions selected. [friend's id]?fields=albums has the same result.
However, with a few certain friends, the request does return all of the photos the friend appears in.
What is making the difference and what must I do to gain access to my friends' photos through the SDK?
The correct query is [friend's id]/photos and [friend's id]/albums
Test with Graph API Explorer:
https://developers.facebook.com/tools/explorer?method=GET&path=FRIEND_ID%2Fphotos

facebook api get friends likes returns empty array for some friends

i tried this with fql and the test console
https://developers.facebook.com/tools/explorer
checked the permissions
check with two accounts (no privacy issues)
checked the fb bugreports
clicking on friends then a user id then likes returns an empty array on some of my friends. i couldnt figure out why this is the case.
it seems to be pretty random but maybe i overlooked something
can someone help me on this?
If some person means Your app works fine for facebook developer account and other accounts not - check on You facebook developer account Status & review if Your app is On for public and not blocked for review.

Getting friend user id, and their photos

I am doing some research into the capacity of Facebook Connect. I have some questions on how a couple of bits of functionality.
Is it possible to fetch a list of all friends of a user?
The idea of this is that a user would log in using my site and then they could search through their friends and select one, and the site would get that friends users id and store it to the sites database.
Getting a photos from that user
After getting the friends user id, would it then be possible to get their photos? Or would the friend need to give the site permission to do that?
I am looking into a site where you can buy a greetings card for a friend, and i wanted to know whether my users would be able to login via facebook, pick a friend, get a photo and then at the time of their birthday it would send them a private message (which i think i know how to do) linking them back to my site where they could view the birthday card and their photo.
Thanks
To answer your questions:
Yes. Once you have an access token from the login process for a user, make a Graph API request to https://graph.facebook.com/me/friends. You can test this for yourself here: https://developers.facebook.com/tools/explorer?method=GET&path=me%2Ffriends
Yes. During the login process, you must request user_photos and friends_photos permissions after which you can use the access token for a Graph API request to https://graph.facebook.com/USERID/photos. This will only return those photos for a friend which the user is allowed to see for the current privacy settings.