跳转到: 导航, 搜索

direct_messages/home_timeline

获取当前用户收到的最新消息列表(当前用户必须为蓝V)

URL

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

支持格式

JSON

HTTP请求方式

GET

是否需要登录


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

访问授权限制

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

请求参数

  必选 类型及范围 说明
access_token true string 采用OAuth授权方式为必填参数,OAuth授权后获得。
msg_type false int64 需要返回的消息类型,1:私信,2:留言箱信息,0:私信及留言箱按时间混排信息,默认为0。
count false integer 返回结果的条数数量,最大不超过200,默认为20。
page false integer 返回结果的页码,默认为1。
since_id false int64 若指定此参数,则返回ID比since_id大的消息(即比since_id时间晚的消息),默认为0。

注意事项

  • 当前用户必须为蓝V,否则报错

调用样例及调试工具

API测试工具

返回结果

JSON示例

{
    "direct_messages": [
        {
            "id": 3470997774698012,
            "idstr": "3470997774698012",
            "created_at": "Mon Jul 23 16:57:01 +0800 2012",
            "text": "你好,已经有添加测试用户...",
            "sender_id": 2866018962,
            "recipient_id": 1870632073,
            "sender_screen_name": "template000",
            "recipient_screen_name": "微博API",
            "msg_type": 1,   // 该条消息类型,1:私信,2:留言箱信息
            "sender": {
                "id": 2866018962,
                "idstr": "2866018962",
                "screen_name": "template000",
                "name": "template000",
                "province": "35",
                "city": "1",
                "location": "",
                "description": "",
                "url": "",
                "profile_image_url": "http://tp3.sinaimg.cn/2866018962/50/0/1",
                "profile_url": "u/2866018962",
                "domain": "",
                "weihao": "",
                "gender": "m",
                "followers_count": 0,
                "friends_count": 1,
                "statuses_count": 0,
                "favourites_count": 0,
                "created_at": "Wed Jul 11 00:24:54 +0800 2012",
                "following": false,
                "allow_all_act_msg": false,
                "geo_enabled": true,
                "verified": false,
                "verified_type": -1,
                "allow_all_comment": true,
                "avatar_large": "http://tp3.sinaimg.cn/2866018962/180/0/1",
                "verified_reason": "",
                "follow_me": false,
                "online_status": 0,
                "bi_followers_count": 0,
                "lang": "zh-cn"
            },
            "recipient": {
                "id": 1870632073,
                "idstr": "1870632073",
                "screen_name": "微博API",
                "name": "微博API",
                "province": "11",
                "city": "8",
                "location": "",
                "description": "开放平台官方技术支持微博,开发者可直接@或者发私信反馈技术问题",
                "url": "http://weibo.com",
                "profile_image_url": "http://tp2.sinaimg.cn/1870632073/50/5610183919/1",
                "profile_url": "u/1870632073",
                "domain": "",
                "weihao": "",
                "gender": "m",
                "followers_count": 7344,
                "friends_count": 6,
                "statuses_count": 72,
                "favourites_count": 1,
                "created_at": "Mon Nov 22 19:12:05 +0800 2010",
                "following": false,
                "allow_all_act_msg": true,
                "geo_enabled": true,
                "verified": true,
                "verified_type": 6,
                "allow_all_comment": true,
                "avatar_large": "http://tp2.sinaimg.cn/1870632073/180/5610183919/1",
                "verified_reason": "微博开放平台官方技术支持",
                "follow_me": false,
                "online_status": 0,
                "bi_followers_count": 4,
                "lang": "zh-cn"
            },
            "mid": "21312072315112766",
            "source": "<a href=\"http://weibo.com\" rel=\"nofollow\">新浪微博</a>",
            "status_id": 0,
            "geo": null
        }
    ],
    "total_number": 15171
}

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

返回字段说明

其他

相关问题


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


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




api评价