1
votes

POST/PUT request to append a new row using Google Spreadsheet API returns 404 error. Here is the API reference doc for append method in Google Spreadsheet API https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.values/append

Below is the request & response. If the ':append' in the url path is removed, then the request works fine. But the new data overrides the existing row. Any idea what's wrong with this append request to add a new rows in the sheet

Request URL:https://sheets.googleapis.com/v4/spreadsheets/1gpa0ByqgiDbGawyStfsJit8SdJfgi0rQsAAlzWkU7uM/values/**A2:append**?valueInputOption=RAW&alt=json
Request Method:PUT
Status Code:**404** 

Response Headers
status:404

Request Headers
Provisional headers are shown
Authorization:Bearer xxxxxxx
Content-Type:application/json
Origin:chrome-extension://xxxxxxx
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36

Request Payload
view source
{values: []}
values:[]
1

1 Answers

0
votes

Follow this tutorial on how to insert data to a google spreadsheet via POST or GET. You may also try the workaround given in this link.

Hope this helps.