...
const copyOptions = {
spreadsheetId,
requestBody:
{
copyPaste: {
source: {
sheetId: 'XXXXX',
startRowIndex: 0,
endRowIndex: 1,
startColumnIndex: 0,
endColumnIndex: 1,
},
destination: {
sheetId: 'XXXXX',
startRowIndex: 0,
endRowIndex: 1,
startColumnIndex: 1,
endColumnIndex: 2,
},
pastType: 'PASTE_VALUES',
pasteOrientation: "NORMAL",
}
}
}
let copy = await gsapi.spreadsheets.batchUpdate(copyOptions)
console.log(copy.data);
{
message: 'Invalid JSON payload received. Unknown name "copyPaste": Cannot find field.',
reason: 'invalid'
}
spreadsheetId: 'xxxx',
resource: {
requests: [
{
copyPaste: {
source: {
sheetId: xxxx,
startRowIndex: 0,
endRowIndex: 1,
startColumnIndex: 0,
endColumnIndex: 1,
},
destination: {
sheetId: xxxx,
startRowIndex: 0,
endRowIndex: 1,
startColumnIndex: 1,
endColumnIndex: 2,
},
pasteType: 'PASTE_VALUES',
pasteOrientation: "NORMAL",
}
}
]
}
}
}