views:

945

answers:

2

What's the difference between accessing user data with the Facebook Graph API (http://graph.facebook.com/btaylor) and using the Graph API to make a FQL query of the same user (https://api.facebook.com/method/fql.query?query=QUERY).

Also, does anyone know which of them the Facebook Developer Toolkit (for ASP.NET) uses?

The reason I ask is because I'm trying to access the logged in user's birthday after they begin a Facebook Connect session on my site, but when I use the toolkit it doesn't return it. However, if I make a manual call to the Graph API for that user object, it does return it. It's possible I might have something wrong with my call from the toolkit. I think I may need to include the session key, but I'm not sure how to get it. Here's the code I'm using:

_connectSession = new ConnectSession(APPLICATION_KEY, SECRET_KEY);
        try
        {
            if (!_connectSession.IsConnected())
            {
                // Not authenticated, proceed as usual.
                statusResponse = "Please sign-in with Facebook.";
            }
            else
            {
                // Authenticated, create API instance
                _facebookAPI = new Api(_connectSession);

                // Load user
                user user = _facebookAPI.Users.GetInfo();

                statusResponse = user.ToString();

                ViewData["fb_user"] = user;

            }
        }
        catch (Exception ex)
        {
            //An error happened, so disconnect session
            _connectSession.Logout();
            statusResponse = "Please sign-in with Facebook.";
        }
A: 

It seems the reason I couldn't get the birthday and other information I was looking for was because I didn't have a complete list of all the extended permissions that could be requested. I finally found the list at http://developers.facebook.com/docs/authentication/permissions (which included user_birthday).

If anyone has info about the FQL vs. Graph Object question, I'd still be interested in that. Though I think they are basically the same thing.

jwynveen
A: 

Looks like that have changed it (yes yet again). Because you are using facebook connect, you can ask for the permissions to give you the needed info for example user's birthday something like:

<fb:login-button perms="email,user_birthday"></fb:login-button>

More Information:

http://developers.facebook.com/docs/guides/web#login

Sarfraz

related questions