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
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
| Scope | Why it is requested |
|---|---|
https://www.googleapis.com/auth/userinfo.email | See which Google account you connected |
https://www.googleapis.com/auth/drive.file | See 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
| Input | Type | Description | |
|---|---|---|---|
name | string | Required | Folder name |
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
| Input | Type | Description | |
|---|---|---|---|
file_id | string | Required | File ID |
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
| Input | Type | Description | |
|---|---|---|---|
q | string | Optional | Drive search query |
page_size | integer | Optional |
await setu.execute({
userId: "user_1",
action: "googledrive.list_files",
input: {},
});