Statuses/unread

跳转到: 导航, 搜索

目录

statuses/unread

获取当前用户Web主站未读消息数,包括:

  • 是否有新微博消息
  • 最新提到“我”的微博消息数
  • 新评论数
  • 新私信数
  • 新粉丝数。

此接口对应的清零接口为statuses/reset_count

URL

http://api.t.sina.com.cn/statuses/unread.(json%7Cxml)

支持格式

XML/JSON

HTTP请求方式

GET

是否需要登录

true
关于授权机制,参见授权机制声明

请求数限制

true
关于请求数限制,参见接口访问权限说明

请求参数

  必选 类型及范围 说明
source true string 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数)
with_new_status false int,默认为0。 1表示结果中包含new_status字段,0表示结果不包含new_status字段。new_status字段表示是否有新微博消息,1表示有,0表示没有
since_id false int64 参数值为微博id。该参数需配合with_new_status参数使用,返回since_id之后,是否有新微博消息产生

注意事项

  • 如果只传入since_id,而没有传入with_new_status参数,则返回结果与未传入任何参数时相同。

返回结果

XML示例

<?xml version="1.0" encoding="UTF-8"?>
<count>
  <new_status>1</new_status>
  <followers>0</followers>
  <dm>1</dm>
  <mentions>1</mentions>
  <comments>3</comments>
</count>

JSON示例

{
    "comments" : 3,
    "followers" : 0,
    "new_status" : 1,
    "dm" : 1,
    "mentions" : 1
}

其他

文档更新时间: 2012-09-24