リプレイジョブを作成
curl --request POST \
--url https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2025-04-24T20:57:15.242Z",
"job_id": "1915510368169844736"
}{
"code": 123,
"message": "<string>"
}アカウントアクティビティ
リプレイジョブを作成
指定した webhook に関連付けられているすべてのサブスクリプションについて、最大過去 5 日分のアクティビティを取得するリプレイジョブを作成します。
POST
/
2
/
account_activity
/
replay
/
webhooks
/
{webhook_id}
/
subscriptions
/
all
リプレイジョブを作成
curl --request POST \
--url https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.x.com/2/account_activity/replay/webhooks/{webhook_id}/subscriptions/all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2025-04-24T20:57:15.242Z",
"job_id": "1915510368169844736"
}{
"code": 123,
"message": "<string>"
}承認
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
パスパラメータ
webhook 設定の一意の識別子。 この Webhook 構成の一意の識別子。
Pattern:
^[0-9]{1,19}$例:
"1146654567674912769"
クエリパラメータ
イベントが配信される最も古い(開始)UTC タイムスタンプ(含む)。yyyymmddhhmm 形式で指定します。
Pattern:
^\d{12}$例:
"202504242000"
イベントが配信される最新の(終了)UTC タイムスタンプ(含まない)。yyyymmddhhmm 形式で指定します。
Pattern:
^\d{12}$例:
"202504242200"
⌘I