Interface: FriendshipApi
The follow graph: relationship actions and the follower/following lists.
Methods
addCloseFriend()
addCloseFriend(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Adds a user to the account's close friends.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
approve()
approve(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Approves a follow request.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
block()
block(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Blocks a user.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
deny()
deny(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Denies a follow request.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
follow()
follow(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Follows a user, or sends a request to a private one.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
followers()
followers(pk, options?): Promise<Page<{
[key: string]: unknown;
biography?: string;
external_url?: string | null;
follower_count?: number | null;
following_count?: number | null;
full_name?: string;
is_private?: boolean;
is_verified?: boolean;
media_count?: number | null;
pk?: string;
profile_pic_url?: string | null;
username?: string;
}>>;One page of a user's followers.
Parameters
| Parameter | Type |
|---|---|
pk | string |
options? | FollowListOptions |
Returns
Promise<Page<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>>
following()
following(pk, options?): Promise<Page<{
[key: string]: unknown;
biography?: string;
external_url?: string | null;
follower_count?: number | null;
following_count?: number | null;
full_name?: string;
is_private?: boolean;
is_verified?: boolean;
media_count?: number | null;
pk?: string;
profile_pic_url?: string | null;
username?: string;
}>>;One page of the accounts a user follows.
Parameters
| Parameter | Type |
|---|---|
pk | string |
options? | FollowListOptions |
Returns
Promise<Page<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>>
mute()
mute(pk, options?): Promise<void>;Mutes a user's posts, stories or both, without unfollowing.
Parameters
| Parameter | Type |
|---|---|
pk | string |
options? | MuteOptions |
Returns
Promise<void>
paginateFollowers()
paginateFollowers(pk): AsyncGenerator<{
[key: string]: unknown;
biography?: string;
external_url?: string | null;
follower_count?: number | null;
following_count?: number | null;
full_name?: string;
is_private?: boolean;
is_verified?: boolean;
media_count?: number | null;
pk?: string;
profile_pic_url?: string | null;
username?: string;
}>;Walks a user's followers, one at a time across pages.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
AsyncGenerator<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>
paginateFollowing()
paginateFollowing(pk): AsyncGenerator<{
[key: string]: unknown;
biography?: string;
external_url?: string | null;
follower_count?: number | null;
following_count?: number | null;
full_name?: string;
is_private?: boolean;
is_verified?: boolean;
media_count?: number | null;
pk?: string;
profile_pic_url?: string | null;
username?: string;
}>;Walks the accounts a user follows, one at a time across pages.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
AsyncGenerator<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>
paginatePending()
paginatePending(): AsyncGenerator<{
[key: string]: unknown;
biography?: string;
external_url?: string | null;
follower_count?: number | null;
following_count?: number | null;
full_name?: string;
is_private?: boolean;
is_verified?: boolean;
media_count?: number | null;
pk?: string;
profile_pic_url?: string | null;
username?: string;
}>;Walks the follow requests waiting for approval.
Returns
AsyncGenerator<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>
pending()
pending(options?): Promise<Page<{
[key: string]: unknown;
biography?: string;
external_url?: string | null;
follower_count?: number | null;
following_count?: number | null;
full_name?: string;
is_private?: boolean;
is_verified?: boolean;
media_count?: number | null;
pk?: string;
profile_pic_url?: string | null;
username?: string;
}>>;One page of the follow requests waiting for approval.
Parameters
| Parameter | Type |
|---|---|
options? | FollowListOptions |
Returns
Promise<Page<{ [key: string]: unknown; biography?: string; external_url?: string | null; follower_count?: number | null; following_count?: number | null; full_name?: string; is_private?: boolean; is_verified?: boolean; media_count?: number | null; pk?: string; profile_pic_url?: string | null; username?: string; }>>
removeCloseFriend()
removeCloseFriend(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Removes a user from the account's close friends.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
removeFollower()
removeFollower(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Removes a user from the account's followers.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
status()
status(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;How the account relates to a user: following, followed by, blocking, and so on.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
unblock()
unblock(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Unblocks a user.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
unfollow()
unfollow(pk): Promise<{
[key: string]: unknown;
blocking?: boolean;
followed_by?: boolean;
following?: boolean;
incoming_request?: boolean;
is_bestie?: boolean;
is_muting_reel?: boolean;
is_private?: boolean;
is_restricted?: boolean;
muting?: boolean;
outgoing_request?: boolean;
}>;Unfollows a user, or withdraws a pending request.
Parameters
| Parameter | Type |
|---|---|
pk | string |
Returns
Promise<{ [key: string]: unknown; blocking?: boolean; followed_by?: boolean; following?: boolean; incoming_request?: boolean; is_bestie?: boolean; is_muting_reel?: boolean; is_private?: boolean; is_restricted?: boolean; muting?: boolean; outgoing_request?: boolean; }>
unmute()
unmute(pk, options?): Promise<void>;Undoes a mute.
Parameters
| Parameter | Type |
|---|---|
pk | string |
options? | MuteOptions |
Returns
Promise<void>