我需要获取Google文档修订的详细列表.
在以下位置使用Google API Explorer时:
GET https://www.googleapis.com/drive/v3/files/{fileId}/revisions
Run Code Online (Sandbox Code Playgroud)
我只得到非详细列表.
要调用的API(或要设置的参数)是什么,以便通过按下显示更详细的修订来看到类似的内容?
更新:
我试图"嗅探"浏览器流量,我意识到Google云端硬盘会定期向网址请求修订列表:
https://docs.google.com/spreadsheets/d/{fileId}/revisions/history?id={fileId}&start=1&end=-1&zoom_level=0&token={token}
Run Code Online (Sandbox Code Playgroud)
单击显示更详细的修订时,以前的URL将变为:
https://docs.google.com/spreadsheets/d/{fileId}/revisions/history?id={fileId}&start=1&end=-1&zoom_level=1&token={token}
Run Code Online (Sandbox Code Playgroud)
(zoom_level参数从0变为1)但是
我在API参考上找不到类似的东西.似乎必须手动调用这样的URL.
因此,我手动为驱动器范围生成一个令牌,手动检查它以保持新鲜并手动调用该URL,以便查看发生了什么.不幸的是,我在浏览器上遇到以下错误:
Impossibile aprire il file in questo momento.
Verifica l'indirizzo e riprova.
Run Code Online (Sandbox Code Playgroud)
这大致意味着:
Unable to open the file at the moment.
Please verify the address and try again.
Run Code Online (Sandbox Code Playgroud)
有人能指出我朝着正确的方向前进吗?
我正在尝试使用Google Calendar v3 API重写我以前没写过的遗留应用程序.
我已经实现了google-api-php-client,在我的开发者控制台中创建了一个API密钥,并完成了身份验证过程.我有一个accessToken我坚持在数据库中,当它到期时,我可以刷新该令牌罚款.
但是,我根本无法使用日历.
我正在关注那里已有的有限文档并具有以下内容:
$this->client = new Google_Client();
$this->client->setClientId( $this->settings['clientId'] );
$this->client->setClientSecret( $this->settings['clientSecret'] );
$this->client->setAccessToken( $this->settings['accessToken'] );
$service = new Google_Service_Calendar($this->client);
$calendarList = $service->calendarList->listCalendarList();
while(true) {
foreach ($calendarList->getItems() as $calendarListEntry) {
echo $calendarListEntry->getSummary();
}
$pageToken = $calendarList->getNextPageToken();
if ($pageToken) {
$optParams = array('pageToken' => $pageToken);
$calendarList = $service->calendarList->listCalendarList($optParams);
} else {
break;
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
Message: Undefined property: Google_Service_Calendar_CalendarList::$items
Run Code Online (Sandbox Code Playgroud)
我已经检查了我的Google日历帐户并且所有日历都是共享的,所以应该没有问题,虽然我不明白为什么这是一个问题,因为我正在使用经过身份验证的帐户.
有人能提供建议吗?
非常感谢