Setu Recipes: reusable workflows across every app.Browse templates

Integrations / Google Drive

Google Drive

Find and organise files in Google Drive that Setu created or that you open with it.

3 actions OAuth 2 2 read1 write Calls www.googleapis.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "googledrive" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

ScopeWhy it is requested
https://www.googleapis.com/auth/userinfo.emailSee which Google account you connected
https://www.googleapis.com/auth/drive.fileSee and manage only the Drive files Setu creates or you open with it

Actions

Create folderwritegoogledrive.create_folderCreate a folder in Drive.

Needs scope: https://www.googleapis.com/auth/drive.file

InputTypeDescription
namestringRequiredFolder name
TypeScript
await setu.execute({
  userId: "user_1",
  action: "googledrive.create_folder",
  input: {
    "name": "<name>"
  },
});
Get filereadgoogledrive.get_fileGet a file's name, type, link and when it was last changed.

Needs scope: https://www.googleapis.com/auth/drive.file

InputTypeDescription
file_idstringRequiredFile ID
TypeScript
await setu.execute({
  userId: "user_1",
  action: "googledrive.get_file",
  input: {
    "file_id": "<file_id>"
  },
});
List filesreadgoogledrive.list_filesList files Setu can see. Use q for Drive search, for example name contains 'report'.

Needs scope: https://www.googleapis.com/auth/drive.file

InputTypeDescription
qstringOptionalDrive search query
page_sizeintegerOptional
TypeScript
await setu.execute({
  userId: "user_1",
  action: "googledrive.list_files",
  input: {},
});