POST
/
twitter
/
dm_history
curl --request POST \
  --url https://api.twitterxapi.com/twitter/dm_history \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "username": "myusername",
  "cookie": "auth_token=abc123..."
}'
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "attachment": {
        "type": "image",
        "url": "https://example.com/image.jpg"
      },
      "id": "1234567890123456789",
      "text": "Hello, how are you?",
      "time": "2024-01-01T12:00:00Z"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Parameters for getting DM history

Response

200
application/json

A list of message objects.

Response for getting DM history