Statuses/reply/en
(创建新页面为 '{{api_desc2| uri=statuses/reply| desc=Replys a comment. Request must be handed in POST method.| format=XML/JSON| httpMethod=POST| needAuth=true| rateLimit=true| params={{api_arg…') |
|||
第1行: | 第1行: | ||
− | {{ | + | {{api_desc2_en| |
uri=statuses/reply| | uri=statuses/reply| | ||
desc=Replys a comment. Request must be handed in POST method.| | desc=Replys a comment. Request must be handed in POST method.| |
2011年1月20日 (四) 16:33的最后版本
目录 |
statuses/reply
Replys a comment. Request must be handed in POST method.
URL
http://api.t.sina.com.cn/statuses/reply.(json%7Cxml)
Supported Formats
XML/JSON
HTTP Request Method
POST
Requires Authentication
true
See the Authorization Mechanism Statement for authorization details
Requests Count Limitation
true
See the Interface Access Rights Statement for the Request Count Limitaiton details.
Request Parameters
Requires | Type and Range | Description | |
---|---|---|---|
source | true | string | AppKey for the application to identify it. ( This parameter is not needed when using OAuth) |
cid | true | int64 | The comment ID to be replyed |
comment | true | string | Comment content. It have to be encoded by the URLEncode within 140 Chinese characters. |
id | true | int64 | Weibo ID to be replied |
Notes
- In order to prevent from repeately submit, it returns 400 error if the content is same as last one posted by user.
- If id or cid are not exist, it returns 400 error.
- If cid is not provided or is illegal, but id parameter is correct, it means this is a comment of a weibo. For the detail of format of comment returned, see statuses/comment
Example Request
- XML
- curl -u "username:password" -d "cid=4949855625&id=4046214423&comment=wahaha" "http://api.t.sina.com.cn/statuses/reply.xml?source=appkey"
- JSON
- curl -u "username:password" -d "cid=4949855625&id=4046214423&comment=wahaha" "http://api.t.sina.com.cn/statuses/reply.json?source=appkey"
Response
XML Example
<?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 Example
{ "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>" } }
Others
PHP Example
Please download PHP SDK with OAUTH supported from Weibo SDK Development Kit Dowload Site
.
Sample Code:
//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'];
文档更新时间: 2011-01-20