Google REST API v3 - Revisions:list vs “Show more detailed revisions”

那年仲夏 提交于 2019-12-31 10:46:25

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/34955515/google-rest-api-v3-revisionslist-vs-show-more-detailed-revisions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!