0
votes

I'm trying to write a python script with Facebook SDK for Python to download all my own photos.

 my_token = 'user_access_token'
 import facebook
 graph = facebook.GraphAPI(access_token=my_token, version='2.7')
 photos = graph.get_connections(id='me', connection_name='photos')
 photos

But photo is an empty dict.

{'data': []}

I realized I only had user_friends, public_profile permission per my user access token which is generated with my own fb account and if i need more than those permission I need to apply for an app review "Apps that ask for more than public_profile, email and user_friends must be reviewed by Facebook before they can be made available to the general public."

Do I really need to apply for a review for my so called app, which is just a python script in order to download my own photos or am I missing something here

1
Thanks; this is much more to the point than the initial posting. It moves past the point of my answer, which I'm deleting. - Prune
@CBroe I'm listed as an administrator on my app so i should have full access right? - chang02_23
and I'm using a user_token generated for my my test app - chang02_23
And does that token include user_photos permission, or not? Debug it to verify. - CBroe

1 Answers

0
votes

I created a developer account using my facebook account. I created a test app and i am the administrator of the app. I am using my user_token which i thought as an administrator, i have access to all kinds of permission but it doesn't have photo_permission, only public_profile and user_friends.

permission = graph.get_permissions(user_id = user_id)
permission
{'public_profile', 'user_friends'}

It took me some detour to figure out how to get permission to user_photo without app review, as someone suggested earlier it may involved logging in as myself, that didn't take me anywhere. Then I stumbled on Graph API explorer which lets me generate an access token with whatever permissions you need. you just need to check the boxes! enter image description here Now when I use this new token to get photo permission

permission = graph.get_permissions(user_id = user_id)
permission
{'public_profile', 'user_friends', 'user_photos'}

And photos is not an empty dict anymore

len(photos['data'])
25