Direct messages/sent

跳转到: 导航, 搜索

目录

发送私信

返回登录用户已发送最新20条私信。XML和JSON的版本有包括发送者和接受者的详细资料。

URL

http://api.t.sina.com.cn/direct_messages/sent.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/sent.xml?since_id=12345

  • max_id. 可选参数. 返回ID不大于max_id(时间不晚于max_id)的私信。

o Example: http://api.t.sina.com.cn/direct_messages/sent.xml?max_id=54321

  • count. 可选参数. 每次返回的最大记录数(即页面大小),不大于200。

o Example: http://api.t.sina.com.cn/direct_messages/sent.xml?count=5

  • page. 可选参数. 返回结果的页序号。注意:有分页限制。

o Example: http://api.t.sina.com.cn/direct_messages/sent.xml?page=3

Response

XML示例:

<?xml version="1.0" encoding="UTF-8"?>
  <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>Tim Yang</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/sent.xml