cURL
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" } ] }
Get DM history
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Parameters for getting DM history
A list of message objects.
Response for getting DM history