Google Docs integration
In short
Create documents and read or edit their content. Connect it on the Integrations page; your app then calls Google Docs through Sapilon without ever holding a Google credential.
Lets your app create Google Docs, read a document’s content and edit it — insert text, replace placeholders, format — in documents the connected account can open.
To find documents, connect Google Drive as well.
Connecting
On the Integrations page choose Connect on Google Docs, sign in to Google and allow access. Under Advanced you can use your own Google OAuth app instead of Sapilon’s.
- Your app can read and edit every document this account can open.
- Sapilon’s Google app is still in verification: you may see an “unverified app” screen. Advanced → Bring your own OAuth app avoids it.
What your app can do
Only these requests are available; anything else is refused.
POST /documentsGET|POST /documents/*
How the agent uses it
Use integrations.request('google-docs', …); paths are relative to https://docs.googleapis.com/v1. The document id is the long part of its URL.
POST /documents— create an empty document. Example:{ method: 'POST', path: '/documents', body: { title: 'Contract – Acme' } }.GET /documents/{id}— the content as structural elements. Example:{ method: 'GET', path: '/documents/1AbC' }.POST /documents/{id}:batchUpdate— edit. Example:{ method: 'POST', path: '/documents/1AbC:batchUpdate', body: { requests: [{ replaceAllText: { containsText: { text: '{{name}}', matchCase: true }, replaceText: 'Acme' } }] } }; insert with{ insertText: { location: { index: 1 }, text: 'Hello' } }.
To fill a template, copy it with Google Drive first, then replaceAllText in the copy.
More from Google: https://developers.google.com/workspace/docs/api