问题
I'm working on a node.js server. I want to upload and convert .xlsx files to google spreadsheet in my own google drive and then get the shareable link programmatically.
However, I found google drive api is specialized for building app for other users to access their drives to do something on your app but not for accessing your own drive programmatically. Do I understand this correctly?
I have read a lot of documents on google developers and some tutorial about this but I cannot find the way to what I want. Is there any way to do what I want? Could you give me some guidelines?
回答1:
You have misunderstood.
Drive uses oauth2 to handle the identification and authorisation of the target Drive account. Specifically, the Access Token "contains" (conceptually, not literally) the Id of the Drive account.
All of the published examples show how to obtain an access token for a third party user because that is the more common and more complex use case. Obtaining an access token for your own account is much easier.
See How do I authorise an app (web or installed) without user intervention? (canonical ?)
来源:https://stackoverflow.com/questions/27659723/how-to-upload-xlsx-files-to-my-own-google-drive-then-convert-them-to-google-spr