getfriends

getfriends — Returns a list of which other LiveJournal users this user lists as their friend.

Mode Description

Returns a list of which other LiveJournal users this user lists as their friend.

Arguments

mode

The protocol request mode: getfriends

user

Username. Leading and trailing whitespace is ignored, as is case.

auth_method

The authentication method used for this request. Default is 'clear', for plain-text authentication. 'cookie' or any of the challenge-response methods are also acceptable.

password

Deprecated. Password in plain-text. For the default authentication method, either this needs to be sent, or hpassword.

hpassword

Deprecated. Alternative to plain-text password. Password as an MD5 hex digest. Not perfectly secure, but defeats the most simple of network sniffers.

auth_challenge

If using challenge-response authentication, this should be the challenge that was generated for your client.

auth_response

If using challenge-response authentication, this should be the response hash you generate based on the challenge's formula.

ver

(Optional) Protocol version supported by the client; assumed to be 0 if not specified. See Chapter 27, Protocol Versions for details on the protocol version.

includefriendof

(Optional) If set to 1, you will also get back the info from the "friendof" mode. Some clients show friends and friendof data in separate tabs/panes. If you're always going to load both, then use this flag (as opposed to a tabbed dialog approach, where the user may not go to the second tab and thus would not need to load the friendof data.) friendof request variables can be used.

includegroups

(Optional) If set to 1, you will also get back the info from the "getfriendgroups" mode. See above for the reason why this would be useful.

includebdays

(Optional) If set to 1, birthdays will be included with the friends results below.

friendlimit

(Optional) If set to a numeric value greater than zero, this mode will only return the number of results indicated. Useful only for building pretty lists for display which might have a button to view the full list nearby.

Return Values

success

OK on success or FAIL when there's an error. When there's an error, see errmsg for the error text. The absence of this variable should also be considered an error.

errmsg

The error message if success was FAIL, not present if OK. If the success variable is not present, this variable most likely will not be either (in the case of a server error), and clients should just report "Server Error, try again later.".

friend_count

The number of records that will be returned. The records returned are named numerically, using a 1-based index. (1 .. friend_count)

friend_n_user

The nth friend's user name.

friend_n_name

The nth friend's full name.

friend_n_birthday

The nth friend's birthday. Note that this is only returned if the user has set their info to visible and if they have set a birthday, otherwise this key is skipped. You will also need to set includebdays to 1 when you make the request in order to receive this field.

friend_n_bg

The background color representing the nth friend.

friend_n_fg

The text color representing the nth friend.

friend_n_groupmask

If the group mask is not "1" (just bit 0 set), then this variable is returned with an 32-bit unsigned integer with a bit 0 always set, and bits 1-30 set for each group this friend is a part of. Bit 31 is reserved.

friend_n_identity_display

If friend_n_type is identity: Pretty display name of an identity user.

friend_n_identity_type

If friend_n_type is identity: Type of identity user - OpenID, TypeKey, etc.

friend_n_identity_value

If friend_n_type is identity: Value for identity, OpenID is a URL.

friend_n_type

The account type of this friend. Possible values are "community" (it does not imply you are a member of the community if the type is community, just that you monitor it), "syndicated" - which means you are monitoring this syndicated feed on your friends list, "news", "shared", or "identity". The account is a normal personal account when this value is not sent.

friend_n_status

The status of this user. If this field is absent, the user has a normal active account. Otherwise the currently possible values for this field are "deleted", "suspended" and "purged".