C++ SDK — Friends

Friends

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.

Friends::getFriends
static FriendListResponse getFriends(Client& client, const std::string& playerToken)

Lists friends plus incoming/outgoing requests — entries carry player_id, player_name, player_tag, is_online, steam_id, relationship.

Friends::lookupPlayerByTag
static FriendLookupResponse lookupPlayerByTag(Client& client, const std::string& playerToken, const std::string& playerTag)

Finds a player by public tag ("#XXXXXXXX" — 8 chars, no vowels/0/1).

Friends::sendFriendRequest / ByTag
static FriendStatusResponse sendFriendRequest(Client& client, const std::string& playerToken, int playerId)
static FriendStatusResponse sendFriendRequestByTag(Client& client, const std::string& playerToken, const std::string& playerTag)

Sends a friend request — auto-accepts when the target already requested you.

Friends::accept / decline / remove
static FriendStatusResponse acceptFriendRequest(Client& client, const std::string& playerToken, int playerId)
static FriendStatusResponse declineFriendRequest(Client& client, const std::string& playerToken, int playerId)
static FriendStatusResponse removeFriend(Client& client, const std::string& playerToken, int playerId)

Accept or decline an incoming request; removeFriend also cancels an outgoing one.

Friends::lookupSteamFriends
static SteamFriendsLookupResponse lookupSteamFriends(Client& client, const std::string& playerToken, const std::vector<std::string>& steamIds)

Maps SteamID64s to registered players (max 100) — the Steam friend import list.

Friends::inviteFriend / getInvites
static FriendInviteResponse inviteFriend(Client& client, const std::string& playerToken, int playerId)
static FriendInvitesResponse getInvites(Client& client, const std::string& playerToken)

Invites a friend into your current lobby or room (kind: "matchmaking"/"room"), and lists pending invites received.

Friends::acceptInvite / declineInvite
template<typename T = nlohmann::json>
static FriendInviteAcceptResponse acceptInvite(Client& client, const std::string& playerToken, const std::string& inviteId, const std::optional<T>& playerData = std::nullopt)
static FriendInviteAcceptResponse declineInvite(Client& client, const std::string& playerToken, const std::string& inviteId)

Accepting joins the lobby/room directly — the invite token bypasses password and host approval. Room invites return room_id.