Friendships

Send friend request

POST /api/friends/request
FieldTypeDescription
usernamestringUsername of the user to add
const request = await client.sendFriendRequest('bob')
request = client.send_friend_request("bob")

Accept friend request

POST /api/friends/:id/accept
const friendship = await client.acceptFriendRequest('request-id')
friendship = client.accept_friend_request("request-id")

Reject friend request

POST /api/friends/:id/reject
const result = await client.rejectFriendRequest('request-id')
result = client.reject_friend_request("request-id")

Remove friend

DELETE /api/friends/:id
await client.removeFriend('friendship-id')
client.remove_friend("friendship-id")

List friends

GET /api/friends
const friends = await client.listFriends()
friends = client.list_friends()

List pending friend requests

GET /api/friends/pending

Returns friend requests received by the current user that haven't been accepted/rejected.

const pending = await client.listPendingFriendRequests()
pending = client.list_pending_friend_requests()

List sent friend requests

GET /api/friends/sent
const sent = await client.listSentFriendRequests()
sent = client.list_sent_friend_requests()