メインコンテンツへスキップ
リスト操作用クライアント このクライアントは、X API のリスト関連エンドポイントとやり取りするためのメソッドを提供します。認証、リクエストの整形、レスポンスの解析など、リストに関するすべての操作を処理します。

コンストラクタ

コンストラクター

new ListsClient(client): ListsClient 新しい ListsClient インスタンスを作成します

パラメータ

名前説明
clientClientX API のメインクライアントインスタンス

戻り値

ListsClient

定義箇所

lists/client.ts:188

メソッド

getFollowers

getFollowers(id, options?): Promise<Get2ListsIdFollowersResponse> リストのフォロワーを取得 指定したIDのリストをフォローしているユーザーの一覧を取得します。

パラメータ

名前説明
idstringリストのID。
optionsGetFollowersOptions-

返り値

Promise<Get2ListsIdFollowersResponse> API レスポンスで解決される Promise

定義箇所

lists/client.ts:205

getMembers

getMembers(id, options?): Promise<Get2ListsIdMembersResponse> リストのメンバーを取得 指定したIDの特定のリストに所属するユーザーの一覧を取得します。

パラメータ

名前説明
idstringリストのid。
optionsGetMembersOptions-

戻り値

Promise<Get2ListsIdMembersResponse> API レスポンスを返す Promise

定義済み

lists/client.ts:279

addMember

addMember(id, options?): Promise<ListMutateResponse> リストにメンバーを追加 指定したIDのリストにユーザーを追加します。

パラメータ

名前説明
idstringメンバーを追加する対象のListのID。
optionsAddMemberOptions-

戻り値

Promise<ListMutateResponse> API レスポンスを返す Promise

定義場所

lists/client.ts:353

removeMemberByUserId

removeMemberByUserId(id, userId): Promise<ListMutateResponse> リストのメンバーを削除 指定したIDのリストから、指定したユーザーIDのユーザーを削除します。

パラメータ

名前説明
idstringメンバーを削除する対象のListのid。
userIdstringListから削除されるユーザーのid。

戻り値

Promise<ListMutateResponse> API レスポンスで解決される Promise

定義場所

lists/client.ts:405

getPosts

getPosts(id, options?): Promise<Get2ListsIdTweetsResponse> リストのPostを取得 指定したIDのListに関連付けられたPostの一覧を取得します。

パラメータ

名前説明
idstringList の ID。
optionsGetPostsOptions-

戻り値

Promise<Get2ListsIdTweetsResponse> API レスポンスで解決される Promise

定義箇所

lists/client.ts:448

getById

getById(id, options?): Promise<Get2ListsIdResponse> ID でリストを取得 指定した ID のリスト詳細を取得します。

パラメータ

名前説明
idstringリストの id。
optionsGetByIdOptions-

戻り値

Promise<Get2ListsIdResponse> API レスポンスで解決される Promise

定義場所

lists/client.ts:540

update

update(id, options?): Promise<ListUpdateResponse> リストの更新 認証済みユーザーが所有する特定のリストの詳細を、IDを指定して更新します。

パラメータ

名前説明
idstring変更するリストのid。
optionsUpdateOptions-

戻り値

Promise<ListUpdateResponse> APIレスポンスで解決される Promise

定義元

lists/client.ts:602

delete

delete(id): Promise<ListDeleteResponse> リストの削除 認証ユーザーが所有する特定のリストを、IDを指定して削除します。

パラメータ

名前説明
idstring削除するリストのid。

返値

Promise<ListDeleteResponse> API レスポンスに解決される Promise

定義箇所

lists/client.ts:650

create

create(options?): Promise<ListCreateResponse> リストを作成 認証済みユーザーの新しいリストを作成します。

パラメータ

名前
optionsCreateOptions

戻り値

Promise<ListCreateResponse> API レスポンスで解決される Promise

定義元

lists/client.ts:684