News for hackers. Stuff that matters.
Re:Show HN: Using Google Sheets as the back end/APIs of your... by altbdoor on Monday April 15, 2024 @11:08PM (#40047999)
Just tried it out. The script is able to handle multiple commands (GET, POST, etc) in one go, but you will have to package the payload as an array.

See https://github.com/ziolko/spreadapi/blob/master/spread-api.j...

As an example:

    curl -L \
        --data '[{ "method": "POST", "sheet": "Sheet1", "payload": { "username": "John", "age": 25 } }, { "method": "GET", "sheet": "Sheet1" }]' \
        "https://script.google.com/macros/s/$APP_ID/exec"
A single curl request, that POSTs a user, and then GETs the data. So you can do multiple POSTs to add multiple rows too.

There are no comments on this comment yet.