10、statuses/repost_by_me 返回用户转发的最新n条微博信息
获取用户最新转发的n条微博消息
URL:http://api.t.sina.com.cn/statuses/repost_by_me.(json|xml)
支持格式:XML/JSON
HTTP请求方式:GET
是否需要登录:true
请求数限制:true
请求参数:
| 必选 | 类型范围 | 说明 |
source | true | string | 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数) |
id | true | int64 | 要获取转发微博列表的用户ID。 |
since_id | false | int64 | 若指定此参数,则只返回ID比since_id大的微博消息(即比since_id发表时间晚的微博消息)。 |
max_id | false | int64 | 若指定此参数,则返回ID小于或等于max_id的微博消息 |
count | false | int,默认值20,最大值200。 | 指定要返回的记录条数 |
page | false | int默认值是1 | 指定返回结果的页码。根据当前登录用户所关注的用户数及这些被关注用户发表的微博数,翻页功能最多能查看的总记录数会有所不同,通常最多能查看1000条左右。 |
调用示例:
XML:curl -u "username:password"
"http://api.t.sina.com.cn/statuses/repost_by_me.xml?source=appkey&id=1642466141"
JSON:curl -u "username:password"
"http://api.t.sina.com.cn/statuses/repost_by_me.json?source=appkey&id=1642466141"
11、statuses/unread 获取当前用户未读消息数
获取当前用户Web主站未读消息数,包括:
是否有新微博消息
最新提到“我”的微博消息数
新评论数
新私信数
新粉丝数。
此接口对应的清零接口为statuses/reset_count。
URL:http://api.t.sina.com.cn/statuses/unread.(json|xml)
支持格式: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比since_id大的微博消息(即比since_id发表时间晚的微博消息)。 |
注意事项:如果只传入since_id,而没有传入with_new_status参数,则返回结果与未传入任何参数时相同。
调用示例:
XML:curl -u "username:password"
"http://api.t.sina.com.cn/statuses/unread.xml?source=appkey&with_new_status=1&since_id=300000000"
JSON:curl -u "username:password"
"http://api.t.sina.com.cn/statuses/unread.xml?source=appkey&with_new_status=1&since_id=300000000"
12、statuses/reset_count 未读消息数清零接口
将当前登录用户的某种新消息的未读数为0。可以清零的计数类别有:1. 评论数,2. @me数,3. 私信数,4. 关注数
URL:http://api.t.sina.com.cn/statuses/reset_count.(json|xml)
支持格式:XML/JSON
HTTP请求方式:POST
是否需要登录:true
请求数限制:false
请求参数:
| 必选 | 类型范围 | 说明 |
source | true | string | 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数) |
type | true | int 1~4 | 需要清零的计数类别,值为下列四个之一:1. 评论数,2. @me数,3. 私信数,4. 关注数 |
调用示例:
XML:curl -u "username:password" -d "type=1"
"http://api.t.sina.com.cn/statuses/reset_count.xml?source=appkey"
JSON:curl -u "username:password" -d "type=1"
"http://api.t.sina.com.cn/statuses/reset_count.json?source=appkey"