메인 콘텐츠로 건너뛰기
POST
/
2
/
tweets
/
search
/
stream
/
rules
스트림 규칙 업데이트
curl --request POST \
  --url https://api.x.com/2/tweets/search/stream/rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "add": [
    {
      "value": "coffee -is:retweet",
      "tag": "Non-retweeted coffee Posts"
    }
  ]
}
'
{
  "meta": {
    "sent": "<string>",
    "next_token": "<string>",
    "result_count": 123,
    "summary": {
      "created": 1,
      "invalid": 1,
      "not_created": 1,
      "valid": 1
    }
  },
  "data": [
    {
      "value": "coffee -is:retweet",
      "id": "120897978112909812",
      "tag": "Non-retweeted coffee Posts"
    }
  ],
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

쿼리 매개변수

dry_run
boolean

Dry Run은 추가 및 삭제 작업 모두에 사용할 수 있으며, 예상되는 결과가 반환되지만 시스템에는 실제로 아무 작업도 수행되지 않습니다(즉, 최종 상태는 요청을 보냈을 때와 항상 동일하게 유지됩니다). 이는 규칙 변경 사항을 검증하는 데 특히 유용합니다.

delete_all
boolean

Delete All은 이 App과 연관된 모든 규칙을 삭제하는 데 사용할 수 있으며, 다른 매개변수 없이 단독으로만 지정해야 합니다. 한 번 삭제된 규칙은 복구할 수 없습니다.

본문

application/json

사용자 지정 스트림 필터링 규칙을 추가하기 위한 요청입니다.

add
object[]
필수

응답

요청이 성공했습니다.

사용자 지정 스트림 필터링 규칙을 수정한 후의 응답입니다.

meta
object
필수
data
object[]

생성된 모든 사용자 지정 스트림 필터링 규칙입니다.

errors
object[]
Minimum array length: 1

IETF RFC 7807(https://tools.ietf.org/html/rfc7807)에 정의된 HTTP Problem Details 객체