Every player gets a persistent public player_tag (e.g. "#XK4B9P2R") on register/login — share it to be found. All methods take the player token, never the private API token.
public static FriendListResponse getFriends(Client client, String playerToken) throws IOException
Lists friends plus incoming/outgoing requests — entries carry player_id, player_name, player_tag, is_online, steam_id, relationship.
public static FriendLookupResponse lookupPlayerByTag(Client client, String playerToken, String playerTag) throws IOException
Finds a player by public tag ("#XXXXXXXX" — 8 chars, no vowels/0/1).
public static FriendStatusResponse sendFriendRequest(Client client, String playerToken, int playerId) throws IOException
public static FriendStatusResponse sendFriendRequestByTag(Client client, String playerToken, String playerTag) throws IOException
Sends a friend request — auto-accepts when the target already requested you.
public static FriendStatusResponse acceptFriendRequest(Client client, String playerToken, int playerId) throws IOException
public static FriendStatusResponse declineFriendRequest(Client client, String playerToken, int playerId) throws IOException
public static FriendStatusResponse removeFriend(Client client, String playerToken, int playerId) throws IOException
Accept or decline an incoming request; removeFriend also cancels an outgoing one.
public static SteamFriendsLookupResponse lookupSteamFriends(Client client, String playerToken, List<String> steamIds) throws IOException
Maps SteamID64s to registered players — the Steam friend import list.
public static FriendInviteResponse inviteFriend(Client client, String playerToken, int playerId) throws IOException
public static FriendInvitesResponse getInvites(Client client, String playerToken) throws IOException
Invites a friend into your current lobby or room (kind: "matchmaking"/"room"), and lists pending invites received.
public static FriendInviteAcceptResponse acceptInvite(Client client, String playerToken, String inviteId, Object playerData) throws IOException
public static FriendInviteAcceptResponse acceptInvite(Client client, String playerToken, String inviteId) throws IOException
public static FriendInviteAcceptResponse declineInvite(Client client, String playerToken, String inviteId) throws IOException
Accepting joins the lobby/room directly — the invite token bypasses password and host approval. Room invites return room_id.