检查私信权限状态
发送私信前检测目标账号是否允许接收来自未关注者的私信,避免触发滥用拦截。需附带 Twitter Cookie。
返回 API 接口列表
/DM Endpoints
POST
/v2/dm/statusAPI 鉴权
AuthorizationBearer token · header必填TwexAPI 平台的全局身份凭据 (Bearer Token)。所有接口调用均需在 Header 中携带:Authorization: Bearer <YOUR_TWEXAPI_KEY>。可在 TwexAPI 用户控制台获取。
请求体
必填application/jsonArray of
stringstring响应结果
200映射用户数字 ID 对应私信可达性状态的结果对象。
codeinteger必填HTTP 响应状态码(200 表示成功)
msgstring必填响应提示信息(例如 'success')
dataDMStatusModelV2[]必填接口返回的核心业务数据载荷
展开属性折叠属性
Array of
DMStatusModelV2user_idstring | any目标用户的推特唯一数字 ID
展开属性折叠属性
Any of:
string
stringany
anyscreen_namestring | any推特用户名(Handle,即 @ 后的名称)
展开属性折叠属性
Any of:
string
stringany
anyis_blue_verifiedboolean | any是否为推特蓝 V 认证用户(X Premium 会员)
展开属性折叠属性
Any of:
boolean
booleanany
anyis_verified_organization_affiliateboolean | any展开属性折叠属性
Any of:
boolean
booleanany
anyverifiedboolean | any是否通过推特官方实名/身份认证
展开属性折叠属性
Any of:
boolean
booleanany
anycan_dmboolean | any当前登录账号是否允许向该用户发送私信
展开属性折叠属性
Any of:
boolean
booleanany
anycan_dm_on_xchatboolean | any展开属性折叠属性
Any of:
boolean
booleanany
anydm_blockingboolean | any展开属性折叠属性
Any of:
boolean
booleanany
anypasses_premium_checkboolean | any展开属性折叠属性
Any of:
boolean
booleanany
any422请求参数校验错误
detailValidationError[]展开属性折叠属性
Array of
ValidationErrorlocstring | integer[]必填展开属性折叠属性
Array of
string | integerAny of:
string
stringinteger
integermsgstring必填响应提示信息(例如 'success')
typestring必填inputanyctxobject⚡交互式测试POST
⚡交互式测试 / Try APIPOSTLive Console
🌐目标服务器:
https://api.twexapi.io● 生产环境就绪
🔍
公开数据读取(仅需 TwexAPI 平台密钥,无需 Twitter Cookie)
本接口为公开推特数据检索/查询,无需任何推特账号或 Cookie!仅需在下方「API 鉴权」中输入您的 TwexAPI 平台密钥 (Bearer Token) 即可直接发起测试。
🔑API 鉴权
📝请求体application/json
📡
暂无响应数据
请在「请求配置」中确认参数后,点击底部的「发送请求」按钮。
请求示例
curl -X POST "https://api.twexapi.io/v2/dm/status" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '[
"1696160451770429440",
"elonmusk"
]'const response = await fetch("https://api.twexapi.io/v2/dm/status", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify([
"1696160451770429440",
"elonmusk"
])
});import requests
response = requests.post(
"https://api.twexapi.io/v2/dm/status",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json=[
"1696160451770429440",
"elonmusk"
],
)响应示例
{
"code": 0,
"msg": "string",
"data": [
{
"user_id": "string",
"screen_name": "string",
"is_blue_verified": true,
"is_verified_organization_affiliate": true,
"verified": true,
"can_dm": true,
"can_dm_on_xchat": true,
"dm_blocking": true,
"passes_premium_check": true
}
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}