Weibo/getreceivecomment

出自天涯开放平台资源

跳转到: 导航, 搜索

目录

Weibo/getreceivecomment

获取所有收到的评论

URL

http://open.tianya.cn/api/weibo/getreceivecomment.php

支持格式

XML/JSON

HTTP请求方式

POST/GET

是否需要登录

true,关于授权机制,参见OAuth相关说明

请求数限制

true,关于请求数限制,参见OAuth相关说明

请求参数

  必选 类型及范围 说明
appkey true string 申请应用时分配的appkey,调用接口时候代表应用的唯一身份
oauth_token true string 授权成功后所获得的 oauth_token
oauth_token_secret true string 授权成功后所获得的oauth_token_secret
timestamp true string 请求时候产生的时间戳time()
tempkey true string strtoupper(md5($timestamp.$appkey.$oauth_token.$oauth_token_secret.$appsecret))
pagesize true int 每页显示条数
page true int 当前页码
outformat false string 可选,返回数据格式,默认为json

注意事项

http://open.tianya.cn/api/weibo/getreceivecomment.php
若取当前用信息错误,则返回400错误,提示:"error_code"=>"40002", "error_msg"=>"request data error若取当前用信息错误,则返回400错误,提示: "error_code"=>"40002", "error_msg"=>"request data error"

返回结果

XML示例

<?xml version="1.0" encoding="utf8"?><data><total>1</total><items><item id="0"><sharedStartype>0</sharedStartype><toUname></toUname><twMedias></twMedias><time>1314607044000</time><sharedTwUname></sharedTwUname><twId>36845804</twId><twTitle>测试,erer,dff</twTitle><id>o168aav6017f9BZgTnAd08/ku6MgVJB3</id><star>0</star><sharedTwReplyCount></sharedTwReplyCount><sharedTwStar>0</sharedTwStar><sharedTwMedias></sharedTwMedias><wordOrigin>teste</wordOrigin><sharedStarurl></sharedStarurl><sharedTwShareCount></sharedTwShareCount><twUname>yiercn</twUname><startype>0</startype><sharedTwId></sharedTwId><twShareCount>1</twShareCount><sharedTwTitle>该微博已删除</sharedTwTitle><word>teste</word><twMediaFlag>0</twMediaFlag><uid>51218315</uid><twUid>51006851</twUid><from>来自天涯微博</from><stardesc></stardesc><uname>opentes	t</uname><toUid>51006851</toUid><twReplyCount>1</twReplyCount><twStar>0</twStar><starurl></starurl><sharedStardesc></sharedStardesc><sharedTwMedia></sharedTwMedia><sharedTwUid></sharedTwUid><twTitleOrigin>测试,erer,dff</twTitleOrigin><twMedia></twMedia></item></items></data><result>1</result><error></error>

JSON示例

 {"data":{"total":1,"items":[{"sharedStartype":0,"toUname":"","twMedias":{},"time":1314607044000,"sharedTwUname":null,"twId":36845804,"twTitle":"测试,erer,dff","id":"o168aav6017f9BZgTnAd08/ku6MgVJB3","star":0,"sharedTwReplyCount":null,"sharedTwStar":0,"sharedTwMedias":{},"wordOrigin":"teste","sharedStarurl":"","sharedTwShareCount":null,"twUname":"yiercn","startype":0,"sharedTwId":null,"twShareCount":1,"sharedTwTitle":"该微博已删除","word":"teste","twMediaFlag":"0","uid":51218315,"twUid":51006851,"from":"来自天涯微博","stardesc":"","uname":"opentest","toUid":51006851,"twReplyCount":1,"twStar":0,"starurl":"","sharedStardesc":"","sharedTwMedia":"","sharedTwUid":null,"twTitleOrigin":"测试,erer,dff","twMedia":""}]},"result":1,"error":""}

PHP示例

SDK下载

代码示例如下: 
include 'tyapi.php'; 
//参数设置 
$appkey=; 
$appsecret=;
$url = 'http://open.tianya.cn/api/weibo/getreceivecomment.php';
$param[‘pagesize’]=2;
$param[‘page’]=1;
$data = do_post($url,$appkey,$appsecret,$_SESSION["oauth_token"],$_SESSION["oauth_token_secret"],$param);
查看
个人工具
成功案例
帮助中心