Direct messages
(→返回) |
(→返回) |
||
第44行: | 第44行: | ||
<id>11075</id> | <id>11075</id> | ||
<screen_name>zhulei</screen_name> | <screen_name>zhulei</screen_name> | ||
− | <name> | + | <name>Zhu Lei</name> |
<location>广州</location> | <location>广州</location> | ||
<description> </description> | <description> </description> |
2009年11月18日 (三) 18:15的版本
目录 |
direct_messages
返回用户的最新20条私信。XML和JSON的版本有发送者和接受者的详细资料。
Returns a list of the 20 most recent direct messages sent to the authenticating user. The XML and JSON versions include detailed information about the sending and recipient users.
URL
curl http://api.t.sina.com.cn/direct_messages.format
格式
xml, json, rss, atom
HTTP请求方式
GET
是否需要身份验证
true
请求数限制
1 call per request
请求参数
- since_id. 可选参数. 返回ID比数值since_id大(比since_id时间晚的)的私信。
o Example: http://api.t.sina.com.cn/direct_messages.xml?since_id=12345
- max_id. 可选参数. 返回ID不大于max_id(时间不晚于max_id)的私信。
o Example: http://api.t.sina.com.cn/direct_messages.xml?max_id=54321
- count. 可选参数. 每次返回的最大记录数(即页面大小),不大于200。
o Example: http://api.t.sina.com.cn/direct_messages.xml?count=200
- page. 可选参数. 返回结果的页序号。注意:有分页限制。
o Example: http://api.t.sina.com.cn/direct_messages.xml?page=3
返回
XML示例:
<?xml version="1.0" encoding="UTF-8"?> <direct-messages> <direct_message> <id>88619848</id> <sender_id>11075</sender_id> <text>hi,最近好呢?</text> <recipient_id>10503</recipient_id> <created_at>Wed Nov 18 20:30:04 +0000 2009</created_at> <sender_screen_name>zhulei</sender_screen_name> <recipient_screen_name>timyang</recipient_screen_name> <sender> <id>11075</id> <screen_name>zhulei</screen_name> <name>Zhu Lei</name> <location>广州</location> <description> </description> <profile_image_url>http://tt8.sinaimg.cn/11075/50/1256307436</profile_image_url> <followers_count>0</followers_count> <friends_count>0</friends_count> <statuses_count>0</statuses_count> <favourites_count>0</favourites_count> </sender> <recipient> <id>10503</id> <screen_name>timyang</screen_name> <name>Tim Yang</name> <location>广州</location> <description>blog: timyang.net</description> <profile_image_url>http://tt8.sinaimg.cn/10503/50/1256306049</profile_image_url> <followers_count>0</followers_count> <friends_count>0</friends_count> <statuses_count>0</statuses_count> <favourites_count>0</favourites_count> </recipient> </direct_message> ... truncated ... </direct-messages>
使用示例
cURL:
curl -u user:password http://api.t.sina.com.cn/direct_messages.xml