Obtenir l'historique de DM (XChat v3)
Obtenir l’historique de DM (XChat v3).
Retour à la référence API
/DM Endpoints
POST
/v3/twitter/dm-historyAutorisation API
AuthorizationBearer token · headerrequisJeton Bearer global pour TwexAPI. Inclus sous la forme : Authorization: Bearer <YOUR_TWEXAPI_KEY>.
Corps de la requête
requisapplication/jsonrecipientstringrequisUser id, @handle, conversationId a:b, or group g....
pinstring | anyIdentity PIN (default 1234).
default: "1234"
Afficher les propriétésMasquer les propriétés
Any of:
string
stringany
anycountinteger | anyMax events per page (10–200, default 50).
default: 50
Afficher les propriétésMasquer les propriétés
Any of:
integer
integerany
anyallboolean | anyFollow has_more and return every page.
default: false
Afficher les propriétésMasquer les propriétés
Any of:
boolean
booleanany
anybeforestring | anyOldest sequenceId for paging. Pass the previous page's oldest message sequence_id.
Afficher les propriétésMasquer les propriétés
Any of:
string
stringany
anycookiestringrequisIdentifiants de session ou auth_token autorisés de l'utilisateur (BYOC — Bring Your Own Cookie). Exécution proxy sans état avec zéro rétention d'identifiants. Consultez [Sécurité et Authentification](/fr/authentication#write-operations--byoc-bring-your-own-cookie) et [Comment obtenir un Cookie](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie).
proxystring | anyOptional HTTP proxy. Example: http://username:password@ip:port
Afficher les propriétésMasquer les propriétés
Any of:
string
stringany
anyRéponses
200Conversation messages with pagination info.
codeintegerrequisCode d'état HTTP (200 indique le succès)
msgstringrequisMessage de réponse (ex. 'success')
dataDmHistoryV3Data | anyDonnées principales renvoyées par l'API
Afficher les propriétésMasquer les propriétés
Any of:
DmHistoryV3Data
conversation_idstringrequisConversation id
has_morebooleanrequisWhether older messages are available
messagesMessageModel[]requisList of message objects
Afficher les propriétésMasquer les propriétés
Array of
MessageModelidstringrequisMessage ID
textstringrequisTexte du message
timestringrequisMessage time
attachmentobject | anyMessage attachment
Afficher les propriétésMasquer les propriétés
Any of:
object
objectany
anyattachmentsobject[] | anyXChat media attachments (v3).
Afficher les propriétésMasquer les propriétés
Any of:
object[]
Array of
objectobjectany
anysequence_idstring | anyXChat sequence id. Use the oldest message's sequence_id as before for pagination.
Afficher les propriétésMasquer les propriétés
Any of:
string
stringany
anysender_idstring | anySender ID
Afficher les propriétésMasquer les propriétés
Any of:
string
stringany
anyrecipient_idstring | anyID du destinataire du message direct
Afficher les propriétésMasquer les propriétés
Any of:
string
stringany
anyany
any422Erreur de validation des paramètres
detailValidationError[]Afficher les propriétésMasquer les propriétés
Array of
ValidationErrorlocstring | integer[]requisAfficher les propriétésMasquer les propriétés
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequisMessage de réponse (ex. 'success')
typestringrequisinputanyctxobject⚡Console interactivePOST
⚡Console interactive / Tester l'APIPOSTLive Console
🌐Serveur cible :
https://api.twexapi.io● Prêt pour la production
✍️
Guide d'identification d'écriture (Clé TwexAPI + Cookie Twitter)
1. Clé TwexAPI (Bearer Token) : À renseigner sous "Autorisation API" ci-dessous pour la facturation et l'authentification.
2. Cookie Twitter : Pour les opérations d'écriture (tweet, like, etc.), renseignez le Cookie Twitter (ex : auth_token=...; ct0=...) dans le champ cookie ci-dessous.
🔑Autorisation API
📝Corps de la requêteapplication/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
Requête
curl -X POST "https://api.twexapi.io/v3/twitter/dm-history" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"recipient": "1928096185664843776:1989842918455291904",
"pin": "1234",
"count": 50,
"all": false,
"before": "2076684837654876160",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
}'const response = await fetch("https://api.twexapi.io/v3/twitter/dm-history", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"recipient": "1928096185664843776:1989842918455291904",
"pin": "1234",
"count": 50,
"all": false,
"before": "2076684837654876160",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
})
});import requests
response = requests.post(
"https://api.twexapi.io/v3/twitter/dm-history",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"recipient": "1928096185664843776:1989842918455291904",
"pin": "1234",
"count": 50,
"all": False,
"before": "2076684837654876160",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
},
)Réponse
{
"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"
}
]
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}