मुख्य सामग्री पर जाएं
POST
/
2
/
dm_conversations
/
with
/
{participant_id}
/
messages
प्रतिभागी id द्वारा DM संदेश बनाएँ
curl --request POST \
  --url https://api.x.com/2/dm_conversations/with/{participant_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.

पथ पैरामीटर

participant_id
string
आवश्यक

उस प्राप्तकर्ता उपयोगकर्ता की id जिसे DM प्राप्त होगा। इस उपयोगकर्ता का विशिष्ट पहचानकर्ता। इसे स्ट्रिंग के रूप में लौटाया जाता है, ताकि उन भाषाओं और टूल्स से जुड़ी जटिलताओं से बचा जा सके जो बड़े पूर्णांकों को संभाल नहीं सकते।

Pattern: ^[0-9]{1,19}$
उदाहरण:

"2244994945"

बॉडी

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 ऑब्जेक्ट।