I want to send friend name as a user in get_object()
in below code for getting his public posts. But I am getting error
raise GraphAPIError(result) facebook.GraphAPIError: (#803) Cannot query users by their username (tayyab.rasheed.545)
user = 'tayyab.rasheed.545' #is giving error
#user = 'BillGates' #is working fine.
# user = 'me' #is working fine.
graph = facebook.GraphAPI(access_token)
profile = graph.get_object(user)
posts = graph.get_connections(profile['id'], 'posts')
Why is the error? I think I am doing something wrong. BillGates
and me
is working fine then why not tayyab.rasheed.545
Profile of friend is 'https://www.facebook.com/tayyab.rasheed.545'