Statuses/reply

跳转到: 导航, 搜索
(使用示例)
 
(未显示2个用户的9个中间版本)
第1行: 第1行:
== statuses/reply ==
+
{{api_desc2|
对一条微博评论信息进行回复。请求必须用POST方式提交。为防止重复,发布的信息与最后一条评论/回复信息一样话,将会被忽略。
+
uri=statuses/reply|
 
+
desc=回复评论。请求必须用POST方式提交。|
=== URL===
+
format=XML/JSON|
curl http://api.t.sina.com.cn/statuses/reply.format
+
httpMethod=POST|
+
needAuth=true|
=== 格式===
+
rateLimit=true|
xml, json, rss, atom
+
params={{api_args|cid|true|int64|要回复的评论ID。}}
+
{{api_args|comment|true|string|要回复的评论内容。必须做URLEncode,信息内容不超过140个汉字。}}
=== HTTP请求方式===
+
{{api_args|id|true|int64|要评论的微博消息ID}}
POST
+
{{api_args|without_mention|false|int|1:回复中不自动加入“回复@用户名”,0:回复中自动加入“回复@用户名”.默认为0.}}|
+
getParam=|
=== 是否需要身份验证===
+
postParam=-d "cid=4949855625&id=4046214423&comment=wahaha"|
true
+
result=
+
===XML示例===
=== 请求数限制===
+
<pre>
true
+
<?xml version="1.0" encoding="UTF-8"?>
 
+
<comment>
=== 请求参数===
+
  <created_at>Fri Dec 03 10:39:36 +0800 2010</created_at>
* id 必填参数, 要评论的微博id
+
  <id>4977147033</id>
* cid 必填参数, 要评论的评论id 如没有或非法则为对微博的评论
+
  <text>回复@zhangwei217245:wakawaka</text>
* comment. 必填参数, 评论内容。必须做URLEncode,信息内容不超过140个汉字
+
  <source>
 
+
    <a href="http://open.t.sina.com.cn">微博开放平台接口</a>
=== 使用说明===
+
  </source>
* 如果没有登录或参数错误,将返回403错误
+
  <user>
* 如果id不存在,将返回400错误
+
    <id>1658122963</id>
* 系统将忽略重复发布的评论信息。每次发布将比较最后一条发布评论消息,如果一样将被忽略。
+
    <screen_name>zhangwei217245</screen_name>
 
+
    <name>zhangwei217245</name>
=== 返回结果 ===
+
    <province>11</province>
XML示例:
+
    <city>5</city>
  <?xml version="1.0" encoding="UTF-8"?>
+
    <location>北京 朝阳区</location>
   <comment>
+
    <description>ABCDE</description>
     <created_at>Fri Jan 08 13:45:07 +0800 2010</created_at>
+
    <url/>
     <id>203099</id>
+
    <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
     <text>dddddddddddd</text>
+
    <domain>zhangwei217245</domain>
 +
    <gender>m</gender>
 +
    <followers_count>22</followers_count>
 +
    <friends_count>43</friends_count>
 +
    <statuses_count>115</statuses_count>
 +
    <favourites_count>3</favourites_count>
 +
    <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
 +
    <following>false</following>
 +
    <verified>false</verified>
 +
    <allow_all_act_msg>false</allow_all_act_msg>
 +
    <geo_enabled>true</geo_enabled>
 +
    <status>
 +
      <created_at>Thu Dec 02 17:23:52 +0800 2010</created_at>
 +
      <id>4023418959</id>
 +
      <text>哎呀妈呀,终于找到组织了。</text>
 +
      <source>
 +
        <a href="http://t.sina.com.cn">新浪微博</a>
 +
      </source>
 +
      <favorited>false</favorited>
 +
      <truncated>false</truncated>
 +
      <geo/>
 +
      <in_reply_to_status_id/>
 +
      <in_reply_to_user_id/>
 +
      <in_reply_to_screen_name/>
 +
      <retweeted_status>
 +
        <created_at>Thu Dec 02 17:23:03 +0800 2010</created_at>
 +
        <id>4023402439</id>
 +
        <text>再看看在哪AGAIN</text>
 +
        <source>
 +
          <a href="">微博开放平台接口</a>
 +
        </source>
 +
        <favorited>false</favorited>
 +
        <truncated>false</truncated>
 +
        <geo xmlns:georss="http://www.georss.org/georss">
 +
          <georss:point>39.984833 116.310005</georss:point>
 +
        </geo>
 +
        <in_reply_to_status_id/>
 +
        <in_reply_to_user_id/>
 +
        <in_reply_to_screen_name/>
 +
        <user>
 +
          <id>1658122963</id>
 +
          <screen_name>zhangwei217245</screen_name>
 +
          <name>zhangwei217245</name>
 +
          <province>11</province>
 +
          <city>5</city>
 +
          <location>北京 朝阳区</location>
 +
          <description>ABCDE</description>
 +
          <url/>
 +
          <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
 +
          <domain>zhangwei217245</domain>
 +
          <gender>m</gender>
 +
          <followers_count>22</followers_count>
 +
          <friends_count>43</friends_count>
 +
          <statuses_count>113</statuses_count>
 +
          <favourites_count>3</favourites_count>
 +
          <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
 +
          <following>false</following>
 +
          <verified>false</verified>
 +
          <allow_all_act_msg>false</allow_all_act_msg>
 +
          <geo_enabled>true</geo_enabled>
 +
        </user>
 +
      </retweeted_status>
 +
      <annotations/>
 +
    </status>
 +
   </user>
 +
  <status>
 +
     <created_at>Thu Dec 02 17:14:39 +0800 2010</created_at>
 +
     <id>4023227965</id>
 +
     <text>哇哈哈。随便输了个经纬度,就跑到海里去发微博了</text>
 
     <source>
 
     <source>
       <a id="10013" href="http://t.sina.com.cn">SinaDestTop</a>
+
       <a href="http://t.sina.com.cn">新浪微博</a>
 
     </source>
 
     </source>
 +
    <favorited>false</favorited>
 +
    <truncated>false</truncated>
 +
    <geo/>
 +
    <in_reply_to_status_id/>
 +
    <in_reply_to_user_id/>
 +
    <in_reply_to_screen_name/>
 
     <user>
 
     <user>
       <id>11055</id>
+
       <id>1658122963</id>
       <screen_name>name_11055</screen_name>
+
       <screen_name>zhangwei217245</screen_name>
       <name>name_11055</name>
+
       <name>zhangwei217245</name>
       <province>0</province>
+
       <province>11</province>
       <city>0</city>
+
       <city>5</city>
       <location></location>
+
       <location>北京 朝阳区</location>
       <description></description>
+
       <description>ABCDE</description>
       <url></url>
+
       <url/>
       <profile_image_url>http://tp4.sinaimg.cn/11055/50/0</profile_image_url>
+
       <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
       <domain>11055</domain>
+
       <domain>zhangwei217245</domain>
       <gender></gender>
+
       <gender>m</gender>
       <followers_count>24</followers_count>
+
       <followers_count>22</followers_count>
       <friends_count>51</friends_count>
+
       <friends_count>43</friends_count>
       <statuses_count>0</statuses_count>
+
       <statuses_count>108</statuses_count>
       <favourites_count>0</favourites_count>
+
       <favourites_count>3</favourites_count>
       <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
+
       <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
 
       <following>false</following>
 
       <following>false</following>
 
       <verified>false</verified>
 
       <verified>false</verified>
       <geo_enabled>false</geo_enabled>
+
       <allow_all_act_msg>false</allow_all_act_msg>
 +
      <geo_enabled>true</geo_enabled>
 
     </user>
 
     </user>
     <status>
+
     <retweeted_status>
       <created_at>Fri Jan 08 10:18:05 +0800 2010</created_at>
+
       <created_at>Thu Dec 02 17:06:40 +0800 2010</created_at>
       <id>142314</id>
+
       <id>4023064087</id>
       <text>lsdjfl55</text>
+
       <text>abc</text>
 
       <source>
 
       <source>
         <a id="10013" href="http://t.sina.com.cn">SinaDestTop</a>
+
         <a href="">微博开放平台接口</a>
 
       </source>
 
       </source>
 
       <favorited>false</favorited>
 
       <favorited>false</favorited>
 
       <truncated>false</truncated>
 
       <truncated>false</truncated>
       <geo/>
+
       <geo xmlns:georss="http://www.georss.org/georss">
      <in_reply_to_status_id></in_reply_to_status_id>
+
        <georss:point>39.8765 119.5678</georss:point>
       <in_reply_to_user_id></in_reply_to_user_id>
+
       </geo>
       <in_reply_to_screen_name></in_reply_to_screen_name>
+
      <in_reply_to_status_id/>
 +
      <in_reply_to_user_id/>
 +
       <in_reply_to_screen_name/>
 +
      <thumbnail_pic>http://ww2.sinaimg.cn/thumbnail/6b85067djw6dbydsnam1xj.jpg</thumbnail_pic>
 +
      <bmiddle_pic>http://ww2.sinaimg.cn/bmiddle/6b85067djw6dbydsnam1xj.jpg</bmiddle_pic>
 +
      <original_pic>http://ww2.sinaimg.cn/large/6b85067djw6dbydsnam1xj.jpg</original_pic>
 
       <user>
 
       <user>
         <id>11075</id>
+
         <id>1803880061</id>
         <screen_name>name_11075</screen_name>
+
         <screen_name>LoopB</screen_name>
         <name>name_11075</name>
+
         <name>LoopB</name>
         <province>0</province>
+
         <province>11</province>
         <city>0</city>
+
         <city>8</city>
         <location></location>
+
         <location>北京 海淀区</location>
         <description></description>
+
         <description/>
         <url></url>
+
         <url/>
         <profile_image_url>http://tp4.sinaimg.cn/11075/50/0</profile_image_url>
+
         <profile_image_url>http://tp2.sinaimg.cn/1803880061/50/0/0</profile_image_url>
        <domain>11075</domain>
+
         <domain/>
        <gender></gender>
+
         <gender>f</gender>
        <followers_count>28</followers_count>
+
         <followers_count>1</followers_count>
        <friends_count>50</friends_count>
+
         <friends_count>1</friends_count>
        <statuses_count>0</statuses_count>
+
         <statuses_count>14</statuses_count>
        <favourites_count>34</favourites_count>
+
         <favourites_count>4</favourites_count>
        <created_at>Thu Jan 01 08:00:00 +0800 1970</created_at>
+
         <created_at>Fri Aug 27 00:00:00 +0800 2010</created_at>
        <following>false</following>
+
        <verified>true</verified>
+
        <geo_enabled>false</geo_enabled>
+
      </user>
+
    </status>
+
    <reply_comment>
+
      <created_at>Fri Jan 08 11:58:10 +0800 2010</created_at>
+
      <id>203097</id>
+
      <text>dddddddddddd</text>
+
      <source>
+
        <a id="10013" href="http://t.sina.com.cn">SinaDestTop</a>
+
      </source>
+
      <user>
+
        <id>11055</id>
+
        <screen_name>name_11055</screen_name>
+
        <name>name_11055</name>
+
        <province>0</province>
+
        <city>0</city>
+
        <location></location>
+
        <description></description>
+
        <profile_image_url>http://tp4.sinaimg.cn/11055/50/0</profile_image_url>
+
         <domain>11055</domain>
+
         <gender></gender>
+
         <followers_count>24</followers_count>
+
         <friends_count>51</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>
 
         <following>false</following>
 
         <verified>false</verified>
 
         <verified>false</verified>
         <geo_enabled>false</geo_enabled>
+
         <allow_all_act_msg>false</allow_all_act_msg>
 +
        <geo_enabled>true</geo_enabled>
 
       </user>
 
       </user>
     </reply_comment>
+
     </retweeted_status>
   </comment>
+
    <annotations/>
 +
  </status>
 +
  <reply_comment>
 +
    <created_at>Thu Dec 02 17:25:25 +0800 2010</created_at>
 +
    <id>4949855625</id>
 +
    <text>小新小新。。。我是小浪~~~</text>
 +
    <user>
 +
      <id>1658122963</id>
 +
      <screen_name>zhangwei217245</screen_name>
 +
      <name>zhangwei217245</name>
 +
      <province>11</province>
 +
      <city>5</city>
 +
      <location>北京 朝阳区</location>
 +
      <description>ABCDE</description>
 +
      <url/>
 +
      <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
 +
      <domain>zhangwei217245</domain>
 +
      <gender>m</gender>
 +
      <followers_count>22</followers_count>
 +
      <friends_count>43</friends_count>
 +
      <statuses_count>115</statuses_count>
 +
      <favourites_count>3</favourites_count>
 +
      <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
 +
      <following>false</following>
 +
      <verified>false</verified>
 +
      <allow_all_act_msg>false</allow_all_act_msg>
 +
      <geo_enabled>true</geo_enabled>
 +
    </user>
 +
   </reply_comment>
 +
</comment>
 +
</pre>
 +
===JSON示例===
 +
<pre>
 +
{
 +
    "id" : 4977097789,
 +
    "text" : "回复@zhangwei217245:walala",
 +
    "created_at" : "Fri Dec 03 10:37:39 +0800 2010",
 +
    "source" : "<a href=\"http://open.t.sina.com.cn\" rel=\"nofollow\">微博开放平台接口</a>",
 +
    "reply_comment" :
 +
    {
 +
        "id" : 4949855625,
 +
        "text" : "小新小新。。。我是小浪~~~",
 +
        "created_at" : "Thu Dec 02 17:25:25 +0800 2010",
 +
        "user" :
 +
        {
 +
            "name" : "zhangwei217245",
 +
            "domain" : "zhangwei217245",
 +
            "geo_enabled" : true,
 +
            "followers_count" : 22,
 +
            "statuses_count" : 115,
 +
            "favourites_count" : 3,
 +
            "city" : "5",
 +
            "description" : "ABCDE",
 +
            "verified" : false,
 +
            "id" : 1658122963,
 +
            "gender" : "m",
 +
            "friends_count" : 43,
 +
            "screen_name" : "zhangwei217245",
 +
            "allow_all_act_msg" : false,
 +
            "following" : false,
 +
            "url" : "",
 +
            "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
 +
            "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
 +
            "province" : "11",
 +
            "location" : "北京 朝阳区"
 +
        }
 +
    },
 +
    "user" :
 +
    {
 +
        "name" : "zhangwei217245",
 +
        "domain" : "zhangwei217245",
 +
        "geo_enabled" : true,
 +
        "followers_count" : 22,
 +
        "statuses_count" : 115,
 +
        "favourites_count" : 3,
 +
        "city" : "5",
 +
        "description" : "ABCDE",
 +
        "verified" : false,
 +
        "status" :
 +
        {
 +
            "created_at" : "Thu Dec 02 17:23:52 +0800 2010",
 +
            "text" : "哎呀妈呀,终于找到组织了。",
 +
            "truncated" : false,
 +
            "retweeted_status" :
 +
            {
 +
                "created_at" : "Thu Dec 02 17:23:03 +0800 2010",
 +
                "text" : "再看看在哪AGAIN",
 +
                "truncated" : false,
 +
                "in_reply_to_status_id" : "",
 +
                "in_reply_to_screen_name" : "",
 +
                "geo" :
 +
                {
 +
                    "type" : "Point",
 +
                    "coordinates" :
 +
                    [
 +
                        39.984833,
 +
                        116.310005
 +
                    ]
 +
                },
 +
                "user" :
 +
                {
 +
                    "name" : "zhangwei217245",
 +
                    "domain" : "zhangwei217245",
 +
                    "geo_enabled" : true,
 +
                    "followers_count" : 22,
 +
                    "statuses_count" : 113,
 +
                    "favourites_count" : 3,
 +
                    "city" : "5",
 +
                    "description" : "ABCDE",
 +
                    "verified" : false,
 +
                    "id" : 1658122963,
 +
                    "gender" : "m",
 +
                    "friends_count" : 43,
 +
                    "screen_name" : "zhangwei217245",
 +
                    "allow_all_act_msg" : false,
 +
                    "following" : false,
 +
                    "url" : "",
 +
                    "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
 +
                    "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
 +
                    "province" : "11",
 +
                    "location" : "北京 朝阳区"
 +
                },
 +
                "favorited" : false,
 +
                "in_reply_to_user_id" : "",
 +
                "id" : 4023402439,
 +
                "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
 +
            },
 +
            "in_reply_to_status_id" : "",
 +
            "annotations" :
 +
            [
  
JSON示例:
+
            ],
 +
            "in_reply_to_screen_name" : "",
 +
            "geo" : null,
 +
            "favorited" : false,
 +
            "in_reply_to_user_id" : "",
 +
            "id" : 4023418959,
 +
            "source" : "<a href=\"http://t.sina.com.cn\" rel=\"nofollow\">新浪微博</a>"
 +
        },
 +
        "id" : 1658122963,
 +
        "gender" : "m",
 +
        "friends_count" : 43,
 +
        "screen_name" : "zhangwei217245",
 +
        "allow_all_act_msg" : false,
 +
        "following" : false,
 +
        "url" : "",
 +
        "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
 +
        "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
 +
        "province" : "11",
 +
        "location" : "北京 朝阳区"
 +
    },
 +
    "status" :
 +
    {
 +
        "created_at" : "Thu Dec 02 17:14:39 +0800 2010",
 +
        "text" : "哇哈哈。随便输了个经纬度,就跑到海里去发微博了",
 +
        "truncated" : false,
 +
        "retweeted_status" :
 +
        {
 +
            "created_at" : "Thu Dec 02 17:06:40 +0800 2010",
 +
            "text" : "abc",
 +
            "bmiddle_pic" : "http://ww2.sinaimg.cn/bmiddle/6b85067djw6dbydsnam1xj.jpg",
 +
            "original_pic" : "http://ww2.sinaimg.cn/large/6b85067djw6dbydsnam1xj.jpg",
 +
            "truncated" : false,
 +
            "in_reply_to_status_id" : "",
 +
            "in_reply_to_screen_name" : "",
 +
            "geo" :
 +
            {
 +
                "type" : "Point",
 +
                "coordinates" :
 +
                [
 +
                    39.8765,
 +
                    119.5678
 +
                ]
 +
            },
 +
            "user" :
 +
            {
 +
                "name" : "LoopB",
 +
                "domain" : "",
 +
                "geo_enabled" : true,
 +
                "followers_count" : 1,
 +
                "statuses_count" : 14,
 +
                "favourites_count" : 4,
 +
                "city" : "8",
 +
                "description" : "",
 +
                "verified" : false,
 +
                "id" : 1803880061,
 +
                "gender" : "f",
 +
                "friends_count" : 1,
 +
                "screen_name" : "LoopB",
 +
                "allow_all_act_msg" : false,
 +
                "following" : false,
 +
                "url" : "",
 +
                "profile_image_url" : "http://tp2.sinaimg.cn/1803880061/50/0/0",
 +
                "created_at" : "Fri Aug 27 00:00:00 +0800 2010",
 +
                "province" : "11",
 +
                "location" : "北京 海淀区"
 +
            },
 +
            "favorited" : false,
 +
            "thumbnail_pic" : "http://ww2.sinaimg.cn/thumbnail/6b85067djw6dbydsnam1xj.jpg",
 +
            "in_reply_to_user_id" : "",
 +
            "id" : 4023064087,
 +
            "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
 +
        },
 +
        "in_reply_to_status_id" : "",
 +
        "annotations" :
 +
        [
  
  {
+
        ],
    "created_at":"Fri Jan 08 11:58:10 +0800 2010",
+
        "in_reply_to_screen_name" : "",
    "id":203097,
+
        "geo" : null,
    "text":"dddddddddddd",
+
        "user" :  
    "source":"<a id=\"10013\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">SinaDestTop</a>",
+
        {
    "user":
+
            "name" : "zhangwei217245",
        {"id":11055,
+
            "domain" : "zhangwei217245",
          "screen_name":"name_11055",
+
            "geo_enabled" : true,
          "name":"name_11055",
+
            "followers_count" : 22,
          "province":"0",
+
            "statuses_count" : 108,
          "city":"0",
+
            "favourites_count" : 3,
          "location":"",
+
            "city" : "5",
          "description":"",
+
            "description" : "ABCDE",
          "url":"",
+
            "verified" : false,
          "profile_image_url":"http://tp4.sinaimg.cn/11055/50/0",
+
            "id" : 1658122963,
          "domain":"11055",
+
            "gender" : "m",
          "followers_count":24,
+
            "friends_count" : 43,
          "friends_count":51,
+
            "screen_name" : "zhangwei217245",
          "statuses_count":0,
+
            "allow_all_act_msg" : false,
          "favourites_count":0,
+
            "following" : false,
          "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
            "url" : "",
          "following":false,
+
            "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
          "geo_enabled":false,
+
            "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
          "verified":false},
+
            "province" : "11",
    "status":{"created_at":"Fri Jan 08 10:18:05 +0800 2010",
+
            "location" : "北京 朝阳区"
          "id":142314,
+
        },
          "text":"lsdjfl55",
+
        "favorited" : false,
          "source":"<a id=\"10013\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">SinaDestTop</a>",
+
        "in_reply_to_user_id" : "",
          "favorited":false,
+
        "id" : 4023227965,
          "truncated":false,
+
        "source" : "<a href=\"http://t.sina.com.cn\" rel=\"nofollow\">新浪微博</a>"
          "in_reply_to_status_id":"",
+
          "in_reply_to_user_id":"",
+
          "in_reply_to_screen_name":"",
+
          "geo":null,
+
          "user":{"id":11075,
+
                "screen_name":"name_11075",
+
                "name":"name_11075",
+
                "province":"0",
+
                "city":"0",
+
                "location":"",
+
                "description":"",
+
                "url":"",              
+
                "profile_image_url":"http://tp4.sinaimg.cn/11075/50/0",
+
                "domain":"11075",
+
                "followers_count":28,
+
                "friends_count":50,
+
                "statuses_count":0,
+
                "favourites_count":34,
+
                "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
                "following":false,
+
                "geo_enabled":false,
+
                "verified":true}
+
          },
+
    "reply_comment":
+
        {"created_at":"Fri Jan 08 11:55:56 +0800 2010",
+
          "id":203094,
+
          "text":"ccccccc",
+
          "source":"<a id=\"10013\" href=\"http://t.sina.com.cn/\" rel=\"nofollow\">SinaDestTop</a>",
+
          "user":{"id":11055,
+
                "screen_name":"name_11055",
+
                "name":"name_11055",
+
                "province":"0",
+
                "city":"0",
+
                "location":"",
+
                "description":"",
+
                "url":"",
+
                "profile_image_url":"http://tp4.sinaimg.cn/11055/50/0",
+
                "domain":"11055",
+
                "followers_count":24,
+
                "friends_count":51,
+
                "statuses_count":0,
+
                "favourites_count":0,
+
                "created_at":"Thu Jan 01 08:00:00 +0800 1970",
+
                "following":false,
+
                "geo_enabled":false,
+
                "verified":false}
+
          }
+
 
     }
 
     }
 
+
}
=== 使用示例===
+
</pre>|
需修改appkey
+
useAge=
* xml:
+
* 为防止重复提交,发表的评论与上次发表的评论内容相同的时候,将返回400错误。
curl -u uid:password -d "source=appkey&id=12345&status=playing with cURL and the Sina API" http://api.t.sina.com.cn/statuses/reply.xml
+
* 如果id及cid不存在,将返回400错误
 
+
* 如果没有提供cid或cid非法,而id参数正确,则为对微博的评论。发表评论的返回格式参见[[statuses/comment]]|
* json:
+
otherInfo=
 
+
===PHP示例===
curl -u uid:password -d "source=appkey&id=12345&status=playing with cURL and the Sina API" http://api.t.sina.com.cn/statuses/reply.json
+
请从 [[SDK | 微博SDK开发包下载]] 处下载PHP SDK(支持OAuth验证之版本)<br>
====PHP示例====
+
代码示例如下:
 
<pre>
 
<pre>
 
//Statuses/reply
 
//Statuses/reply
$c = new WeiboClient( WB_AKEY , WB_SKEY , $_SESSION['last_key']['oauth_token'] , $_SESSION['last_key']['oauth_token_secret']  );
+
$c = new WeiboClient( WB_AKEY ,  
 +
                      WB_SKEY ,  
 +
                      $_SESSION['last_key']['oauth_token'] ,  
 +
                      $_SESSION['last_key']['oauth_token_secret']  );
 
//to be filled in
 
//to be filled in
 
$sid='sid';
 
$sid='sid';
第222行: 第434行:
 
$msg=$c->reply($sid, $comment,$cid);
 
$msg=$c->reply($sid, $comment,$cid);
 
echo($msg['text'];
 
echo($msg['text'];
 
 
//users/show
 
//根据用户ID获取用户资料(授权用户)
 
$c = new WeiboClient( WB_AKEY , WB_SKEY , $_SESSION['last_key']['oauth_token'] , $_SESSION['last_key']['oauth_token_secret']  );
 
//用户ID
 
$u_id = "u_id";
 
$msg = $c->show_user($u_id);
 
if ($msg === false || $msg === null){
 
echo "Error occured";
 
return false;
 
}
 
if (isset($msg['error_code']) && isset($msg['error'])){
 
echo ('Error_code: '.$msg['error_code'].';  Error: '.$msg['error'] );
 
return false;
 
}
 
echo($msg['id'].' : '.$msg['name'].'  '.$msg['created_at']);
 
 
</pre>
 
</pre>
 +
}}

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

目录

statuses/reply

回复评论。请求必须用POST方式提交。

URL

http://api.t.sina.com.cn/statuses/reply.(json%7Cxml)

支持格式

XML/JSON

HTTP请求方式

POST

是否需要登录

true
关于授权机制,参见授权机制声明

请求数限制

true
关于请求数限制,参见接口访问权限说明

请求参数

  必选 类型及范围 说明
source true string 申请应用时分配的AppKey,调用接口时候代表应用的唯一身份。(采用OAuth授权方式不需要此参数)
cid true int64 要回复的评论ID。
comment true string 要回复的评论内容。必须做URLEncode,信息内容不超过140个汉字。
id true int64 要评论的微博消息ID
without_mention false int 1:回复中不自动加入“回复@用户名”,0:回复中自动加入“回复@用户名”.默认为0.

注意事项

  • 为防止重复提交,发表的评论与上次发表的评论内容相同的时候,将返回400错误。
  • 如果id及cid不存在,将返回400错误
  • 如果没有提供cid或cid非法,而id参数正确,则为对微博的评论。发表评论的返回格式参见statuses/comment

返回结果

XML示例

<?xml version="1.0" encoding="UTF-8"?>
<comment>
  <created_at>Fri Dec 03 10:39:36 +0800 2010</created_at>
  <id>4977147033</id>
  <text>回复@zhangwei217245:wakawaka</text>
  <source>
    <a href="http://open.t.sina.com.cn">微博开放平台接口</a>
  </source>
  <user>
    <id>1658122963</id>
    <screen_name>zhangwei217245</screen_name>
    <name>zhangwei217245</name>
    <province>11</province>
    <city>5</city>
    <location>北京 朝阳区</location>
    <description>ABCDE</description>
    <url/>
    <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
    <domain>zhangwei217245</domain>
    <gender>m</gender>
    <followers_count>22</followers_count>
    <friends_count>43</friends_count>
    <statuses_count>115</statuses_count>
    <favourites_count>3</favourites_count>
    <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
    <following>false</following>
    <verified>false</verified>
    <allow_all_act_msg>false</allow_all_act_msg>
    <geo_enabled>true</geo_enabled>
    <status>
      <created_at>Thu Dec 02 17:23:52 +0800 2010</created_at>
      <id>4023418959</id>
      <text>哎呀妈呀,终于找到组织了。</text>
      <source>
        <a href="http://t.sina.com.cn">新浪微博</a>
      </source>
      <favorited>false</favorited>
      <truncated>false</truncated>
      <geo/>
      <in_reply_to_status_id/>
      <in_reply_to_user_id/>
      <in_reply_to_screen_name/>
      <retweeted_status>
        <created_at>Thu Dec 02 17:23:03 +0800 2010</created_at>
        <id>4023402439</id>
        <text>再看看在哪AGAIN</text>
        <source>
          <a href="">微博开放平台接口</a>
        </source>
        <favorited>false</favorited>
        <truncated>false</truncated>
        <geo xmlns:georss="http://www.georss.org/georss">
          <georss:point>39.984833 116.310005</georss:point>
        </geo>
        <in_reply_to_status_id/>
        <in_reply_to_user_id/>
        <in_reply_to_screen_name/>
        <user>
          <id>1658122963</id>
          <screen_name>zhangwei217245</screen_name>
          <name>zhangwei217245</name>
          <province>11</province>
          <city>5</city>
          <location>北京 朝阳区</location>
          <description>ABCDE</description>
          <url/>
          <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
          <domain>zhangwei217245</domain>
          <gender>m</gender>
          <followers_count>22</followers_count>
          <friends_count>43</friends_count>
          <statuses_count>113</statuses_count>
          <favourites_count>3</favourites_count>
          <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
          <following>false</following>
          <verified>false</verified>
          <allow_all_act_msg>false</allow_all_act_msg>
          <geo_enabled>true</geo_enabled>
        </user>
      </retweeted_status>
      <annotations/>
    </status>
  </user>
  <status>
    <created_at>Thu Dec 02 17:14:39 +0800 2010</created_at>
    <id>4023227965</id>
    <text>哇哈哈。随便输了个经纬度,就跑到海里去发微博了</text>
    <source>
      <a href="http://t.sina.com.cn">新浪微博</a>
    </source>
    <favorited>false</favorited>
    <truncated>false</truncated>
    <geo/>
    <in_reply_to_status_id/>
    <in_reply_to_user_id/>
    <in_reply_to_screen_name/>
    <user>
      <id>1658122963</id>
      <screen_name>zhangwei217245</screen_name>
      <name>zhangwei217245</name>
      <province>11</province>
      <city>5</city>
      <location>北京 朝阳区</location>
      <description>ABCDE</description>
      <url/>
      <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
      <domain>zhangwei217245</domain>
      <gender>m</gender>
      <followers_count>22</followers_count>
      <friends_count>43</friends_count>
      <statuses_count>108</statuses_count>
      <favourites_count>3</favourites_count>
      <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
      <following>false</following>
      <verified>false</verified>
      <allow_all_act_msg>false</allow_all_act_msg>
      <geo_enabled>true</geo_enabled>
    </user>
    <retweeted_status>
      <created_at>Thu Dec 02 17:06:40 +0800 2010</created_at>
      <id>4023064087</id>
      <text>abc</text>
      <source>
        <a href="">微博开放平台接口</a>
      </source>
      <favorited>false</favorited>
      <truncated>false</truncated>
      <geo xmlns:georss="http://www.georss.org/georss">
        <georss:point>39.8765 119.5678</georss:point>
      </geo>
      <in_reply_to_status_id/>
      <in_reply_to_user_id/>
      <in_reply_to_screen_name/>
      <thumbnail_pic>http://ww2.sinaimg.cn/thumbnail/6b85067djw6dbydsnam1xj.jpg</thumbnail_pic>
      <bmiddle_pic>http://ww2.sinaimg.cn/bmiddle/6b85067djw6dbydsnam1xj.jpg</bmiddle_pic>
      <original_pic>http://ww2.sinaimg.cn/large/6b85067djw6dbydsnam1xj.jpg</original_pic>
      <user>
        <id>1803880061</id>
        <screen_name>LoopB</screen_name>
        <name>LoopB</name>
        <province>11</province>
        <city>8</city>
        <location>北京 海淀区</location>
        <description/>
        <url/>
        <profile_image_url>http://tp2.sinaimg.cn/1803880061/50/0/0</profile_image_url>
        <domain/>
        <gender>f</gender>
        <followers_count>1</followers_count>
        <friends_count>1</friends_count>
        <statuses_count>14</statuses_count>
        <favourites_count>4</favourites_count>
        <created_at>Fri Aug 27 00:00:00 +0800 2010</created_at>
        <following>false</following>
        <verified>false</verified>
        <allow_all_act_msg>false</allow_all_act_msg>
        <geo_enabled>true</geo_enabled>
      </user>
    </retweeted_status>
    <annotations/>
  </status>
  <reply_comment>
    <created_at>Thu Dec 02 17:25:25 +0800 2010</created_at>
    <id>4949855625</id>
    <text>小新小新。。。我是小浪~~~</text>
    <user>
      <id>1658122963</id>
      <screen_name>zhangwei217245</screen_name>
      <name>zhangwei217245</name>
      <province>11</province>
      <city>5</city>
      <location>北京 朝阳区</location>
      <description>ABCDE</description>
      <url/>
      <profile_image_url>http://tp4.sinaimg.cn/1658122963/50/1282754213</profile_image_url>
      <domain>zhangwei217245</domain>
      <gender>m</gender>
      <followers_count>22</followers_count>
      <friends_count>43</friends_count>
      <statuses_count>115</statuses_count>
      <favourites_count>3</favourites_count>
      <created_at>Tue Nov 03 00:00:00 +0800 2009</created_at>
      <following>false</following>
      <verified>false</verified>
      <allow_all_act_msg>false</allow_all_act_msg>
      <geo_enabled>true</geo_enabled>
    </user>
  </reply_comment>
</comment>

JSON示例

{
    "id" : 4977097789,
    "text" : "回复@zhangwei217245:walala",
    "created_at" : "Fri Dec 03 10:37:39 +0800 2010",
    "source" : "<a href=\"http://open.t.sina.com.cn\" rel=\"nofollow\">微博开放平台接口</a>",
    "reply_comment" : 
    {
        "id" : 4949855625,
        "text" : "小新小新。。。我是小浪~~~",
        "created_at" : "Thu Dec 02 17:25:25 +0800 2010",
        "user" : 
        {
            "name" : "zhangwei217245",
            "domain" : "zhangwei217245",
            "geo_enabled" : true,
            "followers_count" : 22,
            "statuses_count" : 115,
            "favourites_count" : 3,
            "city" : "5",
            "description" : "ABCDE",
            "verified" : false,
            "id" : 1658122963,
            "gender" : "m",
            "friends_count" : 43,
            "screen_name" : "zhangwei217245",
            "allow_all_act_msg" : false,
            "following" : false,
            "url" : "",
            "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
            "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
            "province" : "11",
            "location" : "北京 朝阳区"
        }
    },
    "user" : 
    {
        "name" : "zhangwei217245",
        "domain" : "zhangwei217245",
        "geo_enabled" : true,
        "followers_count" : 22,
        "statuses_count" : 115,
        "favourites_count" : 3,
        "city" : "5",
        "description" : "ABCDE",
        "verified" : false,
        "status" : 
        {
            "created_at" : "Thu Dec 02 17:23:52 +0800 2010",
            "text" : "哎呀妈呀,终于找到组织了。",
            "truncated" : false,
            "retweeted_status" : 
            {
                "created_at" : "Thu Dec 02 17:23:03 +0800 2010",
                "text" : "再看看在哪AGAIN",
                "truncated" : false,
                "in_reply_to_status_id" : "",
                "in_reply_to_screen_name" : "",
                "geo" : 
                {
                    "type" : "Point",
                    "coordinates" : 
                    [
                        39.984833,
                        116.310005
                    ]
                },
                "user" : 
                {
                    "name" : "zhangwei217245",
                    "domain" : "zhangwei217245",
                    "geo_enabled" : true,
                    "followers_count" : 22,
                    "statuses_count" : 113,
                    "favourites_count" : 3,
                    "city" : "5",
                    "description" : "ABCDE",
                    "verified" : false,
                    "id" : 1658122963,
                    "gender" : "m",
                    "friends_count" : 43,
                    "screen_name" : "zhangwei217245",
                    "allow_all_act_msg" : false,
                    "following" : false,
                    "url" : "",
                    "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
                    "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
                    "province" : "11",
                    "location" : "北京 朝阳区"
                },
                "favorited" : false,
                "in_reply_to_user_id" : "",
                "id" : 4023402439,
                "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
            },
            "in_reply_to_status_id" : "",
            "annotations" : 
            [

            ],
            "in_reply_to_screen_name" : "",
            "geo" : null,
            "favorited" : false,
            "in_reply_to_user_id" : "",
            "id" : 4023418959,
            "source" : "<a href=\"http://t.sina.com.cn\" rel=\"nofollow\">新浪微博</a>"
        },
        "id" : 1658122963,
        "gender" : "m",
        "friends_count" : 43,
        "screen_name" : "zhangwei217245",
        "allow_all_act_msg" : false,
        "following" : false,
        "url" : "",
        "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
        "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
        "province" : "11",
        "location" : "北京 朝阳区"
    },
    "status" : 
    {
        "created_at" : "Thu Dec 02 17:14:39 +0800 2010",
        "text" : "哇哈哈。随便输了个经纬度,就跑到海里去发微博了",
        "truncated" : false,
        "retweeted_status" : 
        {
            "created_at" : "Thu Dec 02 17:06:40 +0800 2010",
            "text" : "abc",
            "bmiddle_pic" : "http://ww2.sinaimg.cn/bmiddle/6b85067djw6dbydsnam1xj.jpg",
            "original_pic" : "http://ww2.sinaimg.cn/large/6b85067djw6dbydsnam1xj.jpg",
            "truncated" : false,
            "in_reply_to_status_id" : "",
            "in_reply_to_screen_name" : "",
            "geo" : 
            {
                "type" : "Point",
                "coordinates" : 
                [
                    39.8765,
                    119.5678
                ]
            },
            "user" : 
            {
                "name" : "LoopB",
                "domain" : "",
                "geo_enabled" : true,
                "followers_count" : 1,
                "statuses_count" : 14,
                "favourites_count" : 4,
                "city" : "8",
                "description" : "",
                "verified" : false,
                "id" : 1803880061,
                "gender" : "f",
                "friends_count" : 1,
                "screen_name" : "LoopB",
                "allow_all_act_msg" : false,
                "following" : false,
                "url" : "",
                "profile_image_url" : "http://tp2.sinaimg.cn/1803880061/50/0/0",
                "created_at" : "Fri Aug 27 00:00:00 +0800 2010",
                "province" : "11",
                "location" : "北京 海淀区"
            },
            "favorited" : false,
            "thumbnail_pic" : "http://ww2.sinaimg.cn/thumbnail/6b85067djw6dbydsnam1xj.jpg",
            "in_reply_to_user_id" : "",
            "id" : 4023064087,
            "source" : "<a href=\"\" rel=\"nofollow\">微博开放平台接口</a>"
        },
        "in_reply_to_status_id" : "",
        "annotations" : 
        [

        ],
        "in_reply_to_screen_name" : "",
        "geo" : null,
        "user" : 
        {
            "name" : "zhangwei217245",
            "domain" : "zhangwei217245",
            "geo_enabled" : true,
            "followers_count" : 22,
            "statuses_count" : 108,
            "favourites_count" : 3,
            "city" : "5",
            "description" : "ABCDE",
            "verified" : false,
            "id" : 1658122963,
            "gender" : "m",
            "friends_count" : 43,
            "screen_name" : "zhangwei217245",
            "allow_all_act_msg" : false,
            "following" : false,
            "url" : "",
            "profile_image_url" : "http://tp4.sinaimg.cn/1658122963/50/1282754213",
            "created_at" : "Tue Nov 03 00:00:00 +0800 2009",
            "province" : "11",
            "location" : "北京 朝阳区"
        },
        "favorited" : false,
        "in_reply_to_user_id" : "",
        "id" : 4023227965,
        "source" : "<a href=\"http://t.sina.com.cn\" rel=\"nofollow\">新浪微博</a>"
    }
}

其他

PHP示例

请从 微博SDK开发包下载 处下载PHP SDK(支持OAuth验证之版本)
代码示例如下:

//Statuses/reply
$c = new WeiboClient( WB_AKEY , 
                      WB_SKEY , 
                      $_SESSION['last_key']['oauth_token'] , 
                      $_SESSION['last_key']['oauth_token_secret']  );
//to be filled in
$sid='sid';
$comment='comment';
$cid='cid';
$msg=$c->reply($sid, $comment,$cid);
echo($msg['text'];
文档更新时间: 2012-09-24