O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving a User’s Pending Friend Requests

Problem

I need to retrieve all of the pending friend requests for a specific user using FQL.

Solution

This query will return an empty set if there are no pending requests:

SELECT uid_from FROM friend_request WHERE uid_to = $uid;

Discussion

You can run this query only for the current loggedinuser or you’ll get an “Error 604, Message: Can only lookup friend requests for logged in user” (see 600 Errors for more information).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required