Statuses/unread

跳转到: 导航, 搜索
(返回结果)
 
(未显示3个用户的19个中间版本)
第1行: 第1行:
== statuses/unread ==
+
{{api_desc2|
获取当前用户Web未读消息数,包括@, 评论,私信。
+
uri=statuses/unread |
 
+
desc=获取当前用户[http://t.sina.com.cn Web主站]未读消息数,包括:
=== URL: ===
+
* 是否有新微博消息
http://api.t.sina.com.cn/statuses/unread.format
+
* 最新提到“我”的微博消息数
+
* 新评论数
===格式:===
+
* 新私信数
xml, json
+
* 新粉丝数。<br/>
+
此接口对应的清零接口为[[statuses/reset_count]]。|
=== 是否需要登录: ===
+
format=XML/JSON|
GET
+
httpMethod=GET|
 
+
needAuth=true|
===请求数限制:===
+
rateLimit=true|
true
+
params={{api_args|with_new_status|false|int,默认为0。|1表示结果中包含new_status字段,0表示结果不包含new_status字段。new_status字段表示是否有新微博消息,1表示有,0表示没有}}
 
+
{{api_args|since_id|false|int64|参数值为微博id。该参数需配合with_new_status参数使用,返回since_id之后,是否有新微博消息产生}}|
===请求参数===
+
getParam=&with_new_status=1&since_id=300000000|
+
postParam=|
 
+
result=
===返回结果===
+
===XML示例===
XML示例:
+
<pre>
<?xml version="1.0" encoding="UTF-8"?>
+
<?xml version="1.0" encoding="UTF-8"?>
  <count>
+
<count>
  <comments>10</comments>
+
  <new_status>1</new_status>
  <nowiki><rt>21</rt ></nowiki>
+
  <followers>0</followers>
  <mentions>0</mentions>
+
  <dm>1</dm>
  <dm>0</dm>
+
  <mentions>1</mentions>
  <followers>2</followers>
+
  <comments>3</comments>
  <count>
+
</count>
 
+
</pre>
JSON示例:
+
===JSON示例===
[
+
<pre>
  {"id":32817222,
+
{
  "comments":0,
+
    "comments" : 3,
  "rt":0},
+
    "followers" : 0,
  {"id":214672651,
+
    "new_status" : 1,
  "comments":0,
+
    "dm" : 1,
  "rt":0}
+
    "mentions" : 1
]
+
}
 
+
</pre>|
===使用示例: ===
+
useAge=
需修改appkey
+
* 如果只传入since_id,而没有传入with_new_status参数,则返回结果与未传入任何参数时相同。|
* xml:
+
otherInfo=
curl -u uid:password http://api.t.sina.com.cn/statuses/counts.xml?source=appkey
+
}}
 
+
* json:
+
curl -u uid:password http://api.t.sina.com.cn/statuses/counts.json?source=appkey
+

2012年9月24日 (一) 11:34的最后版本

目录

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