Integrations / Google Docs
Google Docs
Create and read documents in Google Docs.
3 actions
OAuth 2
1 read2 write
Calls docs.googleapis.com
Connect
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "googledocs" });
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/documents | See, edit, create and delete your Google Docs documents |
Actions
Append textwritegoogledocs.append_textAdd text to the end of a document.
Needs scope: https://www.googleapis.com/auth/documents
| Input | Type | Description | |
|---|---|---|---|
document_id | string | Required | The long ID in the document address |
text | string | Required | Text to add |
await setu.execute({
userId: "user_1",
action: "googledocs.append_text",
input: {
"document_id": "<document_id>",
"text": "<text>"
},
});Create documentwritegoogledocs.create_documentCreate a new, empty document with a title.
Needs scope: https://www.googleapis.com/auth/documents
| Input | Type | Description | |
|---|---|---|---|
title | string | Required | Document title |
await setu.execute({
userId: "user_1",
action: "googledocs.create_document",
input: {
"title": "<title>"
},
});Get documentreadgoogledocs.get_documentRead a document's title and its content structure.
Needs scope: https://www.googleapis.com/auth/documents
| Input | Type | Description | |
|---|---|---|---|
document_id | string | Required | The long ID in the document address |
await setu.execute({
userId: "user_1",
action: "googledocs.get_document",
input: {
"document_id": "<document_id>"
},
});