DM Gönder (XChat v3)
DM Gönder (XChat v3).
API Belgelerine Dön
/DM Endpoints
POST
/v3/twitter/send-dmAPI Yetkilendirmesi
AuthorizationBearer token · headerzorunluTwexAPI genel Bearer Token kimlik bilgisi. İstek başlığı: Authorization: Bearer <YOUR_TWEXAPI_KEY>.
İstek Gövdesi
zorunluapplication/jsonrecipientstringzorunluUser id, @handle, or a group id (g...) for an existing group.
textstringzorunluMesaj metni
media_urlsstring[] | anyEklenecek görsel veya video URL listesi (maksimum 4 resim veya 1 video)
Özellikleri gösterÖzellikleri gizle
Any of:
string[]
Array of
stringstringany
anyvideo_urlstring | anyPublic http(s) URL of one video to attach (mutually exclusive with image).
Özellikleri gösterÖzellikleri gizle
Any of:
string
stringany
anypinstring | anyIdentity PIN (default 1234).
default: "1234"
Özellikleri gösterÖzellikleri gizle
Any of:
string
stringany
anycookiestringzorunluKullanıcının kendi yetkilendirilmiş Twitter oturum kimlik bilgileri veya auth_token (BYOC — Bring Your Own Cookie). Sıfır kimlik bilgisi saklama ile durum bilgisi olmayan proxy yürütmesi. [Kimlik Doğrulama Güvenliği](/tr/authentication#write-operations--byoc-bring-your-own-cookie) ve [Cookie Nasıl Alınır](https://youtube-promotion.pages.dev/how-to-get-twitter-cookie) sayfasına bakın.
proxystring | anyOptional HTTP proxy. Example: http://username:password@ip:port
Özellikleri gösterÖzellikleri gizle
Any of:
string
stringany
anyYanıtlar
200A message object.
codeintegerzorunluHTTP durum kodu (200 başarılı anlamına gelir)
msgstringzorunluYanıt mesajı (örn: 'success')
dataMessageModel | anyzorunluUç nokta tarafından döndürülen ana veri
Özellikleri gösterÖzellikleri gizle
Any of:
MessageModel
idstringzorunluMessage ID
textstringzorunluMesaj metni
timestringzorunluMessage time
attachmentobject | anyMessage attachment
Özellikleri gösterÖzellikleri gizle
Any of:
object
objectany
anyattachmentsobject[] | anyXChat media attachments (v3).
Özellikleri gösterÖzellikleri gizle
Any of:
object[]
Array of
objectobjectany
anysequence_idstring | anyXChat sequence id. Use the oldest message's sequence_id as before for pagination.
Özellikleri gösterÖzellikleri gizle
Any of:
string
stringany
anysender_idstring | anySender ID
Özellikleri gösterÖzellikleri gizle
Any of:
string
stringany
anyrecipient_idstring | anyDM alıcısının Twitter ID'si
Özellikleri gösterÖzellikleri gizle
Any of:
string
stringany
anyany
any422Parametre Doğrulama Hatası
detailValidationError[]Özellikleri gösterÖzellikleri gizle
Array of
ValidationErrorlocstring | integer[]zorunluÖzellikleri gösterÖzellikleri gizle
Array of
string | integerAny of:
string
stringinteger
integermsgstringzorunluYanıt mesajı (örn: 'success')
typestringzorunluinputanyctxobject⚡Etkileşimli KonsolPOST
⚡Etkileşimli Konsol / API TestiPOSTLive Console
🌐Hedef Sunucu:
https://api.twexapi.io● Canlı Ortam Hazır
✍️
Yazma İşlemi Kimlik Kılavuzu (TwexAPI Anahtarı + Twitter Çerezi)
1. TwexAPI Anahtarı (Bearer Token): İstek faturalandırması ve kimlik doğrulama için aşağıdaki "API Yetkilendirmesi"ne girin.
2. Twitter Hesabı Çerezi: Yazma işlemleri için (tweet, beğeni, takip), aşağıdaki cookie alanına hedef hesabın Çerezini (örn. auth_token=...; ct0=...) girin.
🔑API Yetkilendirmesi
📝İstek Gövdesiapplication/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
İstek
curl -X POST "https://api.twexapi.io/v3/twitter/send-dm" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"recipient": "baker_donn80196",
"text": "hello from docs",
"media_urls": [
"https://example.com/image.jpg"
],
"video_url": "https://video.twimg.com/amplify_video/2077160248830275584/vid/avc1/320x568/kwNDLTm",
"pin": "1234",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
}'const response = await fetch("https://api.twexapi.io/v3/twitter/send-dm", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"recipient": "baker_donn80196",
"text": "hello from docs",
"media_urls": [
"https://example.com/image.jpg"
],
"video_url": "https://video.twimg.com/amplify_video/2077160248830275584/vid/avc1/320x568/kwNDLTm",
"pin": "1234",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
})
});import requests
response = requests.post(
"https://api.twexapi.io/v3/twitter/send-dm",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"recipient": "baker_donn80196",
"text": "hello from docs",
"media_urls": [
"https://example.com/image.jpg"
],
"video_url": "https://video.twimg.com/amplify_video/2077160248830275584/vid/avc1/320x568/kwNDLTm",
"pin": "1234",
"cookie": "ct0=abc123... or 2c4a4e1832096aa694c739b83c83b6d96d43eba7",
"proxy": "http://username:password@ip:port"
},
)Yanıt
{
"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"
}
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}