Using PyFacebook I am trying to register a test user of my site with my facebook application. I can connect to the API fine and return a list of friends etc. However when trying to register an address using:
hashed_emails = facebook.hash_email('foo@bar.com')
accounts = [hashed_emails]
facebook.connect.registerUsers(accounts)
I get:
FacebookError: Error 100: Invalid
email hash specified when trying to
use connect.registerUsers(accounts)
Yet I know the hash is correct as the test hash in the documentation returns the same result:
mary@example.com = 4228600737_c96da02bba97aedfd26136e980ae3761
I also know the email address used is definitely a Facebook user. Moreover connect.getUnconnectedFriendsCount() works fine and returns the expected result (0!) – suggesting the link to the App is OK.
What’s going on? Is connect.registerUsers() something that would only work once I’ve been given ‘permission’ to use Friend Linking? Or is the error message I’m receiving a catch all for a number of different results? Or have I just misunderstood the use of connect.registerUsers()?
My request array to the API was incorrectly formatted. It should have been:
Which returned the expected response (list of registered hashes) and was further proven by connect.getUnconnectedFriendsCount() which now returns 1.