メインコンテンツへスキップ
POST
/
2
/
dm_conversations
/
{dm_conversation_id}
/
messages
会話の id を指定して DM メッセージを作成する
curl --request POST \
  --url https://api.x.com/2/dm_conversations/{dm_conversation_id}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>",
  "attachments": [
    {
      "media_id": "1146654567674912769"
    }
  ]
}
'
{
  "data": {
    "dm_conversation_id": "123123123-456456456",
    "dm_event_id": "1146654567674912769"
  },
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

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.

承認

Authorization
string
header
必須

The access token received from the authorization server in the OAuth 2.0 flow.

パスパラメータ

dm_conversation_id
string
必須

DM 会話の ID。

ボディ

application/json
text
string
必須

メッセージの本文。

Minimum string length: 1
attachments
object[]

DM イベントに付随する情報。

レスポンス

リクエストは成功しました。

data
object
errors
object[]
Minimum array length: 1

IETF RFC 7807 (https://tools.ietf.org/html/rfc7807) で定義された HTTP Problem Details オブジェクト。