How can I get a list of all friends of current signed-in user ?

1 view
Skip to first unread message

Hung.Nguyen

unread,
Dec 13, 2009, 5:48:45 PM12/13/09
to Google Friend Connect Developer Forum
I've already successfully integrated GFC into my site. Follow the
documentation:
To get all profile details of signed-in user, I use the following REST
call:
http://www.google.com/friendconnect/api/people/@viewer/@self?fcauth=<fcauth_cookie_value>
and it works well.
But to get a list of all friends of signed-in user, I use this REST
call:
http://www.google.com/friendconnect/api/people/@viewer/@friends?fcauth=<fcauth_cookie_value>
it return no friends. The response XML like below:

<response>
<startIndex>0</startIndex>
<totalResults>0</totalResults>
<isFiltered>true</isFiltered>
<isSorted>true</isSorted>
<isUpdatedSince>true</isUpdatedSince>
</response>

What am I doing wrong ? Is there anyone please help me ?
Thanks in advanced

Bob Aman

unread,
Dec 14, 2009, 4:49:11 PM12/14/09
to google-friend-co...@googlegroups.com
> But to get a list of all friends of signed-in user, I use this REST
> call:
>        http://www.google.com/friendconnect/api/people/@viewer/@friends?fcauth=<fcauth_cookie_value>
> it return no friends. The response XML like below:

Does this person have any friends? If the user hasn't marked anyone
as their friend yet, then you'd see this response from the server.

-Bob

Hung.Nguyen

unread,
Dec 14, 2009, 6:26:10 PM12/14/09
to Google Friend Connect Developer Forum
Thank Bob for answering my problem so much.
But what is the concept "friend" in the Google OpenSocial or Google
Friend Connect ? When I click the link Invite friend, the Google
Invite friend popup will be showed and it already contains some
friends of mine by default for choosing, does that exactly mean I
have already had some friends ? I also use GTalk and and I have some
friend on GTalk, does that exactly mean I have already had some
friends ?
Now I'm building the application using the .NET OpenSocial client
library.
Thanks in advanced.

Bob Aman

unread,
Dec 14, 2009, 7:13:08 PM12/14/09
to google-friend-co...@googlegroups.com
> Thank Bob for answering my problem so much.
> But what is the concept "friend" in the Google OpenSocial or Google
> Friend Connect ? When I click the link Invite friend, the Google
> Invite friend popup will be showed and it already contains some
> friends of mine  by default for choosing, does that exactly mean I
> have already had some friends ? I also use GTalk and and I have some
> friend on GTalk, does that exactly mean I have already had some
> friends ?
> Now I'm building the application using the .NET OpenSocial client
> library.
> Thanks in advanced.

A "friend" in GFC is an explicit relationship between you and the
other person that GFC knows about. When you use the invite link, it
can potentially show stuff from other networks. However, the API only
returns information about users that have GFC IDs.

If you go to the members gadget for the site, and you have friends on
the site, you should see two sections: A list of all the members of
the site and a list of your friends. This second section contains the
list of friends that the API would return. If the second section
isn't present, the API would report zero friends.

-Bob

baroon bikas

unread,
Dec 22, 2009, 12:02:23 AM12/22/09
to Google Friend Connect Developer Forum
Hello Bob,

Is there way to get all those member of the GFC site ( friends of
@owner ) that are currently not the friends of @viewer. The REST API
enables us to get all the member connected/joined to @owner and get
all the friends of the @viewer, and not the list of members that are
not the friends of @viewer, but the friends of @owner.

Well I know the turn around, but that seems to be have big latency, in
the sense if I go on differencing the list of the friends of @owner
and the list of friends of @viewer. could there be a direct way for
the same. I just want the member to give the list of all those
connected users that they can make new friends.

Bob Aman

unread,
Dec 22, 2009, 3:05:35 PM12/22/09
to google-friend-co...@googlegroups.com
> Well I know the turn around, but that seems to be have big latency, in
> the sense if I go on differencing the list of the friends of @owner
> and the list of friends of @viewer. could there be a direct way for
> the same. I just want the  member to give the list of all those
> connected users that they can make new friends.

Unfortunately, that's the only way to do it: calculate the exclusion
of the set. For small sites, this shouldn't be too bad, but it's not
really something you want to do with a large site.

-Bob

Reply all
Reply to author
Forward
0 new messages