Direct messages

跳转到: 导航, 搜索
(返回)
(返回)
第32行: 第32行:
 
XML示例:
 
XML示例:
 
  <?xml version="1.0" encoding="UTF-8"?>
 
  <?xml version="1.0" encoding="UTF-8"?>
 +
<direct_messages>
 
  <direct_message>
 
  <direct_message>
 
     <created_at>Fri Dec 25 12:52:19 +0800 2009</created_at>
 
     <created_at>Fri Dec 25 12:52:19 +0800 2009</created_at>

2009年12月28日 (一) 14:01的版本

目录

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>
   <created_at>Fri Dec 25 12:52:19 +0800 2009</created_at>
   <id>1447</id>
   <text>教育的核心内容不是让孩子做不喜欢的事,而是以“喜欢的游戏”来培养幼儿的能力,这种教育方法绝不是“光玩不培养能力”.</text>
   <sender_id>11892</sender_id>
   <recipient_id>11075</recipient_id>
   <sender_screen_name>user11892</sender_screen_name>
   <recipient_screen_name>user11075</recipient_screen_name>
   <sender>
     <id>11892</id>
     <screen_name>user11892</screen_name>
     <name>user11892</name>
     <province>广东</province>
     <city>广州</city>
     <location>广东 广州</location>
     <description>blog: timyang.net</description>
     <profile_image_url>50#.jpg</profile_image_url>
     <domain></domain>
     <gender></gender>
     <email></email>
     <qq></qq>
     <msn></msn>
     <followers_count>0</followers_count>
     <friends_count>0</friends_count>
     <statuses_count>0</statuses_count>
     <favourites_count>0</favourites_count>
     <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
     <following>false</following>
     <verified>false</verified>
     <geo_enabled>false</geo_enabled>
   </sender>
   <recipient>
     <id>11075</id>
     <screen_name>user11075</screen_name>
     <name>user11075</name>
     <province>广东</province>
     <city>广州</city>
     <location>广东 广州</location>
     <description>blog: timyang.net</description>
     <profile_image_url>50#.jpg</profile_image_url>
     <domain></domain>
     <gender></gender>
     <email></email>
     <qq></qq>
     <msn></msn>
     <followers_count>0</followers_count>
     <friends_count>0</friends_count>
     <statuses_count>0</statuses_count>
     <favourites_count>0</favourites_count>
     <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
     <following>false</following>
     <verified>false</verified>
     <geo_enabled>false</geo_enabled>
   </recipient>
 </direct_message>
  ... truncated ...
</direct-messages>

使用示例

cURL:

curl -u user:password http://api.t.sina.com.cn/direct_messages.xml