I am trying to make an AutoFillRequest using a SourceAndDestination object to describe the area to autofill. I've tested autofill requests using a GridRange object and everything works fine, but can't seem to get the SourceAndDestination working. Here is an example where I'm trying to autofill down the first row for 2 more rows.
HTTP POST
https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate
Request Body
{
"requests": [
{
"autoFill": {
"sourceAndDestination": {
"dimension": "ROWS",
"fillLength": 2,
"source": {
"sheetId": 1150108545,
"endRowIndex": 1,
"startRowIndex": 0
}
},
"useAlternateSeries": false
}
}
]
}
The response has an error code 400:
message = "Invalid requests[0].autoFill: No grid with id: 0" status = "INVALID_ARGUMENT"