> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AccountActivityClient

> X API TypeScript SDK の AccountActivityClient クラスのリファレンス。 X API v2 の account activity エンドポイントのメソッド、パラメーター、戻り値の型。

account activity 操作向けのクライアント

このクライアントは X API の account activity エンドポイントと対話するためのメソッドを提供します。認証、リクエストの整形、account activity に関連するすべての操作のレスポンス解析を扱います。

## コンストラクター

### コンストラクター

• **new AccountActivityClient**(`client`): [`AccountActivityClient`](/xdks/typescript/reference/classes/AccountActivityClient)

新しい account activity クライアントインスタンスを作成します

#### パラメーター

| 名前       | 型                                                     | 説明                      |
| :------- | :---------------------------------------------------- | :---------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | メインの X API クライアントインスタンス |

#### 戻り値

[`AccountActivityClient`](/xdks/typescript/reference/classes/AccountActivityClient)

#### 定義場所

[account\_activity/client.ts:70](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L70)

## メソッド

### getSubscriptions

▸ **getSubscriptions**(`webhookId`, `options`): `Promise`\<`Response`>

Get subscriptions
次の一覧を取得します: all active subscriptions for a given webhook.

#### パラメーター

| 名前                           | 型        | 説明                                        |
| :--------------------------- | :------- | :---------------------------------------- |
| `webhookId`                  | `string` | The webhook ID to pull subscriptions for. |
| `options`                    | `Object` | -                                         |
| `options.requestOptions`     | `Object` | -                                         |
| `options.requestOptions.raw` | `true`   | -                                         |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[account\_activity/client.ts:115](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L115)

▸ **getSubscriptions**(`webhookId`): `Promise`\<[`SubscriptionsListGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsListGetResponse)>

#### パラメーター

| 名前          | 型        |
| :---------- | :------- |
| `webhookId` | `string` |

#### 戻り値

`Promise`\<[`SubscriptionsListGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsListGetResponse)>

#### 定義場所

[account\_activity/client.ts:128](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L128)

***

### deleteSubscription

▸ **deleteSubscription**(`webhookId`, `userId`, `options`): `Promise`\<`Response`>

Delete subscription
Deletes an Account Activity subscription for the given webhook and user ID.

#### パラメーター

| 名前                           | 型        | 説明                                            |
| :--------------------------- | :------- | :-------------------------------------------- |
| `webhookId`                  | `string` | The webhook ID to check subscription against. |
| `userId`                     | `string` | User ID to unsubscribe from.                  |
| `options`                    | `Object` | -                                             |
| `options.requestOptions`     | `Object` | -                                             |
| `options.requestOptions.raw` | `true`   | -                                             |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[account\_activity/client.ts:217](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L217)

▸ **deleteSubscription**(`webhookId`, `userId`): `Promise`\<[`SubscriptionsDeleteResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsDeleteResponse)>

#### パラメーター

| 名前          | 型        |
| :---------- | :------- |
| `webhookId` | `string` |
| `userId`    | `string` |

#### 戻り値

`Promise`\<[`SubscriptionsDeleteResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsDeleteResponse)>

#### 定義場所

[account\_activity/client.ts:234](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L234)

***

### validateSubscription

▸ **validateSubscription**(`webhookId`, `options`): `Promise`\<`Response`>

Validate subscription
Checks a user’s Account Activity subscription for a given webhook.

#### パラメーター

| 名前                           | 型        | 説明                                            |
| :--------------------------- | :------- | :-------------------------------------------- |
| `webhookId`                  | `string` | The webhook ID to check subscription against. |
| `options`                    | `Object` | -                                             |
| `options.requestOptions`     | `Object` | -                                             |
| `options.requestOptions.raw` | `true`   | -                                             |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[account\_activity/client.ts:331](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L331)

▸ **validateSubscription**(`webhookId`): `Promise`\<[`SubscriptionsGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsGetResponse)>

#### パラメーター

| 名前          | 型        |
| :---------- | :------- |
| `webhookId` | `string` |

#### 戻り値

`Promise`\<[`SubscriptionsGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsGetResponse)>

#### 定義場所

[account\_activity/client.ts:344](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L344)

***

### createSubscription

▸ **createSubscription**(`webhookId`, `options`): `Promise`\<`Response`>

Create subscription
Creates an Account Activity subscription for the user and the given webhook.

#### パラメーター

| 名前          | 型                                                                         | 説明                                            |
| :---------- | :------------------------------------------------------------------------ | :-------------------------------------------- |
| `webhookId` | `string`                                                                  | The webhook ID to check subscription against. |
| `options`   | `CreateSubscriptionOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } | -                                             |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[account\_activity/client.ts:435](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L435)

▸ **createSubscription**(`webhookId`, `options?`): `Promise`\<[`SubscriptionsCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCreateResponse)>

#### パラメーター

| 名前          | 型                           |
| :---------- | :-------------------------- |
| `webhookId` | `string`                    |
| `options?`  | `CreateSubscriptionOptions` |

#### 戻り値

`Promise`\<[`SubscriptionsCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCreateResponse)>

#### 定義場所

[account\_activity/client.ts:448](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L448)

***

### createReplayJob

▸ **createReplayJob**(`webhookId`, `fromDate`, `toDate`, `options`): `Promise`\<`Response`>

Create replay job
Creates a replay job to retrieve activities from up to the past 5 days for all subscriptions associated with a given webhook.

#### パラメーター

| 名前                           | 型        | 説明                                                                                                            |
| :--------------------------- | :------- | :------------------------------------------------------------------------------------------------------------ |
| `webhookId`                  | `string` | The unique identifier for the webhook configuration.                                                          |
| `fromDate`                   | `string` | The oldest (starting) UTC timestamp (inclusive) from which events will be provided, in `yyyymmddhhmm` format. |
| `toDate`                     | `string` | The latest (ending) UTC timestamp (exclusive) up to which events will be provided, in `yyyymmddhhmm` format.  |
| `options`                    | `Object` | -                                                                                                             |
| `options.requestOptions`     | `Object` | -                                                                                                             |
| `options.requestOptions.raw` | `true`   | -                                                                                                             |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[account\_activity/client.ts:564](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L564)

▸ **createReplayJob**(`webhookId`, `fromDate`, `toDate`): `Promise`\<[`ReplayJobCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.ReplayJobCreateResponse)>

#### パラメーター

| 名前          | 型        |
| :---------- | :------- |
| `webhookId` | `string` |
| `fromDate`  | `string` |
| `toDate`    | `string` |

#### 戻り値

`Promise`\<[`ReplayJobCreateResponse`](/xdks/typescript/reference/interfaces/Schemas.ReplayJobCreateResponse)>

#### 定義場所

[account\_activity/client.ts:585](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L585)

***

### getSubscriptionCount

▸ **getSubscriptionCount**(`options`): `Promise`\<`Response`>

Get subscription count
Retrieves a count of currently active Account Activity subscriptions.

#### パラメーター

| 名前                           | 型        |
| :--------------------------- | :------- |
| `options`                    | `Object` |
| `options.requestOptions`     | `Object` |
| `options.requestOptions.raw` | `true`   |

#### 戻り値

`Promise`\<`Response`>

API レスポンスに解決される Promise。requestOptions.raw が true の場合は生の Response を返します

#### 定義場所

[account\_activity/client.ts:704](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L704)

▸ **getSubscriptionCount**(): `Promise`\<[`SubscriptionsCountGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCountGetResponse)>

#### 戻り値

`Promise`\<[`SubscriptionsCountGetResponse`](/xdks/typescript/reference/interfaces/Schemas.SubscriptionsCountGetResponse)>

#### 定義場所

[account\_activity/client.ts:713](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/account_activity/client.ts#L713)
