I'm using Google Sheets V4 append API to insert data into a newly created sheet. I am inserting data with 1000 rows and 1001 columns i.e 1001000 cells.
String url = https://sheets.googleapis.com/v4/spreadsheets/<spreadSheetId>/values/<workSheetName>!A1:append?access_token=<accessToken>&valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS
//CREATING THE REQUEST BODY
reqBody.put("range", <workSheetName>+"!A1");
reqBody.put("majorDimension", "ROWS");
reqBody.put("values", <values>);
I am getting 400 Bad Request
with the message :
This action would increase the number of cells in the worksheet above the limit of 2000000 cells
I know that Google has 2 million cells per sheet limit, but I'm unable to find out why I'm getting this exception especially since I have not exceeded the limit.
Any help on why this error may occur?