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

コンストラクタ

constructor

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

パラメーター

名前説明
clientClientX API のメイン Client インスタンス

戻り値

WebhooksClient

定義元

webhooks/client.ts:162

メソッド

createStreamLink(webhookId, options): Promise<Response> ストリームリンクを作成する
指定した webhook に FilteredStream イベントを配信するためのリンクを作成します。

パラメーター

NameTypeDescription
webhookIdstringFilteredStream ルールセットに関連付ける webhook の ID。
optionsCreateStreamLinkOptions & { requestOptions: { raw: true } }-

戻り値

Promise<Response> API レスポンスを解決する Promise、または requestOptions.raw が true の場合は生の Response

定義場所

webhooks/client.ts:207 createStreamLink(webhookId, options?): Promise<WebhookLinksCreateResponse>

パラメーター

名前
webhookIdstring
options?CreateStreamLinkOptions

戻り値

Promise<WebhookLinksCreateResponse>

定義元

webhooks/client.ts:220
deleteStreamLink(webhookId, options): Promise<Response> ストリームリンクを削除します
FilteredStream イベントと指定した webhook 間のリンクを削除します。

パラメーター

名前説明
webhookIdstringFilteredStream ルールセットに関連付ける webhook の ID。
optionsObject-
options.requestOptionsObject-
options.requestOptions.rawtrue-

Returns

Promise<Response> API レスポンス、または requestOptions.raw が true の場合は生の Response を返す Promise

定義元

webhooks/client.ts:433 deleteStreamLink(webhookId): Promise<WebhookLinksDeleteResponse>

パラメータ

名前
webhookIdstring

戻り値

Promise<WebhookLinksDeleteResponse>

定義元

webhooks/client.ts:446
getStreamLinks(options): Promise<Response> ストリームリンクの取得 フィルタ済みストリームルールセットに関連付けられた webhook リンクのリストを取得します。

パラメーター

名前type
optionsObject
options.requestOptionsObject
options.requestOptions.rawtrue

戻り値

Promise<Response> API レスポンスを返す PromiserequestOptions.rawtrue の場合は生の Response を返します。

定義場所

webhooks/client.ts:527 getStreamLinks(): Promise<WebhookLinksGetResponse>

戻り値

Promise<WebhookLinksGetResponse>

定義元

webhooks/client.ts:536

createWebhookReplayJob

createWebhookReplayJob(options): Promise<Response> Webhook のリプレイジョブを作成します Webhook に対して配信された、または配信が試行されたすべてのイベントについて、過去最大 24 時間分のイベントを取得するリプレイジョブを作成します。

パラメーター

名前type
optionsCreateWebhookReplayJobOptions & { requestOptions: { raw: true } }

戻り値

Promise<Response> API レスポンスで解決される Promise、または requestOptions.raw が true の場合は生の Response

定義場所

webhooks/client.ts:605 createWebhookReplayJob(options?): Promise<ReplayJobCreateResponse>

パラメータ

名前type
options?CreateWebhookReplayJobOptions

戻り値

Promise<ReplayJobCreateResponse>

定義元

webhooks/client.ts:614

validate

validate(webhookId, options): Promise<Response> webhook を検証します。 指定された webhook に対して CRC チェックを実行します。

パラメーター

NameTypeDescription
webhookIdstring検証対象の webhook の ID。
optionsObject-
options.requestOptionsObject-
options.requestOptions.rawtrue-

Returns

Promise<Response> API レスポンスを返す Promise。requestOptions.raw が true の場合は生の Response

定義元

webhooks/client.ts:704 validate(webhookId): Promise<WebhookConfigPutResponse>

パラメータ

名前
webhookIdstring

戻り値

Promise<WebhookConfigPutResponse>

定義箇所

webhooks/client.ts:717

delete

delete(webhookId, options): Promise<Response> webhook を削除します
既存の webhook 設定を削除します。

パラメーター

NameTypeDescription
webhookIdstring削除する webhook の ID。
optionsObject-
options.requestOptionsObject-
options.requestOptions.rawtrue-

Returns

Promise<Response> API レスポンスで解決される PromiserequestOptions.rawtrue の場合は生の Response を返す

定義場所

webhooks/client.ts:808 delete(webhookId): Promise<WebhookConfigDeleteResponse>

パラメータ

名前
webhookIdstring

戻り値

Promise<WebhookConfigDeleteResponse>

定義元

webhooks/client.ts:821

get

get(options): Promise<Response> webhook の取得 クライアント App に関連付けられている webhook 設定のリストを取得します。

パラメーター

名前type
optionsGetOptions & { requestOptions: { raw: true } }

Returns

Promise<Response> API レスポンスを返す Promise。requestOptions.raw が true の場合は生の Response。

定義場所

webhooks/client.ts:908 get(options?): Promise<Get2WebhooksResponse>

パラメータ

名前type
options?GetOptions

戻り値

Promise<Get2WebhooksResponse>

定義場所

webhooks/client.ts:917

create

create(options): Promise<Response> Webhook を作成 新しい webhook 構成を作成します。

パラメータ

名前type
optionsCreateOptions & { requestOptions: { raw: true } }

Returns

Promise<Response> API レスポンスを返す Promise。requestOptions.raw が true の場合は生の Response を返します。

定義場所

webhooks/client.ts:1023 create(options?): Promise<WebhookConfigCreateResponse>

パラメータ

名前type
options?CreateOptions

戻り値

Promise<WebhookConfigCreateResponse>

定義元

webhooks/client.ts:1032