Script applications have the ability to access the Google APIs, but you need to explicitly enable them before using them.
In the code editor, select RESOURCES , ADDITIONAL GOOGLE SERVICES

Press the “OFF” button to enable the service.
Before closing the dialog box, click the link below to open the API manager.

Once you complete these two steps, the drive's API is accessible inside the Script applications. Enter the keyword Drive , then enter the period, and the available methods will appear in the list.
Methods
- get - Gets the file metadata by identifier.
- insert - insert a new file. Patch
- - updates file metadata. This method supports the semantics of the patch.
- update - updates file metadata and / or contents.
- copy - creates a copy of the specified file.
- delete - Permanently deletes a file by ID. Skips the trash.
- list - List of user files.
- touch - set the file update time to the current server time.
- trash - moves a file to the trash
- untrash - restores a file from the recycle bin.
- watch - start viewing the changes in the file.
- emptyTrash - Permanently deletes all files with damaged users.
https://developers.google.com/drive/v2/reference/files#methods
source share