Create spreadsheets & documents with Google Apps Script
From Google Apps Script you can create a shareable OpenOfficeAI spreadsheet with UrlFetchApp — useful when you want a public, no-signup link instead of a permissions-bound Google Sheet. Trigger it from a Sheet edit, a Gmail rule, or a time-based trigger and pass the resulting URL anywhere.
function createSheet() {
const res = UrlFetchApp.fetch(
"https://openofficeai.com/api/v1/sheets",
{
method: "post",
contentType: "application/json",
headers: { Authorization: "Bearer YOUR_API_KEY" },
payload: JSON.stringify({
title: "Q3 Revenue",
sheets: [{ rows: [
["Month", "Revenue", "Growth"],
["July", 48200, "+12%"],
] }],
}),
}
);
const url = JSON.parse(res.getContentText()).url;
Logger.log(url); // share this link with anyone
}How to create a spreadsheet with Google Apps Script
- 1In your Apps Script project, store your API key (Script Properties is best).
- 2Call UrlFetchApp.fetch on /api/v1/sheets with method post and a JSON payload.
- 3Parse res.getContentText() and read the url.
- 4Attach the function to a trigger (onEdit, time-based, or a custom menu).
Why use OpenOfficeAI with Google Apps Script
- Produces a public, no-signup link — unlike a permissioned Google Sheet.
- Run it from Sheets, Gmail, Forms, or on a schedule.
- No OAuth scopes to manage for the recipient of the link.
Frequently asked questions
Why use this instead of SpreadsheetApp?
SpreadsheetApp creates Google Sheets that require Google permissions to view. OpenOfficeAI returns a link anyone can open without a Google account or signup — handy for sending reports to external clients.
Where should I store the API key?
Use PropertiesService.getScriptProperties() to store the key, then read it at runtime. Avoid hardcoding it in the script body, especially if the project is shared.
Can I trigger this when a Sheet changes?
Yes. Add an installable onEdit or time-driven trigger that reads your Sheet range, maps it into rows, and posts to the API — keeping an external shareable copy in sync.
Start creating documents with Google Apps Script
Free tier includes 500 API calls per month — no card required.
Related integrations