【发布时间】:2013-04-14 13:56:41
【问题描述】:
我想将我的状态分享给 google plus。
我遵循了 google api,但我收到了未经授权的错误。我试图修复它超过 2 天,但我不能..
我阅读了这个答案,我下载并测试了 api,但仍然不适合我。
401 Unauthorized access when posting Google+ Moments with PHP Client
你可以在这里查看,
https://code.google.com/p/google-api-php-client/source/browse/trunk/examples/moments/simple.php
在这个主干文件中,他们仍然在调用 Google_PlusMomentsService.php
我尝试了以下代码,但仍然无法正常工作 - https://developers.google.com/+/api/latest/moments/insert
这是我正在测试的实时链接:http://webscarlets.in/projects/babblesuite/gplus/index.php
这是我用来分享状态的代码
$target = new Google_ItemScope();
$target->url = 'https://developers.google.com/+/plugins/snippet/examples/thing';
$moment = new Google_Moment();
$moment->type = "http://schemas.google.com/AddActivity";
$moment->target = $target;
// Execute the request
$moments->moments->insert('me', 'vault', $moment);
print '<p>Created an AddActivity moment</p>';
谁能解决它。
谢谢大家
【问题讨论】:
标签: php google-plus google-api-php-client