开发者

How to get previous versions of a spreadsheet with Google Docs API?

开发者 https://www.devze.com 2022-12-29 04:43 出处:网络
The \"previous version\" interface on Google Docs is very primitive. It wouldn\'t even allow you t开发者_开发百科o select two arbitrary versions for comparison (but correct me if I\'m wrong.)

The "previous version" interface on Google Docs is very primitive. It wouldn't even allow you t开发者_开发百科o select two arbitrary versions for comparison (but correct me if I'm wrong.)

How can I access the previous versions via the API?


The Protocol Guide for Document List API (v3.0) says that document revisions and arbitrary file revisions are available via the revisions feed.

So you can get revisions for a particular document with:

GET /feeds/default/private/full/<resource_id>/revisions HTTP/1.1

When exporting contents for any single document, revisions are basically accessed with
Export?docId=<doc_id>&revision=0

You should be able to construct those URIs yourself with the help of the Java or .NET libraries for the Documents List API. It's my understanding that they are still labs projects though.

See more at: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#RevisionHistory


I remember reading somewhere that Google is doing an overhaul of their client libraries, so it might be smart to wait for Google I/O 2011 for example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号