Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_connections fails to get friends #49

Closed
kaarthikeyapreyan opened this issue Sep 21, 2012 · 7 comments
Closed

get_connections fails to get friends #49

kaarthikeyapreyan opened this issue Sep 21, 2012 · 7 comments

Comments

@kaarthikeyapreyan
Copy link

Python 2.7.3
facebook_sdk-0.3.2-py2.7.egg

graph.get_connections(profile["id"], "friends")

Traceback (most recent call last):
File "sdkref.py", line 31, in
friends = graph.get_connections(profile["id"], "friends")
File "C:\Program Files (x86)\Python27\lib\site-packages\facebook.py", line 111, in get_connections
return self.request(id + "/" + connection_name, args)
File "C:\Program Files (x86)\Python27\lib\site-packages\facebook.py", line 275, in request
raise GraphAPIError(response)
facebook.GraphAPIError: Unsupported operation

@martey
Copy link
Member

martey commented Sep 21, 2012

I can not replicate this issue. Does this consistently occur for you? Are you able to replicate it (using the same access token and application) on the Graph API Explorer?

@kaarthikeyapreyan
Copy link
Author

I used the same access token used in the application
and the get query /?fields=friends

I get this error on the Graph API Explorer
{
"error": {
"message": "Unsupported operation",
"type": "FacebookApiException",
"code": 100
}
}
This is happening only for friends am able to view few of the other data like posts, feeds without any error.

@martey
Copy link
Member

martey commented Sep 22, 2012

the get query /?fields=friends

As you can see on line 111, get_connections uses the query id/friends. You could also use /id?fields=friends, but you need to have the Facebook user ID as part of the URL.

@kaarthikeyapreyan
Copy link
Author

sorry about that martey,
/userid?fields=friends was my input
i also tries by selecting from the node on the left pane from the connections section it also returned me the same Graph API Explorer error.

@martey
Copy link
Member

martey commented Sep 22, 2012

Since the error is occurring with the Graph API Explorer as well, this is extremely unlikely to be an error with the library, so I am closing this issue.

You might want to try to create a test user (to see if there is something wrong with the user you are using) or creating a new application. Let me know if you need further assistance by contacting me directly and I will try and help you with further debugging.

@martey martey closed this as completed Sep 22, 2012
@rajasimon
Copy link

sorry I'm having this problem now...

friends = graph.get_connections(id='me', connection_name='', fields="friends")

and the print of friends is

{'friends': {'data': [], 'summary': {'total_count': 427}}, 'id': '10154052898937398'}

@martey
Copy link
Member

martey commented Apr 4, 2016

@rajasimon, there are a number of reasons why the list of friends might be empty that do not relate to bugs in this application. I would advise posting to the Google Group for more support: https://groups.google.com/forum/#!forum/pythonforfacebook

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants