Interact with Coda.io via its REST API v1. Base URL: https://coda.io/apis/v1
export CODA_API_TOKEN="" bash scripts/coda.sh whoamiscripts/coda.sh wraps common operations. Run bash scripts/coda.sh help for usage.
Examples:
# List docs
bash scripts/coda.sh list-docs | jq '.items[].name'
# List tables in a doc
bash scripts/coda.sh list-tables AbCDeFGH | jq '.items[] | {id, name}'
# List columns (discover IDs before writing)
bash scripts/coda.sh list-columns AbCDeFGH grid-abc | jq '.items[] | {id, name}'
# Read rows with column names
bash scripts/coda.sh list-rows AbCDeFGH grid-abc 10 true | jq '.items'
# Insert rows
echo '{"rows":[{"cells":[{"column":"c-abc","value":"Hello"}]}]}' | \
bash scripts/coda.sh insert-rows AbCDeFGH grid-abc
# Upsert rows (match on key column)
echo '{"rows":[{"cells":[{"column":"c-abc","value":"Hello"},{"column":"c-def","value":42}]}],"keyColumns":["c-abc"]}' | \
bash scripts/coda.sh upsert-rows AbCDeFGH grid-abc
# Share doc
bash scripts/coda.sh share-doc AbCDeFGH user@example.com write
list-docs → find the doc IDlist-tables → find the table IDlist-columns → discover column IDs/nameslist-rows → read datacells array using column IDsinsert-rows (new data) or upsert-rows (with keyColumns for idempotent writes)requestId → poll with mutation-status if confirmation neededmutation-status to confirm.nextPageToken. Pass as pageToken for next page.X-Coda-Doc-Version: latest to ensure non-stale data (may 400).simple (default), simpleWithArrays, rich for structured data.https://coda.io/d/Title_d → the part after _d is the doc ID.curl -s -H "Authorization: Bearer $CODA_API_TOKEN" \
"https://coda.io/apis/v1/docs/{docId}/tables/{tableId}/rows?useColumnNames=true&limit=50"
For writes:
curl -s -H "Authorization: Bearer $CODA_API_TOKEN" \
-H "Content-Type: application/json" \
-X POST -d '{"rows":[...]}' \
"https://coda.io/apis/v1/docs/{docId}/tables/{tableId}/rows"
See references/api-endpoints.md for complete endpoint listing with parameters, body schemas, and response details.
Searchable by section: Account, Folders, Docs, Pages, Tables, Columns, Rows, Formulas, Controls, Permissions, Publishing, Automations, Analytics, Miscellaneous.
共 1 个版本