0
votes

When using the Google Drive File API I want to find a file or folder by its name and return the link you would have as if you were using the actual Google Drive UI.

According to the API reference 'selfLink' provides 'a link back to this file' but its actually an API URL (ie - https://www.googleapis.com/drive/v2/files/). When I follow this URL I get a hash that includes the message 'Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.' This doesn't make sense to me since I authorized the request when finding the file.

When I use the 'alternateLink' I get 'A link for opening the file in using a relevant Google editor or viewer' which is inconvenient because it requires an extra click to get to the Google Drive UI.

Does the selfLink have to be converted somehow? Any help would be greatly appreciated!

2

2 Answers

1
votes

The selfLink is a rest api link to the item you've just downloaded, ie it points to itself. As such I've never really found a use for it. IE. you should ignore it. The "403 Daily Limit..." message just means you've called a Drive API url without setting an authorization header.

I'm not sure I understand your question. If you want to open the file in the editor, use the the alternatelink. If you want to open the Drive UI , just call drive.google.com. Perhaps try to explain again what you're trying to achieve.

0
votes

Reason for the error - 'Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.'

Google limits the number of times an API can be used for free users. Once the limit is reached it will log you out and you need to sign in again. At this time, you will get above error response. If you want to avoid the same, you need to be paid user for the Google API.