C/2/direct messages

跳转到: 导航, 搜索

direct_messages

获取授权用户收到的最新私信列表(只能获取企业、媒体、政府等蓝V类型帐号的私信列表,且授权帐号个数有限制)。

URL

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

支持格式

JSON

HTTP请求方式

GET

是否需要登录


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

访问授权限制


请求所有商业接口:

    • 50000次/小时/IP;

请求参数

  必选 类型及范围 说明
source false string 采用OAuth授权方式不需要此参数,其他授权方式为必填参数,数值为应用的AppKey。
access_token false string 采用OAuth授权方式为必填参数,其他授权方式不需要此参数,OAuth授权后获得。
since_id false int64 起始ID。默认为0。
max_id false int64 结束ID。默认为0。
count false integer 单页返回的记录条数。默认为20,最大为200。
page false integer 返回结果的页码。默认为1。

注意事项

  • 返回私信按最新时间排序;
  • 最多返回最近200封私信;
  • 只能获取授权给当前应用的当前帐号的私信列表;

返回结果

JSON示例

{
    "direct_messages":
    [
        {
            "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",
            "status_id":0, 
            "geo":null,
            "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":1986795185,
                "screen_name":"nickyk001",
                "name":"nickyk001",
                "province":"42",
                "city":"2",
                "location":"湖北 黄石",
                "description":"",
                "url":"",
                "profile_image_url":"http://tp2.sinaimg.cn/1986795185/50/0/1",
                "domain":"",
                "gender":"m",
                "followers_count":0,
                "friends_count":0,
                "statuses_count":0,
                "favourites_count":0,
                "bi_followers_count":0,
                "created_at":"Wed Feb 23 00:00:00 +0800 2011",
                "following":false,
                "verified":false,
                "allow_all_act_msg":false,
                "allow_all_comment":false,
                "follow_me":false,
                "avatar_large":"",
                "verified_reason":"",
                "online_status":0
            }
        },
        {
            "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",
            "status_id":0, 
            "geo":null,
            "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":1986795185,
                "screen_name":"nickyk001",
                "name":"nickyk001",
                "province":"42",
                "city":"2",
                "location":"湖北 黄石",
                "description":"",
                "url":"",
                "profile_image_url":"http://tp2.sinaimg.cn/1986795185/50/0/1",
                "domain":"",
                "gender":"m",
                "followers_count":0,
                "friends_count":0,
                "statuses_count":0,
                "favourites_count":0,
                "bi_followers_count":0,
                "created_at":"Wed Feb 23 00:00:00 +0800 2011",
                "following":false,
                "verified":false,
                "allow_all_act_msg":false,
                "allow_all_comment":false,
                "follow_me":false,
                "avatar_large":"",
                "verified_reason":"",
                "online_status":0
            }
        }
    ],
    "total_number":2
}

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

字段说明

其他



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


文档更新时间: 2013-04-17