Google API PHP无法传递变量以调用(' list')
我正在尝试使用新的Google Business Profile API运行以下代码:
$mybusinessbusinessinformationService = new Google\Service\MyBusinessBusinessInformation($client);
try
{
$locations = $mybusinessbusinessinformationService->accounts_locations->call('list',['parent'=>'accounts/1111111111111111111']);
var_dump($locations);
} catch(Exception $e){
var_dump(print_r($e->getMessage(),1));
}
但是我遇到以下错误:
(list) missing required param: 'parent'
据我所知,我似乎正在正确解析该参数。
I am trying to run the following code with the new Google Business Profile API:
$mybusinessbusinessinformationService = new Google\Service\MyBusinessBusinessInformation($client);
try
{
$locations = $mybusinessbusinessinformationService->accounts_locations->call('list',['parent'=>'accounts/1111111111111111111']);
var_dump($locations);
} catch(Exception $e){
var_dump(print_r($e->getMessage(),1));
}
But I am getting the following error:
(list) missing required param: 'parent'
As far as I can tell it seems that I am parsing the param properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于正在寻找答案的人:
由于Google更新了API,因此也需要解析清晰度:
您可以在此处找到掩码参数:
https://developers.google.com/mybusiness/mymybusiness/参考/BusinessInformation/REST/V1/位置
For people that are searching for an answer:
Since Google updated its API, it's a requirement to parse readMask as well:
You can find the mask parameters here:
https://developers.google.com/my-business/reference/businessinformation/rest/v1/locations