跳转到: 导航, 搜索

direct_messages/reply

乒乓回复一条消息

URL

https://api.weibo.com/2/direct_messages/reply.json

支持格式

JSON

HTTP请求方式

POST

是否需要登录


关于登录授权,参见 如何登录授权

访问授权限制

访问级别:高级接口(需要授权)
频次限制:
关于频次限制,参见 接口访问权限说明

请求参数

  必选 类型及范围 说明
access_token true string 采用OAuth授权方式为必填参数,OAuth授权后获得。
id true int64 私信或留言箱消息ID。
text true string 要发送的消息内容。需要做URLEncode,文本大小必须小于300个汉字。
is_encoded false integer 返回结果是否转义。0:不转义,1:转义,默认0。需要转义的符号及转义规则见下文说明。

注意事项

回复需满足以下条件:

1)当前用户必须为蓝V,否则报错;

2)参数id对应的消息必须是72小时内产生的;

3)参数id对应的消息中的接收者必须是当前用户;

4)参数id对应的消息只能被回复一次;

5)当前用户未在对方黑名单中;

6)满足前四条基础上,当前用户被屏蔽则进留言箱。

当选择转义时,将转义符号: & " < >,规则为: & 转为 &amp 、< 转为 &lt 、> 转为 &gt 、" 转为 &quot ;

调用样例及调试工具

API测试工具

返回结果

JSON示例

{
    "id":3332910801173380,
    "idstr":"3332910801173380",
    "created_at":"Fri Jul 08 15:48:42 +0800 2011",
    "text":"私信1",
    "sender_id":4294917290,
    "recipient_id":2125034703,
    "sender_screen_name":"sso20333333333",
    "recipient_screen_name":"zhaoya0029",
    "mid":"3332910801173380",
    "geo":null,
    "msg_type": 1, // 该条消息类型,1:私信,2:留言箱信息
    "sender":
    {
        "id":1734528095,
        "screen_name":"jkl0000",
        "name":"jkl0000",
        "province":"12",
        "city":"5",
        "location":"天津 河北区",
        "description":"abcdefag",
        "url":"http://blog.sina.com.cn/jkl0000",
        "profile_image_url":"http://tp4.sinaimg.cn/1734528095/50/1296126203/1",
        "domain":"jkl00",
        "gender":"m",
        "followers_count":115,
        "friends_count":171,
        "statuses_count":2,
        "favourites_count":0,
        "bi_followers_count":0,
        "created_at":"Mon Apr 26 00:00:00 +0800 2010",
        "following":false,
        "verified":false,
        "allow_all_act_msg":true,
        "allow_all_comment":false,
        "follow_me":false,
        "avatar_large":"",
        "verified_reason":"",
        "online_status":0
    },
    "recipient":
    {
        "id":1363183595,
        "screen_name":"zach-chen",
        "name":"zach-chen",
        "province":"11",
        "city":"8",
        "location":"北京 海淀区",
        "description":"我在设计互联网的潘多拉星球",
        "url":"http://1",
        "profile_image_url":"http://tp4.sinaimg.cn/1363183595/50/1292221750/1",
        "domain":"callmezach",
        "gender":"m",
        "followers_count":47,
        "friends_count":62,
        "statuses_count":0,
        "favourites_count":0,
        "bi_followers_count":0,
        "created_at":"Fri Aug 20 00:00:00 +0800 2010",
        "following":false,
        "verified":false,
        "allow_all_act_msg":true,
        "allow_all_comment":false,
        "follow_me":false,
        "avatar_large":"",
        "verified_reason":"",
        "online_status":0
    },
    "att_ids":[
        234524634563,
        235326347634
    ],
    "status_id":3634764574
}

关于错误返回值与错误代码,参见 错误代码说明

返回字段说明

其他

相关问题


帮助中心 查看更多问题或提问


Language: [[{{{2/uri}}}|中文]]




api评价