Skip to content

Google sheet API v4 - batchUpdate provide error : Invalid JSON. Unknown name "data". #588

@marcoBros

Description

@marcoBros

I 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions