मुख्य सामग्री पर जाएं
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"
    }
  ]
}
'
{
  "errors": [
    {
      "title": "<string>",
      "type": "<string>",
      "detail": "<string>",
      "status": 123
    }
  ]
}

प्राधिकरण

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 Event के attachments।

प्रतिक्रिया

अनुरोध सफल हुआ।

data
object
errors
object[]
Minimum array length: 1

IETF RFC 7807 (https://tools.ietf.org/html/rfc7807) में परिभाषित एक HTTP Problem Details ऑब्जेक्ट।