Constructors
constructor
• new AccountActivityClient(client): AccountActivityClient
Creates a new account activity client instance
Parameters
| Name | Type | Description |
|---|---|---|
client | Client | The main X API client instance |
Returns
AccountActivityClient
Defined in
account_activity/client.ts:70Methods
getSubscriptions
▸ getSubscriptions(webhookId, options): Promise<Response>
Get subscriptions
Retrieves a list of all active subscriptions for a given webhook.
Parameters
| Name | Type | Description |
|---|---|---|
webhookId | string | The webhook ID to pull subscriptions for. |
options | Object | - |
options.requestOptions | Object | - |
options.requestOptions.raw | true | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
account_activity/client.ts:115 ▸ getSubscriptions(webhookId): Promise<SubscriptionsListGetResponse>
Parameters
| Name | Type |
|---|---|
webhookId | string |
Returns
Promise<SubscriptionsListGetResponse>
Defined in
account_activity/client.ts:128deleteSubscription
▸ deleteSubscription(webhookId, userId, options): Promise<Response>
Delete subscription
Deletes an Account Activity subscription for the given webhook and user ID.
Parameters
| Name | Type | Description |
|---|---|---|
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 | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
account_activity/client.ts:217 ▸ deleteSubscription(webhookId, userId): Promise<SubscriptionsDeleteResponse>
Parameters
| Name | Type |
|---|---|
webhookId | string |
userId | string |
Returns
Promise<SubscriptionsDeleteResponse>
Defined in
account_activity/client.ts:234validateSubscription
▸ validateSubscription(webhookId, options): Promise<Response>
Validate subscription
Checks a user’s Account Activity subscription for a given webhook.
Parameters
| Name | Type | Description |
|---|---|---|
webhookId | string | The webhook ID to check subscription against. |
options | Object | - |
options.requestOptions | Object | - |
options.requestOptions.raw | true | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
account_activity/client.ts:331 ▸ validateSubscription(webhookId): Promise<SubscriptionsGetResponse>
Parameters
| Name | Type |
|---|---|
webhookId | string |
Returns
Promise<SubscriptionsGetResponse>
Defined in
account_activity/client.ts:344createSubscription
▸ createSubscription(webhookId, options): Promise<Response>
Create subscription
Creates an Account Activity subscription for the user and the given webhook.
Parameters
| Name | Type | Description |
|---|---|---|
webhookId | string | The webhook ID to check subscription against. |
options | CreateSubscriptionOptions & { requestOptions: { raw: true } } | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
account_activity/client.ts:435 ▸ createSubscription(webhookId, options?): Promise<SubscriptionsCreateResponse>
Parameters
| Name | Type |
|---|---|
webhookId | string |
options? | CreateSubscriptionOptions |
Returns
Promise<SubscriptionsCreateResponse>
Defined in
account_activity/client.ts:448createReplayJob
▸ 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.
Parameters
| Name | Type | Description |
|---|---|---|
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 | - |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
account_activity/client.ts:564 ▸ createReplayJob(webhookId, fromDate, toDate): Promise<ReplayJobCreateResponse>
Parameters
| Name | Type |
|---|---|
webhookId | string |
fromDate | string |
toDate | string |
Returns
Promise<ReplayJobCreateResponse>
Defined in
account_activity/client.ts:585getSubscriptionCount
▸ getSubscriptionCount(options): Promise<Response>
Get subscription count
Retrieves a count of currently active Account Activity subscriptions.
Parameters
| Name | Type |
|---|---|
options | Object |
options.requestOptions | Object |
options.requestOptions.raw | true |
Returns
Promise<Response>
Promise resolving to the API response, or raw Response if requestOptions.raw is true
Defined in
account_activity/client.ts:704 ▸ getSubscriptionCount():Promise<SubscriptionsCountGetResponse>
Returns
Promise<SubscriptionsCountGetResponse>