我正在嘗試使用php閱讀g + fanpage的最新帖子。可惜的是,文件是不是就如何做到這一點的是有幫助的:/使用PHP(捲曲)從g + fanpage閱讀帖子
到目前爲止,我已經試過如下:
<?php
$curlSession = curl_init();
curl_setopt($curlSession, CURLOPT_URL, 'https://www.googleapis.com/plus/v1/people/{userID}/activities/public?key={apikey}');
curl_setopt($curlSession, CURLOPT_BINARYTRANSFER, true);
curl_setopt($curlSession, CURLOPT_RETURNTRANSFER, true);
$jsonData = json_decode(curl_exec($curlSession));
curl_close($curlSession);
{apikey}
和{userID}
是佔位符,當然。我通過開發人員控制檯生成api密鑰,服務器密鑰和瀏覽器密鑰都不會對下面的結果產生任何影響。 Google+ API已啓動。
這是結果:
{
"error":{
"errors":[
{
"domain":"usageLimits",
"reason":"accessNotConfigured",
"message":"Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code":403,
"message":"Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
你有什麼錯什麼建議?我錯過了什麼嗎? 我是否必須爲這種api請求提供帳單信息?
當你說「粉絲專頁」時,你是指Google+社羣還是Google+信息頁? (在這種情況下,區別很重要。) – Prisoner
我正在討論Google+官方頁面。 – tillsanders