bguiz
bguiz

Reputation: 28627

exportLinks missing in files.list() and files.get() in google drive API for google document

When obtaining a File resource, and that file is a Google document, that file is supposed to have an exportLinks object.

When I do this from my NodeJs client, I do get a file with many of the fields, but exportLinks is missing. When I used the Try It! section in their documentation, exportLinks is indeed present, for the same file. The only discernible difference is that my request uses an Authorization header, whereas the "Try it" section appears to use a key query param.

When do exportLinks get dropped?


More details:

Am using google-auth and googleapis to issue my requests, and other APIs I am calling appears to work fine.

Also considered that it was a scope-permissions thing, and tried using the broadest scope for google drive - https://github.com/google/google-api-nodejs-client - however this made no difference.

Upvotes: 1

Views: 454

Answers (1)

Kalyan Reddy
Kalyan Reddy

Reputation: 1142

You are right that this is occurring because you aren't using a permissive enough scope. Make sure you are using the right scope though. What you pasted above is wrong. In my testing, I did not get exportLinks when I used the 'https://www.googleapis.com/auth/drive.metadata.readonly' scope, but when I added the full scope ('https://www.googleapis.com/auth/drive'), I was able to get the exportLinks as expected.

Upvotes: 4

Related Questions