This is very similar to another question that I answered here on how to get spreadsheet data, but I'm trying to add append data . spreadsheets. Here is my twist request:
curl -H "Content-Type: application/json" -X POST -d '{"range":"A1","majorDimension":"ROWS","values":["Frank2"]}' https://sheets.googleapis.com/v4/spreadsheets/{SPREADSHEET_ID}/values/A1:append?valueInputOption=RAW&key={API-KEY}
Here's the answer:
{
"error": {
"code": 401,
"message": "The request does not have valid authentication credentials.",
"status": "UNAUTHENTICATED"
}
}
Is it possible to do this only with an API key, or am I doing something wrong? The documentation suggests that this is possible if the spreadsheet is publicly available.
source
share