I want to use google spreadsheet api batchUpdate to update different values with the same request.
In the documentation examples they use a dict to store the Json request but I need to set the same attribute (insertDimension) multiple times. Here Google expected request
{ "requests": [ { "insertDimension": { "range": { "sheetId": sheetId, "dimension": "COLUMNS", "startIndex": 2, "endIndex": 4 }, "inheritBefore": true } }, { "insertDimension": { "range": { "sheetId": sheetId, "dimension": "ROWS", "startIndex": 0, "endIndex": 3 }, "inheritBefore": false } }, ], }
I tried using json.dumps
mydata = json.dumps('''
"requests": [{{"updateDimensionProperties": {"range": {"sheetId": 0,"dimension": "ROWS","startIndex": 0 "endIndex": 50 }, "properties": { "pixelSize": 10 }, "fields": "pixelSize" } } } ] ''')
but I receive this error message "Invalid JSON payload received. Unknown name "": Root element must be a message."