DM Endpoints

Get DM History (XChat v3)

Get DM history via XChat encrypted chat API. Use count for page size (10–200). Set all=true to follow has_more and return every page. Or paginate manually: when has_more is true, pass the oldest message's sequence_id as before.

post/v3/twitter/dm-history

Request

  • Base URL: https://api.twexapi.io
  • URL: https://api.twexapi.io/v3/twitter/dm-history
  • Auth: HTTP bearer

Request body

recipientstring required

User id, @handle, conversationId a:b, or group g....

pinstring nullable

Identity PIN (default 1234).

countinteger nullable

Max events per page (10–200, default 50).

allboolean nullable

Follow has_more and return every page.

beforestring nullable

Oldest sequenceId for paging. Pass the previous page's oldest message sequence_id.

cookiestring required

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 and How to get Cookie.

proxystring nullable

Optional HTTP proxy. Example: http://username:password@ip:port

Example request

{
  "recipient": "1928096185664843776:1989842918455291904",
  "pin": "1234",
  "count": 50,
  "before": "2076684837654876160",
  "cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
  "proxy": "http://username:password@ip:port"
}

Response

Conversation messages with pagination info.

codeinteger required

Response code

msgstring required

Response message

Example response

{
  "code": 200,
  "msg": "success",
  "data": {
    "conversation_id": "1928096185664843776:1989842918455291904",
    "has_more": true,
    "messages": [
      {
        "id": "1234567890123456789",
        "text": "Hello, how are you?",
        "time": "2024-01-01T12:00:00Z",
        "attachment": {
          "type": "image",
          "url": "https://example.com/image.jpg"
        },
        "attachments": [
          {
            "attachment_id": "cda5ccdd-af53-48a3-bdd1-5039a73aea25",
            "conversation_id": "1928096185664843776:1989842918455291904",
            "filename": "image.jpg",
            "filesize_bytes": 421299,
            "height": 1448,
            "key_version": "3",
            "media_hash_key": "blRIlZCVIO",
            "type": "image",
            "type_name": "IMAGE",
            "width": 1086
          }
        ],
        "sequence_id": "2076661179334979585",
        "sender_id": "1234567890123456789",
        "recipient_id": "1234567890123456789"
      }
    ]
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.