Google sheet API v4 - batchUpdate provide error : Invalid JSON. Unknown name "data".
See original GitHub issueI got an error by executing the batchUpdate
function :
var options = var options = {
auth: auth,
spreadsheetId: spreadSheetId,
valueInputOption: "RAW",
data: [
{
range: "MyRange",
majorDimension: majorDimension,
values: [0,0,0,1,2,3]
}
]
};
spreadsheets.batchUpdate(options, function(err, res) {
console.log(res);
console.log(err);
})
The error is the following :
{ [Error: Invalid JSON payload received. Unknown name "data": Cannot bind query parameter. 'data' is a message type. Parameters can only be bound to primitive types.]
code: 400,
errors:
[ { message: 'Invalid JSON payload received. Unknown name "data": Cannot bind query parameter. \'data\' is a message type. Parameters can only be bound to primitive types.',
domain: 'global',
reason: 'badRequest' } ] }
Im using Google sheet API v4.
‘data’ should exist in request following the documentation : https://developers.google.com/sheets/samples/writing#write_to_multiple_ranges
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Google Sheets API BatchUpdate InsertRange returns "Invalid ...
I am told there is an issue both with the syntax, and earlier that the JSON names could not be found. Syntax Error:...
Read more >Updating Spreadsheets | Google Sheets
The batchUpdate method lets you update any of these spreadsheet details. Changes are grouped together in a batch so that if one request...
Read more >The Google Sheets API "clear" method prompts for a required ...
TROUBLESHOOTING: The Google Sheets API "clear" method prompts for a required value. ... Unknown name \\\"data\\\": Cannot find field.
Read more >Node Google Docs REST API Batch update invalid JSON ...
When attempting to perform a batch update and I receive a Invalid JSON payload error; and trying to stringify JSON gives a 'missing...
Read more >Invalid Json Payload Error Received When Performing A ...
Ask questionsGoogle sheet API v4 batchUpdate provide error : Invalid JSON. Unknown name data. I got an error by executing the batchUpdate function...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The payload of the request (not the parameters) need to be nested under a
resource
property:Yup, I had the same problem. Check what API call you’re making; you’re calling
spreadsheets.batchUpdate
instead ofspreadsheets.values.batchUpdate
.