Account/get notice
(→json) |
(→Java示例) |
||
第34行: | 第34行: | ||
curl -u uid:password http://api.t.sina.com.cn/account/verify_credentials.json?source=appkey | curl -u uid:password http://api.t.sina.com.cn/account/verify_credentials.json?source=appkey | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
====PHP示例==== | ====PHP示例==== | ||
请从 [[SDK | 微博SDK开发包下载]] 处下载PHP SDK(支持OAuth验证之版本)<br> | 请从 [[SDK | 微博SDK开发包下载]] 处下载PHP SDK(支持OAuth验证之版本)<br> |
2010年10月26日 (二) 11:34的版本
目录 |
account/get_notice
获取用户提醒设置 。
URL
http://api.t.sina.com.cn/account/verify_credentials.format
格式
xml, json
HTTP请求方式
GET
是否需要登录
True
请求数限制
False
关于请求数限制,参见接口访问权限说明
请求参数
无
返回结果:
XML
<?xml version="1.0" encoding="UTF-8"?> <result> <follower>0</follower> <status_type>0</status_type> <from_user>0</from_user> <dm>0</dm> <mention>0</mention> <comment>0</comment> </result>
JSON
{"follower":0,"status_type":0,"from_user":0,"dm":0,"mention":0,"comment":0}
使用示例:
- xml:
curl -u uid:password http://api.t.sina.com.cn/account/verify_credentials.xml?source=appkey
- json:
curl -u uid:password http://api.t.sina.com.cn/account/verify_credentials.json?source=appkey
PHP示例
请从 微博SDK开发包下载 处下载PHP SDK(支持OAuth验证之版本)
代码示例如下:
//account/verify_credentials $c = new WeiboClient( WB_AKEY , WB_SKEY , $_SESSION['last_key']['oauth_token'] , $_SESSION['last_key']['oauth_token_secret'] ); $msg = $c->verify_credentials(); 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; } if (isset($msg['name'])){ echo($msg['name']); }