Stein Docs

Stein Docs

  • Docs
  • GitHub

›Getting Started

Getting Started

  • Introduction & Core Concepts
  • Create an API
  • Read Data from Sheet
  • Search for Data
  • Add Rows to Sheet
  • Update Rows
  • Delete Rows
  • Authentication
  • Using Client Libraries

Hosting

  • Introduction
  • Manual Installation & Setup

Stein Expedite

  • Introduction
  • Installation
  • Display Data from Sheet
  • Search for Data
  • Connect HTML Forms to Sheet

Add Rows to Sheet

Send a JSON object via a POST request to your sheet's API URL to add data to your sheet.

Structuring the JSON

Create an array of objects representing your rows.

For example, the Blog Posts Sheet should be provided an array as such.

[
  {
    "title": "Awesome article",
    "author": "Me!",
    "content": "A brief summary",
    "link": "blog.me.com/awesome-article"
  }, ...
]

Performing the request

Here's an example request:

cURL
Node.js
HTML
# Adds a row to spreadsheet
$ curl "https://api.steinhq.com/v1/storages/5cc158079ec99a2f484dcb40/Sheet1" \
-X POST \
-H "Content-Type: application/json" \
-d '[{"title": "...", "author": "...", ...}, ...]'
// Search Sheet1
const SteinStore = require("stein-js-client");
const store = new SteinStore(
"https://api.steinhq.com/v1/storages/5cc158079ec99a2f484dcb40"
);

store
.append("Sheet2", [
{
title: "Awesome article",
author: "Me!",
content: "A brief summary",
link: "blog.me.com/awesome-article"
}
])
.then(res => {
console.log(res);
});
<script src="https://unpkg.com/stein-js-client"></script>
<script>
const store = new SteinStore(
"https://api.steinhq.com/v1/storages/5cc158079ec99a2f484dcb40"
);

store
.append("Sheet2", [
{
title: "Awesome article",
author: "Me!",
content: "A brief summary",
link: "blog.me.com/awesome-article"
}
])
.then(res => {
console.log(res);
});
</script>

Return Value

The updated range of your sheet is returned. For example,

{ "updatedRange": "Sheet1!A6:D6" }
← Search for DataUpdate Rows →
  • Structuring the JSON
  • Performing the request
  • Return Value
Stein Logo
DocumentationOpen SourcePricingPartners

Privacy PolicyTerms of Service
© 2021 Stein