![](/img/trans.png)
[英]How do I retrieve Google Calendar Resources for my company using the PHP API client?
[英]How do I retrieve Google Calendar Resources PHP API client?
如何使用php-client提取Google日历资源我在这里发现了同样的问题 ,我没有从答案中得到任何帮助。
可以使用下载google admin sdk PHP从我公司的Google日历中获取所有资源吗
我无法在此库中获取任何示例或方法,以了解如何获取房间之类的所有资源。 有任何方法可以从公司的Google日历中获取资源。
这是解决方案
$client = new \Google_Client();
$client->useApplicationDefaultCredentials();
$client->setScopes(['https://www.googleapis.com/auth/admin.directory.resource.calendar','https://www.googleapis.com/auth/admin.directory.resource.calendar.readonly']);
$client->setSubject('user@domain.com');
$directoryService = new \Google_Service_Directory($client);
$resources = $directoryService->resources_calendars->listResourcesCalendars('my_customer')->getItems();
var_dump($resources);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.