1

我想在 google plus 帐户上发布给任何验证我的应用程序的用户我已经创建了 G-Suite 帐户,我也可以在 google plus 帐户上发布,但我不能在其他已经完成应用程序验证的用户帐户上发布我想要该功能就像 www.buffer.com 应用程序一样,他们可以轻松地在所有已验证 google 个人资料的用户上发布,所以我想知道他们如何在 google 帐户上发布,而我无法在 google+ 帐户上上传活动。

    $service = new Google_Service_PlusDomains($client);

$activity = new Google_Service_PlusDomains_Activity(
array(
'access' => array(
  'items' => array(
      'type' => 'domain'
  ),
  'domainRestricted' => true
),
'verb' => 'post',
'object' => array(
  'originalContent' => "Post using Google API PHP Client Library! 1" ,
  'attachments' => ['image'=>array('url'=>$img_path)]
), 

)
);

$newActivity = $service->activities->insert($user->id, $activity);    

var_dump($newActivity);

它将成功发布在我的 google plus 帐户上,这意味着我的 G-suit 帐户登录,但是每当我尝试将帖子发送到其他帐户时,就无法在其他普通帐户上发送帖子,它会给我带来错误,例如

错误 :

"error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
4

1 回答 1

1

Domains API 仅供G Suite 用户使用。谁创建应用程序并不重要,重要的是每个特定请求中的特定帐户凭据。

于 2017-05-13T14:14:35.090 回答