0

I am trying to get revision feed for an existing document in Google Docs (actually I just need revision count). I use the code below and get a GDataRequestException. The inner exception is 404 while the response string is (document id is truncated):

<errors xmlns='http://schemas.google.com/g/2005'>
  <error>
    <domain>GData</domain>
    <code>ResourceNotFoundException</code>
    <internalReason>Invalid document id: file:0BxwzFL2fD0</internalReason>
  </error>
</errors>

And here is the code:

var documentsService = new DocumentsService("myappname");
documentsService.SetAuthenticationToken(token);

var uri = string.Format("https://docs.google.com/feeds/default/private/full/{0}/revisions", Uri.EscapeDataString(resourceId));
var query = new DocumentsListQuery(uri);
var feed = documentsService.Query(query);
4

2 回答 2

0

您使用的 resourceId 似乎无效。与其手动构造 uri,不如使用要检索其修订的 DocumentEntry 实例的 RevisionDocument 属性:

var uri = entry.RevisionDocument;
于 2011-07-18T22:28:28.207 回答
0
var documentsRequest = new DocumentsRequest();

// ... do any authentication here..

var revisions = documentsRequest.Get<Google.Documents.Document>(entry.RevisionDocument).Entries;
于 2011-07-20T13:14:48.287 回答