Home > Backend Development > PHP Tutorial > 腾讯微博API接口的有关问题

腾讯微博API接口的有关问题

WBOY
Release: 2016-06-13 11:21:21
Original
806 people have browsed it

腾讯微博API接口的问题
从数据库里读取openid和openkey,然后发图文的腾讯微博(其他网站图片),我按照demo.php写了一段简单的程序,但是运行的时候总报错
{"data":null,"detailerrinfo":{"accesstoken":"","apiname":"weibo.t.add_pic_url","appkey":"801340003","clientip":"222.73.219.176","cmd":0,"proctime":0,"ret1":3,"ret2":3,"ret3":34,"ret4":3743515914,"timestamp":1365576080},"errcode":34,"msg":"check sign error","ret":3,"seqid":1365576082}
我把demo.php直接扔到测试地址还是报这个错。。。。哪位大神知道为什么?
代码我只是把这个内容改了,其他地方没动,
$params = array(
        'content' => '以链接形式发表一条图片微博',
        'pic_url' => 'http://test.**.com/29/32/1365575279819.jpg'
    );
    $r = Tencent::api('t/add_pic_url', $params, 'POST');
    echo $r;

腾讯微博 API 报错
------解决方案--------------------
使用接口之前,是先要验证的,就是在实例化时要传入openid和$access_token这2个值
即$qq = new QC($access_token,$openid);
这2个值是在会员登录时获取到的,这2个值在会员登录时你可以保存到数据库去,需要的时候再读取出来就是了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template