メインコンテンツへスキップ
アカウントアクティビティ用クライアント このクライアントは、X API のアカウントアクティビティ関連エンドポイントとやり取りするための各種メソッドを提供します。認証、リクエストのフォーマット、レスポンスのパースを処理し、アカウントアクティビティに関するすべての操作をカバーします。

コンストラクタ

constructor

new AccountActivityClient(client): AccountActivityClient アカウントアクティビティクライアントの新しいインスタンスを作成します

パラメータ

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

返却値

AccountActivityClient

定義場所

account_activity/client.ts:54

メソッド

getSubscriptions

getSubscriptions(webhookId): Promise<SubscriptionsListGetResponse> サブスクリプションを取得 指定した webhook に対して現在有効なサブスクリプションの一覧を取得します。

パラメーター

名前説明
webhookIdstringサブスクリプションを取得する対象の webhook の id。

戻り値

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

定義元

account_activity/client.ts:71

createReplayJob

createReplayJob(webhookId, fromDate, toDate): Promise<ReplayJobCreateResponse> リプレイジョブを作成 指定した webhook に関連付けられたすべてのサブスクリプションについて、過去5日分までのアクティビティを取得するリプレイジョブを作成します。

パラメータ

名前説明
webhookIdstringWebhook 設定の一意の識別子。
fromDatestringイベントの提供を開始する最古の UTC タイムスタンプ(含む)。形式は yyyymmddhhmm
toDatestringイベントの提供を終了する最新の UTC タイムスタンプ(含まない)。形式は yyyymmddhhmm

戻り値

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

定義場所

account_activity/client.ts:118

validateSubscription

validateSubscription(webhookId): Promise<SubscriptionsGetResponse> サブスクリプションを検証 指定した webhook に対するユーザーの Account Activity サブスクリプションをチェックします。

パラメーター

名前説明
webhookIdstringサブスクリプションの照合対象となる webhook のID。

戻り値

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

定義箇所

account_activity/client.ts:169

createSubscription

createSubscription(webhookId, options?): Promise<SubscriptionsCreateResponse> サブスクリプションの作成 ユーザーと指定した webhook に対して、Account Activity のサブスクリプションを作成します。

パラメータ

名前説明
webhookIdstring確認対象のサブスクリプションに対して照合する webhook の id。
optionsCreateSubscriptionOptions-

戻り値

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

定義元

account_activity/client.ts:209

deleteSubscription

deleteSubscription(webhookId, userId): Promise<SubscriptionsDeleteResponse> サブスクリプションを削除 指定された webhook とユーザー ID に対する Account Activity のサブスクリプションを削除します。

パラメータ

名前説明
webhookIdstring照合対象のサブスクリプションに対する webhook の id。
userIdstring解除対象のユーザーの id。

戻り値

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

定義場所

account_activity/client.ts:261

getSubscriptionCount

getSubscriptionCount(): Promise<SubscriptionsCountGetResponse> サブスクリプション数の取得 現在有効な Account Activity サブスクリプションの件数を取得します。

戻り値

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

定義元

account_activity/client.ts:301