Setu Recipes: reusable workflows across every app.Browse templates

Integrations / Google Docs

Google Docs

Create and read documents in Google Docs.

3 actions OAuth 2 1 read2 write Calls docs.googleapis.com

Connect

TypeScript
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

ScopeWhy it is requested
https://www.googleapis.com/auth/userinfo.emailSee which Google account you connected
https://www.googleapis.com/auth/documentsSee, 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

InputTypeDescription
document_idstringRequiredThe long ID in the document address
textstringRequiredText to add
TypeScript
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

InputTypeDescription
titlestringRequiredDocument title
TypeScript
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

InputTypeDescription
document_idstringRequiredThe long ID in the document address
TypeScript
await setu.execute({
  userId: "user_1",
  action: "googledocs.get_document",
  input: {
    "document_id": "<document_id>"
  },
});