X API의 답글 숨기기 엔드포인트 비교
코드 예제
답글 숨기기 (v2)
cURL
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| 설명 | Labs v2 | X API v2 |
|---|---|---|
| 호스트 도메인 | https://api.x.com | https://api.x.com |
| 엔드포인트 경로 | /labs/2/tweets/:id/hidden | /2/tweets/:id/hidden |
| 인증 | OAuth 1.0a User context | OAuth 1.0a User context |
| 지원되는 HTTP 메서드 | PUT | PUT |
| 기본 요청 한도 | 15분당 10회 요청(인증된 모든 사용자 간에 공유) | 15분당 50회 요청(각 인증된 사용자 기준) |
| 답글 숨기기 가능 | ✔︎ | ✔︎ |
| 이전에 숨겨진 답글 숨기기 해제 가능 | ✔︎ | ✔︎ |
| 답글을 여러 번 숨기거나 숨기기 해제 가능 | ✔︎ | ✔︎ |
| project와 연결된 developer App의 자격 증명 사용 필요 | ✔ |
curl -X PUT "https://api.x.com/2/tweets/1234567890/hidden" \
-H "Authorization: OAuth ..." \
-H "Content-Type: application/json" \
-d '{"hidden": true}'
# OAuth 1.0a 사용자 컨텍스트 인증이 필요합니다.
import requests
from requests_oauthlib import OAuth1
auth = OAuth1(
"API_KEY", "API_SECRET",
"ACCESS_TOKEN", "ACCESS_TOKEN_SECRET"
)
url = "https://api.x.com/2/tweets/1234567890/hidden"
response = requests.put(url, auth=auth, json={"hidden": True})
print(response.json())
from xdk import Client
from xdk.oauth1_auth import OAuth1
oauth1 = OAuth1(
api_key="YOUR_API_KEY",
api_secret="YOUR_API_SECRET",
access_token="YOUR_ACCESS_TOKEN",
access_token_secret="YOUR_ACCESS_TOKEN_SECRET"
)
client = Client(auth=oauth1)
# 답글 숨기기
response = client.posts.hide_reply("1234567890", hidden=True)
print(f"Hidden: {response.data.hidden}")
import { Client, OAuth1 } from "@xdevplatform/xdk";
const oauth1 = new OAuth1({
apiKey: "YOUR_API_KEY",
apiSecret: "YOUR_API_SECRET",
accessToken: "YOUR_ACCESS_TOKEN",
accessTokenSecret: "YOUR_ACCESS_TOKEN_SECRET",
});
const client = new Client({ oauth1 });
// 답글 숨기기
const response = await client.posts.hideReply("1234567890", { hidden: true });
console.log(`Hidden: ${response.data?.hidden}`);