A question about export url (resource_id and docid)

44 views
Skip to first unread message

fhtino

unread,
Jul 27, 2010, 4:17:50 PM7/27/10
to Google Data APIs .NET Client Library
I don't understand if I must use resource_id or docid in the export
url. Documentation at http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html
always use resource_id. But the .NET Lib sometimes uses resource_id
and sometimes docid.
Also people @Google say I must use docid. An example here:
http://code.google.com/p/gdata-issues/issues/detail?id=2157#c25
I'm very confused.


In class DocumentsRequest the method public Stream Download(Document
document, Document.DownloadType type, string baseDomain, int
sheetNumber) returns urls like this:

http://docs.google.com/feeds/download/documents/Export?docID=document:0AeDN2od9GilmZGdjMmIzaHNfMGNxcWY5cmdi&exportFormat=pdf

A similar method returns a different url:
public Stream Download(Document document, string exportFormat)
gives:

http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=0AuDN2od9GilmdFgyY2JHN2ZxTk9ES2xzaTlURjNVZlE&exportFormat=xls


Perhaps I've not understood the documentation and/or how API works....
so, please.... help. :)


fabrizio

fhtino

unread,
Jul 27, 2010, 4:21:31 PM7/27/10
to Google Data APIs .NET Client Library
2 urls of the previous message are not readable on groups.google.com

Try to write them again


http://docs.google.com/feeds/download/documents/Export?
docID=document:0AeDN2od9GilmZGdjMmIzaHNfMGNxcWY5cmdi
&exportFormat=pdf


http://spreadsheets.google.com/feeds/download/spreadsheets/Export?
key=0AuDN2od9GilmdFgyY2JHN2ZxTk9ES2xzaTlURjNVZlE
&exportFormat=xls



Fabrizio

Edwin

unread,
Jul 28, 2010, 1:06:40 PM7/28/10
to Google Data APIs .NET Client Library
They both look okay. One's a document and the other is a
spreadsheet. These are the urls that google returns in the docList,
and I'm using with success. The only thing you need to do (because
of an API issue that they're working on) is add another parameter for
the export format. In addition to the 'exportFormat' parameter,
there should be a 'format' parameter. They should look like this:

http://docs.google.com/feeds/download/documents/Export?
docID=document:0AeDN2od9GilmZGdjMmIzaHNfMGNxcWY5cmdi
&exportFormat=pdf&format=pdf

http://spreadsheets.google.com/feeds/download/spreadsheets/Export?
key=0AuDN2od9GilmdFgyY2JHN2ZxTk9ES2xzaTlURjNVZlE
&exportFormat=xls&format=xls

They are planning to make is so that you don't need the extra
parameter, but Google says that both the 'format' parameter and the
'exportFormat' parameter will continue to work in the future.

Edwin

unread,
Jul 28, 2010, 4:22:04 PM7/28/10
to Google Data APIs .NET Client Library
I re-looked at your post, and it looks like I didn't fully
understand. I looked at the source code, and found that the
Download method constructs the url using the resourceID in the first
overload, but gets it from the documentEntry's content link in the
second overload.

Submitted an issue report: http://code.google.com/p/google-gdata/issues/detail?id=411

You the man Fabrizio!

Fabrizio Accatino

unread,
Jul 31, 2010, 9:10:24 AM7/31/10
to gdata-dotnet-...@googlegroups.com
Edwin,

I think the issue is more complex. I also opened a discussion on the API Forum:

Then Vic@google opened a issue on Google Data API issue tracker:


   fabrizio

Edwin

unread,
Aug 1, 2010, 10:33:02 PM8/1/10
to Google Data APIs .NET Client Library
If you look at the .net source code, one overload specifically uses
the resourceId to construct the export url (http://code.google.com/p/
google-gdata/source/browse/trunk/clients/cs/src/documents3/
docrequest.cs), while the other overload uses the url in the doclist's
entry's content node. The code that I wrote always uses the url in
the content node and I always get an Url with the docID (instead of
the resourceID). From everything that I've read, we should use the
url in the doclist's content node to export docs.

I think all we have to do is update the .net project, and the problem
is solved.


On Jul 31, 9:10 am, Fabrizio Accatino <fht...@gmail.com> wrote:
> Edwin,
>
> I think the issue is more complex. I also opened a discussion on the API
> Forum:http://www.google.com/support/forum/p/apps-apis/thread?tid=25bd13ea8d...
Reply all
Reply to author
Forward
0 new messages