Google Spreadsheet API – Invalid query parameter value for grid_id

Google Sheets

I’m working on a Node/React project and I’m using the Google Spreadsheet API and hit the following error:

Error: HTTP error 400 (Bad Request) - Invalid query parameter value for grid_id.

There was nothing obvious wrong with my call:

doc.addRow(0, newObject, function(err) {});

After a little investigation, I found out that the grid_id actually represents the id of the worksheet/tab. And I also found documentation┬áthat says the index begins at “1” instead of “0”. Not a huge problem (although, unintuitive in my opinion) and relatively quick to investigate and fix. Hope this helps someone else in the future.