Google REST API v3 - 修订:列表vs"显示更详细的修订“ [英] Google REST API v3 - Revisions:list vs "Show more detailed revisions"

查看:85
本文介绍了Google REST API v3 - 修订:列表vs"显示更详细的修订“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获取Google文档修订版的详细清单。

在以下版本上使用Google API Explorer时:

  GET https://www.googleapis.com/drive/v3/files/{fileId}/revisions 

我只得到非详细列表。



要调用的API(或要设置的参数)类似于按显示更详细的修订?可以看到的内容?



更新:

我试图嗅探浏览器流量,并且我意识到Google Drive会定期向网址请求修订列表:

  https ://docs.google.com/spreadsheets/d/ {fileId} / revisions / history?id = {fileId}& start = 1& end = -1& zoom_level = 0& token = {token} 

点击显示更详细的修订时,以前的网址变为:

  https://docs.google.com/spreadsheets/d/ {fileId} / revis ion / history?id = {fileId}& start = 1& end = -1& zoom_level = 1& token = {token} 

zoom_level 参数从 0 更改为 1

我找不到任何东西尽管如此,在API参考上也是如此。看起来这样的URL必须手动调用。

因此,我手动为驱动器范围生成了一个令牌,并手动对其进行了检查,以便保持其新鲜和手动调用该URL,以便查看发生了什么。不幸的是,我在浏览器中出现了以下错误:

 在需要的时候无法访问。 
Verifica l'indirizzo e riprova。

这大致意味着:

 目前无法打开文件。 
请验证地址并重试。

可能有人指着我走向正确的方向吗?

解决方案

试试看 API的部分有一个名为fields的字段。在那里你可以从响应中选择你需要的文件。如果你写kind,revisions,你会得到完整的信息,或者你可以使用fields editor来选择你需要的字段。

I need to get the detailed list of the revisions for a Google Document.
When using the Google API Explorer on:

GET https://www.googleapis.com/drive/v3/files/{fileId}/revisions

I get only the non-detailed list.

Which is the API to call (or the parameter to set) in order to get something similar to what can be seen by pressing Show more detailed revisions?

Update:
I tried to "sniff" the browser traffic and I realized that Google Drive periodically requests the revision list to the URL:

https://docs.google.com/spreadsheets/d/{fileId}/revisions/history?id={fileId}&start=1&end=-1&zoom_level=0&token={token}

When clicking on Show more detailed revisions, the previous URL becomes:

https://docs.google.com/spreadsheets/d/{fileId}/revisions/history?id={fileId}&start=1&end=-1&zoom_level=1&token={token}

(the zoom_level parameter changes from 0 to 1)
I cannot find anything like that on the API reference, though. It seems that such an URL has to be invoked manually.
Therefore, I manually generated a token for the drive scope, manually checked it in order to keep it fresh and manually invoked that URL, in order to see what happened. Unfortunately, I got the following error on the browser:

Impossibile aprire il file in questo momento.
Verifica l'indirizzo e riprova.

which roughly means:

Unable to open the file at the moment.
Please verify the address and try again.

May somebody point me towards the right direction?

解决方案

In the "Try it" section of the API there is a field called "fields". In there you can select the files you need from the response. If you write "kind,revisions" you will get the complete information or you can use the "fields editor" to select the fields you need.

这篇关于Google REST API v3 - 修订:列表vs"显示更详细的修订“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆