ziolko / spreadapi

Free REST API for Google Spreadsheet
https://spreadapi.roombelt.com
Other
87 stars 13 forks source link

Documentation on capability to handle multiple actions in a single request #11

Closed altbdoor closed 5 months ago

altbdoor commented 5 months ago

Context in https://news.ycombinator.com/item?id=40014730#40047999

Looking at the code, we are able to handle multiple actions in a single request, by sending an array in the request body instead. 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"

However, this was not documented in the documentation page.

This seems like a really handy feature, should this be documented somewhere?

As an aside, I almost created a PR to tweak handlePost to handle an array instead of an object 😆

ziolko commented 5 months ago

Hi @altbdoor ,

That's a good point. I've added it to the docs in relevant sections e.g. https://spreadapi.roombelt.com/usage/usage#insert-row.

Thanks for raising this! Mateusz

altbdoor commented 5 months ago

Thanks @ziolko !