Overview
A client-mode connector for a curated slice of Google Sheets API v4 underhttps://sheets.googleapis.com:
Default
BASE_ADDRESS is https://sheets.googleapis.com (no trailing slash). Topics use storage/google-sheets/<object>/<verb>.
See the base guide: REST API Connectors.
A1 encoding: put the sheet range in
{value.json.range}. URL-encode ! as %21 and : as %3A if the publisher or broker does not encode path segments (example: Sheet1!A1:D10 → Sheet1%21A1%3AD10).valueInputOption: Append and Update require query
valueInputOption=RAW or USER_ENTERED. BatchUpdate places valueInputOption in the JSON body with data (array of ValueRange).Prefer Hub secrets for access tokens (
GET SECRET "GOOGLE_SHEETS_TOKEN" or "GOOGLE_ACCESS_TOKEN"). Scope: https://www.googleapis.com/auth/spreadsheets. This template has not been verified against a live Google Cloud project. Status remains blocked until an authenticated live smoke succeeds.Basic Syntax
Auth
- Enable Google Sheets API on a Google Cloud project.
- Obtain an OAuth 2.0 user access token or a service-account access token (share the target spreadsheet with the service-account email).
- Scope:
https://www.googleapis.com/auth/spreadsheets(read/write). Use.../spreadsheets.readonlyonly if you stick to GET events. - Pass
api_tokenon each MQTT payload →Authorization: Bearer {value.json.api_token}. Prefer Hub secrets /GET SECRET "GOOGLE_SHEETS_TOKEN"or"GOOGLE_ACCESS_TOKEN". Never commit real tokens.
MQTT topics
Example payloads
Append telemetry row (body is{payload} — include Sheets values array):
ranges_query is the full query string after ?):
Quotas and limits
Google Sheets API enforces per-project quotas. Burst append/update from many devices can hit write quotas — batch or throttle at the edge when possible.Deploy notes
- Deploy only
GoogleSheetsRestApi.lotwith-addRoute/ Hub deploy. Do not deployhub-metadata.lot. - Hub listing uses
hub-metadata.lot(WITH IMAGE,WITH STATUS "beta", doclink). - Suggested branches (Hugo pushes):
feat/rest-api-route-google-sheets,feat/docs-rest-api-google-sheets.
Related
- REST API Connectors
- REST API Apps catalog
- Google Sheets API reference
- Discovery:
https://sheets.googleapis.com/$discovery/rest?version=v4

