I am making a Google drive integrated web app with Drive Api. The api service of Google App script looks very nice. However, is it possible to use Google App script as an external library to integrated with the local html? Or you have to build the App script in the Google script editor? If so, how to link it with the Drive Api?
2 Answers
You can build your script in script.google.com and use the default Drive Service of Apps-script.
Also look here for a sample app that uses Drive Service with Apps-script
Comments
To do what you want, you at least have to publish your script from within the script editor as a web app. See the documentation. It's not an ideal development environment, but it does provide code completion for Google APIs, which is pretty handy as an aid to memory and debugging tool. You don't have to link to the Drive API to access files in a particular Drive account, since this functionality is provided by DriveApp and DocsList. You can, however, activate the Drive API in your Developers Console and then in your script under Resources: Advanced Google Services. You probably won't need to do this, but there may be some functionality you can't access through API calls. For example, it seems impossible to retrieve the text of Google document file revisions through method calls. The only way I have gotten this to work is by sending an authorized HTTPS request using UrlFetchApp. I don't think this is intentional, but that has been my experience. There may be other cases where you need the Drive API, but for most purposes, DriveApp and DocsList ought to suffice.