Documentation Index
Fetch the complete documentation index at: https://generaltranslation.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
이 가이드는 사용자를 차단하고 차단을 해제하는 방법과, 자신의 차단 목록을 조회하는 방법을 안내합니다.
사전 준비 사항시작하기 전에 다음이 필요합니다:
- 승인된 App이 있는 개발자 계정
- 사용자 액세스 토큰 (OAuth 1.0a 또는 OAuth 2.0 PKCE)
내 사용자 ID 가져오기
차단 목록을 가져오려면 인증된 사용자의 ID가 필요합니다. /2/users/me 엔드포인트에서 가져오거나 토큰에 포함된 ID를 사용할 수 있습니다.
차단 목록 요청하기
curl "https://api.x.com/2/users/123456789/blocking?\
user.fields=username,verified,created_at&\
max_results=100" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
응답 확인하기
{
"data": [
{
"id": "17874544",
"name": "Example User",
"username": "example_user",
"verified": false,
"created_at": "2008-12-04T18:51:57.000Z"
}
],
"meta": {
"result_count": 1,
"next_token": "abc123"
}
}
대상 사용자 식별
차단하려는 계정의 사용자 ID를 확인합니다.
차단 요청 보내기
curl -X POST "https://api.x.com/2/users/123456789/blocking" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"target_user_id": "9876543210"}'
차단 확인
{
"data": {
"blocking": true
}
}
차단 해제 요청 보내기
curl -X DELETE "https://api.x.com/2/users/123456789/blocking/9876543210" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
차단 해제 확인하기
{
"data": {
"blocking": false
}
}