Google Docs comes next — the API for documents. The simplest write is the one you always do manually: create a new doc with a title. What do you think the params are?
Probably just a title? A doc is a title plus a body, and the body starts empty?
Exactly. GOOGLEDOCS_CREATE_DOCUMENT takes one required field — title. Google assigns a fresh documentId and sends it back in the response so your code can find the doc again later:
result = toolset.execute_action(Action.GOOGLEDOCS_CREATE_DOCUMENT, {"title": "Meeting notes"})
doc_id = result.get("documentId", "")The documentId is the hook — if I want to read or edit this doc later, I need to hold onto that id?
That id is the key to everything else Docs can do — read content, update it, share it. Always return the whole response from a create action so the caller can grab the id themselves:
def create_doc(title: str) -> dict:
result = toolset.execute_action(Action.GOOGLEDOCS_CREATE_DOCUMENT, {"title": title})
return resultIf I call create_doc("Meeting notes") twice, do I get one doc or two?
Two separate docs, each with a unique documentId and the same display title. Google does not deduplicate by title — that is left to your code. Most automations check for an existing doc first when uniqueness matters.
So Python can spin up a fresh report template on demand — one doc per meeting, per project, per anything?
That is exactly the unlock. Every scheduled run creates a fresh canvas and hands back the id so the next step can drop content into it.
TL;DR: One required field — title. The response carries the new documentId you will use for every follow-up call.
Action.GOOGLEDOCS_CREATE_DOCUMENTtitle shows at the top of the doc{"documentId": "...", "revisionId": "..."}| Field | Caller might need |
|---|---|
documentId | fetch, edit, share later |
revisionId | cache-busting, concurrency guards |
Create a free account to get started. Paid plans unlock all tracks.
Google Docs comes next — the API for documents. The simplest write is the one you always do manually: create a new doc with a title. What do you think the params are?
Probably just a title? A doc is a title plus a body, and the body starts empty?
Exactly. GOOGLEDOCS_CREATE_DOCUMENT takes one required field — title. Google assigns a fresh documentId and sends it back in the response so your code can find the doc again later:
result = toolset.execute_action(Action.GOOGLEDOCS_CREATE_DOCUMENT, {"title": "Meeting notes"})
doc_id = result.get("documentId", "")The documentId is the hook — if I want to read or edit this doc later, I need to hold onto that id?
That id is the key to everything else Docs can do — read content, update it, share it. Always return the whole response from a create action so the caller can grab the id themselves:
def create_doc(title: str) -> dict:
result = toolset.execute_action(Action.GOOGLEDOCS_CREATE_DOCUMENT, {"title": title})
return resultIf I call create_doc("Meeting notes") twice, do I get one doc or two?
Two separate docs, each with a unique documentId and the same display title. Google does not deduplicate by title — that is left to your code. Most automations check for an existing doc first when uniqueness matters.
So Python can spin up a fresh report template on demand — one doc per meeting, per project, per anything?
That is exactly the unlock. Every scheduled run creates a fresh canvas and hands back the id so the next step can drop content into it.
TL;DR: One required field — title. The response carries the new documentId you will use for every follow-up call.
Action.GOOGLEDOCS_CREATE_DOCUMENTtitle shows at the top of the doc{"documentId": "...", "revisionId": "..."}| Field | Caller might need |
|---|---|
documentId | fetch, edit, share later |
revisionId | cache-busting, concurrency guards |