You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Google sheet API v4 - batchUpdate provide error : Invalid JSON. Unknown name "data". #588
{ [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' } ] }
Yup, I had the same problem. Check what API call you're making; you're calling spreadsheets.batchUpdate instead of spreadsheets.values.batchUpdate.
Reacted by Raymond Yee, Keith Holliday, Raghav, Sunday Adefila, H2RO, Vladyslav Yazykov, Kirill Valiavin, ma-xlin, Andrii Roiko, mattlongname and 1 more
Reacted by Louis Cherel, Scott Prue, Roy G, H2RO, Vladyslav Yazykov, shelby speegle, Andrii Roiko and NhgrtPlayer
@marcantoineTrehin Like @ehgoodenough said, you probably mean to be calling spreadsheets.values.batchUpdate, but in the code you posted you're actually calling spreadsheets.batchUpdate.
Activity
ehgoodenough commentedon Jun 8, 2016
Yup, I had the same problem. Check what API call you're making; you're calling
spreadsheets.batchUpdateinstead ofspreadsheets.values.batchUpdate.jmdobry commentedon Jun 9, 2016
@marcantoineTrehin Like @ehgoodenough said, you probably mean to be calling
spreadsheets.values.batchUpdate, but in the code you posted you're actually callingspreadsheets.batchUpdate.dannongruver commentedon Aug 27, 2016
Getting the same error. Same code above but using
spreadsheets.values.batchUpdate. Anyone have a working example of theoptionsargument?jmdobry commentedon Aug 30, 2016
The payload of the request (not the parameters) need to be nested under a
resourceproperty:grant commentedon Apr 13, 2018
Here are more examples of how to call
batchUpdate:https://github.com/gsuitedevs/node-samples/blob/master/sheets/snippets/snippets.js#L74
Feel free to file an issue on our Spreadsheets examples if you find problems there.
strarsis commentedon Jul 7, 2019
@jmdobry: Thank you!! I use the nodejs Google API library and using
resourcesfinally made the API call possible!dandv commentedon Jun 12, 2023
I got this error by using UrlFetchApp (i.e. the REST API). Turns out I had forgotten to
JSON.stringify()the payload.