Skip to content
Twexapi
English
Esc
navigateopen⌘Jpreview

Get DM Media (XChat v3)

Fetch one XChat media attachment and return a playable URL. Use conversation_id, media_hash_key, and optional key_version from /v3/twitter/dm-history attachments.

POST/v3/twitter/dm-media
Authorization
AuthorizationBearer token · headerrequired
Global API Bearer Token for TwexAPI. Included as: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Request Body
requiredapplication/json
conversation_idstringrequired
Conversation id from /v3/twitter/dm-history
media_hash_keystringrequired
Attachment media_hash_key from dm-history
key_versionstring | any
Optional message key_version from dm-history (recommended).
Show properties
Any of:
string
string
any
any
type_namestring | any
Optional IMAGE/VIDEO/GIF hint
Show properties
Any of:
string
string
any
any
filenamestring | any
Optional filename hint
Show properties
Any of:
string
string
any
any
pinstring | any
Identity PIN (default 1234).
default: "1234"
Show properties
Any of:
string
string
any
any
cookiestringrequired
The user's own authorized Twitter session credentials or auth_token (BYOC — Bring Your Own Cookie). Stateless proxy execution with zero credential retention. See [Authentication Security](/authentication#write-operations--byoc-bring-your-own-cookie) and [How to get Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
proxystring | any
Optional HTTP proxy. Example: http://username:password@ip:port
Show properties
Any of:
string
string
any
any
Responses
200Playable media URL and metadata.
codeintegerrequired
Response code
msgstringrequired
Response message
dataGetDmMediaV3Data | any
Media info
Show properties
Any of:
GetDmMediaV3Data
urlstringrequired
Playable media URL
pathstringrequired
Media path on this API
content_typestringrequired
MIME type
filenamestring | any
Suggested filename
Show properties
Any of:
string
string
any
any
byte_lengthintegerrequired
File size in bytes
cachedbooleanrequired
Whether the media was already available
any
any
422Validation Error
detailValidationError[]
Show properties
Array of ValidationError
locstring | integer[]required
Show properties
Array of string | integer
Any of:
string
string
integer
integer
msgstringrequired
typestringrequired
inputany
ctxobject
Interactive ConsolePOST
Interactive Console / Try APIPOST
Live Console
🌐Target Server:https://api.twexapi.io
● Production Ready
✍️
Write Operation Credentials Guide (TwexAPI Key + Twitter Cookie)

1. TwexAPI Platform Key (Bearer Token): Enter under "API Authorization" below for request billing & authentication.

2. Twitter Account Cookie: For write operations (tweet, like, follow, etc.), provide the target Twitter account's Cookie (e.g. auth_token=...; ct0=...) in the cookie field of Request Body below.

🔑API Authorization
📝Request Bodyapplication/json
📡
No Response Yet

Configure parameters in the Request tab and click Send Request below.

Request
curl -X POST "https://api.twexapi.io/v3/twitter/dm-media" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "conversation_id": "1928096185664843776:1989842918455291904",
  "media_hash_key": "blRIlZCVIO",
  "key_version": "3",
  "type_name": "VIDEO",
  "filename": "clip.mp4",
  "pin": "1234",
  "cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
  "proxy": "http://username:password@ip:port"
}'
Response
{
  "code": 200,
  "msg": "success",
  "data": {
    "url": "string",
    "path": "string",
    "content_type": "video/mp4",
    "filename": "string",
    "byte_length": 0,
    "cached": true
  }
}