0

I am trying to read the google doc using drive api. When I print the file metadata it prints as below:

[s~sakshumweb-hrd/3.370043974717039698].<stdout>: invite_friends_email:{"displayName":"Vivek Kumar","isAuthenticatedUser":true,"kind":"drive#user","permissionId":"13178633125197568962","picture":{"url":"https://lh5.googleusercontent.com/-4ElLv3j4-eI/AAAAAAAAAAI/AAAAAAAAAfQ/3b6TZenyTyA/s64/photo.jpg"}}

I 2013-09-06 19:35:41.489
[s~sakshumweb-hrd/3.370043974717039698].<stdout>: Download url is:null

The code printing it is as below:

System.out.println(file.getTitle() + ":" + file.getOwners().get(0) );
System.out.println("Download url is:" + file.getDownloadUrl());

Any idea why it comes null? Ultimately I want to read the file contents in my GAE for java code. So, if there is any other way to read then that would be fine too.

1 Answer 1

1

Look at the complete item metadata. If there is no download URL, it is usually because the document is a native Google Doc, in which case you should use exportLinks in place of downloadUrl. Another possibility is that you only have metadata scope, so don't have permission to access the content.

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.