私はphpを使ってgoogle plusに投稿したいと思います。しかし、グーグルプラス "403禁じられた"を返す 私はそれを可能にするコードを私に与えて欲しい。google plus phpでの投稿
これは私の認証機能である:
global $client;
$client->setAuthConfig("/home/----");
$client->setRedirectUri("----");
$client->addScope("https://www.googleapis.com/auth/plus.stream.write");
$client->addScope("https://www.googleapis.com/auth/plus.me");
$authUrl = $client->createAuthUrl();
header("Location: $authUrl");
die;
そして、これは私の新しいポスト機能である:
$client->setAccessToken($token);
$plus = new Google_Service_Plus($client);
$plusdomains = new Google_Service_PlusDomains($client);
$postBody = new Google_Service_PlusDomains_Activity();
$postBody['object']['originalContent'] = 'Happy Monday!';
$result = $plusdomains->activities->insert('me', $postBody);
$result = $plus->people->get('me');
$response->getBody()->write(var_export($result, true));
が、結果は次のとおりです。
{ "error": { "errors": [ { "domain": "global", "reason": "forbidden", "message": "Forbidden" } ], "code": 403, "message": "Forbidden" } }
ご存知のように、多くのサイトGoogle Appsを使用するだけでなく、Google Appsのすべての種類のGoogle Appsに新しいGoogle Appsを使用して新しい投稿を送信できるようになりました(例: le:buffer.com)
正確には、Googleプラスページに投稿したいのですが、どうすればよいですか?そしてバッファーはそれをどのようにしますか? – Alibehtm
Googleドメインアカウントに接続していることを確認する必要があります。あなたは明らかにそうではない – DaImTo
私はあなたを得ていない。私は接続するために何をすべきですか?私の欲しいのは、このようなコードです:私のクライアントは私のアプリに自分のGoogleアカウントを接続し、彼のgoogleプラスページに特定のテキストを投稿 – Alibehtm