views:

86

answers:

1

I have a facebook connect app all set up using oauth and after the final transaction I receive an access_token that looks something like -

559514387926|f53be3fc76b8e243aaf2944b-502835064|moXh_HOIga8b32txRdwkan-5NW9.

The part in bold seems to be facebook user id of the current user. I checked this with all the access_tokens of the users I have thus far and it matches in every case.

Is there any documentation that states that this is a reliable way to obtain the facebook user id ?

I want to use the facebook user id directly to make leaner calls for existing users pulling only picture and pulling a lot more data for a first time user.

+1  A: 

Do not parse the token, this is bad practise and since Facebook is in the middle of adding new features to the Graph API it is very susceptible to breaking changes. Make an API call to

https://graph.facebook.com/me?access_token=...

And then parse out the id parameter and use that from then on!

BeRecursive
Yes, this is the correct option, ended up sacrificing a little bit of performance for the documented approach. thanks.
Sid

related questions