Google Sheets API
POST
sheets.spreadsheets.batchUpdate
{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate
QUERY PARAMS
spreadsheetId
BODY json
{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate" {:content-type :json
:form-params {:includeSpreadsheetInResponse false
:requests [{:addBanding {:bandedRange {:bandedRangeId 0
:columnProperties {:firstBandColor {:alpha ""
:blue ""
:green ""
:red ""}
:firstBandColorStyle {:rgbColor {}
:themeColor ""}
:footerColor {}
:footerColorStyle {}
:headerColor {}
:headerColorStyle {}
:secondBandColor {}
:secondBandColorStyle {}}
:range {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}
:rowProperties {}}}
:addChart {:chart {:border {:color {}
:colorStyle {}}
:chartId 0
:position {:newSheet false
:overlayPosition {:anchorCell {:columnIndex 0
:rowIndex 0
:sheetId 0}
:heightPixels 0
:offsetXPixels 0
:offsetYPixels 0
:widthPixels 0}
:sheetId 0}
:spec {:altText ""
:backgroundColor {}
:backgroundColorStyle {}
:basicChart {:axis [{:format {:bold false
:fontFamily ""
:fontSize 0
:foregroundColor {}
:foregroundColorStyle {}
:italic false
:link {:uri ""}
:strikethrough false
:underline false}
:position ""
:title ""
:titleTextPosition {:horizontalAlignment ""}
:viewWindowOptions {:viewWindowMax ""
:viewWindowMin ""
:viewWindowMode ""}}]
:chartType ""
:compareMode ""
:domains [{:domain {:aggregateType ""
:columnReference {:name ""}
:groupRule {:dateTimeRule {:type ""}
:histogramRule {:intervalSize ""
:maxValue ""
:minValue ""}}
:sourceRange {:sources [{}]}}
:reversed false}]
:headerCount 0
:interpolateNulls false
:legendPosition ""
:lineSmoothing false
:series [{:color {}
:colorStyle {}
:dataLabel {:customLabelData {}
:placement ""
:textFormat {}
:type ""}
:lineStyle {:type ""
:width 0}
:pointStyle {:shape ""
:size ""}
:series {}
:styleOverrides [{:color {}
:colorStyle {}
:index 0
:pointStyle {}}]
:targetAxis ""
:type ""}]
:stackedType ""
:threeDimensional false
:totalDataLabel {}}
:bubbleChart {:bubbleBorderColor {}
:bubbleBorderColorStyle {}
:bubbleLabels {}
:bubbleMaxRadiusSize 0
:bubbleMinRadiusSize 0
:bubbleOpacity ""
:bubbleSizes {}
:bubbleTextStyle {}
:domain {}
:groupIds {}
:legendPosition ""
:series {}}
:candlestickChart {:data [{:closeSeries {:data {}}
:highSeries {}
:lowSeries {}
:openSeries {}}]
:domain {:data {}
:reversed false}}
:dataSourceChartProperties {:dataExecutionStatus {:errorCode ""
:errorMessage ""
:lastRefreshTime ""
:state ""}
:dataSourceId ""}
:filterSpecs [{:columnIndex 0
:dataSourceColumnReference {}
:filterCriteria {:condition {:type ""
:values [{:relativeDate ""
:userEnteredValue ""}]}
:hiddenValues []
:visibleBackgroundColor {}
:visibleBackgroundColorStyle {}
:visibleForegroundColor {}
:visibleForegroundColorStyle {}}}]
:fontName ""
:hiddenDimensionStrategy ""
:histogramChart {:bucketSize ""
:legendPosition ""
:outlierPercentile ""
:series [{:barColor {}
:barColorStyle {}
:data {}}]
:showItemDividers false}
:maximized false
:orgChart {:labels {}
:nodeColor {}
:nodeColorStyle {}
:nodeSize ""
:parentLabels {}
:selectedNodeColor {}
:selectedNodeColorStyle {}
:tooltips {}}
:pieChart {:domain {}
:legendPosition ""
:pieHole ""
:series {}
:threeDimensional false}
:scorecardChart {:aggregateType ""
:baselineValueData {}
:baselineValueFormat {:comparisonType ""
:description ""
:negativeColor {}
:negativeColorStyle {}
:position {}
:positiveColor {}
:positiveColorStyle {}
:textFormat {}}
:customFormatOptions {:prefix ""
:suffix ""}
:keyValueData {}
:keyValueFormat {:position {}
:textFormat {}}
:numberFormatSource ""
:scaleFactor ""}
:sortSpecs [{:backgroundColor {}
:backgroundColorStyle {}
:dataSourceColumnReference {}
:dimensionIndex 0
:foregroundColor {}
:foregroundColorStyle {}
:sortOrder ""}]
:subtitle ""
:subtitleTextFormat {}
:subtitleTextPosition {}
:title ""
:titleTextFormat {}
:titleTextPosition {}
:treemapChart {:colorData {}
:colorScale {:maxValueColor {}
:maxValueColorStyle {}
:midValueColor {}
:midValueColorStyle {}
:minValueColor {}
:minValueColorStyle {}
:noDataColor {}
:noDataColorStyle {}}
:headerColor {}
:headerColorStyle {}
:hideTooltips false
:hintedLevels 0
:labels {}
:levels 0
:maxValue ""
:minValue ""
:parentLabels {}
:sizeData {}
:textFormat {}}
:waterfallChart {:connectorLineStyle {}
:domain {:data {}
:reversed false}
:firstValueIsTotal false
:hideConnectorLines false
:series [{:customSubtotals [{:dataIsSubtotal false
:label ""
:subtotalIndex 0}]
:data {}
:dataLabel {}
:hideTrailingSubtotal false
:negativeColumnsStyle {:color {}
:colorStyle {}
:label ""}
:positiveColumnsStyle {}
:subtotalColumnsStyle {}}]
:stackedType ""
:totalDataLabel {}}}}}
:addConditionalFormatRule {:index 0
:rule {:booleanRule {:condition {}
:format {:backgroundColor {}
:backgroundColorStyle {}
:borders {:bottom {:color {}
:colorStyle {}
:style ""
:width 0}
:left {}
:right {}
:top {}}
:horizontalAlignment ""
:hyperlinkDisplayType ""
:numberFormat {:pattern ""
:type ""}
:padding {:bottom 0
:left 0
:right 0
:top 0}
:textDirection ""
:textFormat {}
:textRotation {:angle 0
:vertical false}
:verticalAlignment ""
:wrapStrategy ""}}
:gradientRule {:maxpoint {:color {}
:colorStyle {}
:type ""
:value ""}
:midpoint {}
:minpoint {}}
:ranges [{}]}}
:addDataSource {:dataSource {:calculatedColumns [{:formula ""
:reference {}}]
:dataSourceId ""
:sheetId 0
:spec {:bigQuery {:projectId ""
:querySpec {:rawQuery ""}
:tableSpec {:datasetId ""
:tableId ""
:tableProjectId ""}}
:parameters [{:name ""
:namedRangeId ""
:range {}}]}}}
:addDimensionGroup {:range {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}}
:addFilterView {:filter {:criteria {}
:filterSpecs [{}]
:filterViewId 0
:namedRangeId ""
:range {}
:sortSpecs [{}]
:title ""}}
:addNamedRange {:namedRange {:name ""
:namedRangeId ""
:range {}}}
:addProtectedRange {:protectedRange {:description ""
:editors {:domainUsersCanEdit false
:groups []
:users []}
:namedRangeId ""
:protectedRangeId 0
:range {}
:requestingUserCanEdit false
:unprotectedRanges [{}]
:warningOnly false}}
:addSheet {:properties {:dataSourceSheetProperties {:columns [{}]
:dataExecutionStatus {}
:dataSourceId ""}
:gridProperties {:columnCount 0
:columnGroupControlAfter false
:frozenColumnCount 0
:frozenRowCount 0
:hideGridlines false
:rowCount 0
:rowGroupControlAfter false}
:hidden false
:index 0
:rightToLeft false
:sheetId 0
:sheetType ""
:tabColor {}
:tabColorStyle {}
:title ""}}
:addSlicer {:slicer {:position {}
:slicerId 0
:spec {:applyToPivotTables false
:backgroundColor {}
:backgroundColorStyle {}
:columnIndex 0
:dataRange {}
:filterCriteria {}
:horizontalAlignment ""
:textFormat {}
:title ""}}}
:appendCells {:fields ""
:rows [{:values [{:dataSourceFormula {:dataExecutionStatus {}
:dataSourceId ""}
:dataSourceTable {:columnSelectionType ""
:columns [{}]
:dataExecutionStatus {}
:dataSourceId ""
:filterSpecs [{}]
:rowLimit 0
:sortSpecs [{}]}
:dataValidation {:condition {}
:inputMessage ""
:showCustomUi false
:strict false}
:effectiveFormat {}
:effectiveValue {:boolValue false
:errorValue {:message ""
:type ""}
:formulaValue ""
:numberValue ""
:stringValue ""}
:formattedValue ""
:hyperlink ""
:note ""
:pivotTable {:columns [{:dataSourceColumnReference {}
:groupLimit {:applyOrder 0
:countLimit 0}
:groupRule {:dateTimeRule {:type ""}
:histogramRule {:end ""
:interval ""
:start ""}
:manualRule {:groups [{:groupName {}
:items [{}]}]}}
:label ""
:repeatHeadings false
:showTotals false
:sortOrder ""
:sourceColumnOffset 0
:valueBucket {:buckets [{}]
:valuesIndex 0}
:valueMetadata [{:collapsed false
:value {}}]}]
:criteria {}
:dataExecutionStatus {}
:dataSourceId ""
:filterSpecs [{:columnOffsetIndex 0
:dataSourceColumnReference {}
:filterCriteria {:condition {}
:visibleByDefault false
:visibleValues []}}]
:rows [{}]
:source {}
:valueLayout ""
:values [{:calculatedDisplayType ""
:dataSourceColumnReference {}
:formula ""
:name ""
:sourceColumnOffset 0
:summarizeFunction ""}]}
:textFormatRuns [{:format {}
:startIndex 0}]
:userEnteredFormat {}
:userEnteredValue {}}]}]
:sheetId 0}
:appendDimension {:dimension ""
:length 0
:sheetId 0}
:autoFill {:range {}
:sourceAndDestination {:dimension ""
:fillLength 0
:source {}}
:useAlternateSeries false}
:autoResizeDimensions {:dataSourceSheetDimensions {:columnReferences [{}]
:sheetId 0}
:dimensions {}}
:clearBasicFilter {:sheetId 0}
:copyPaste {:destination {}
:pasteOrientation ""
:pasteType ""
:source {}}
:createDeveloperMetadata {:developerMetadata {:location {:dimensionRange {}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataId 0
:metadataKey ""
:metadataValue ""
:visibility ""}}
:cutPaste {:destination {}
:pasteType ""
:source {}}
:deleteBanding {:bandedRangeId 0}
:deleteConditionalFormatRule {:index 0
:sheetId 0}
:deleteDataSource {:dataSourceId ""}
:deleteDeveloperMetadata {:dataFilter {:a1Range ""
:developerMetadataLookup {:locationMatchingStrategy ""
:locationType ""
:metadataId 0
:metadataKey ""
:metadataLocation {}
:metadataValue ""
:visibility ""}
:gridRange {}}}
:deleteDimension {:range {}}
:deleteDimensionGroup {:range {}}
:deleteDuplicates {:comparisonColumns [{}]
:range {}}
:deleteEmbeddedObject {:objectId 0}
:deleteFilterView {:filterId 0}
:deleteNamedRange {:namedRangeId ""}
:deleteProtectedRange {:protectedRangeId 0}
:deleteRange {:range {}
:shiftDimension ""}
:deleteSheet {:sheetId 0}
:duplicateFilterView {:filterId 0}
:duplicateSheet {:insertSheetIndex 0
:newSheetId 0
:newSheetName ""
:sourceSheetId 0}
:findReplace {:allSheets false
:find ""
:includeFormulas false
:matchCase false
:matchEntireCell false
:range {}
:replacement ""
:searchByRegex false
:sheetId 0}
:insertDimension {:inheritFromBefore false
:range {}}
:insertRange {:range {}
:shiftDimension ""}
:mergeCells {:mergeType ""
:range {}}
:moveDimension {:destinationIndex 0
:source {}}
:pasteData {:coordinate {}
:data ""
:delimiter ""
:html false
:type ""}
:randomizeRange {:range {}}
:refreshDataSource {:dataSourceId ""
:force false
:isAll false
:references {:references [{:chartId 0
:dataSourceFormulaCell {}
:dataSourcePivotTableAnchorCell {}
:dataSourceTableAnchorCell {}
:sheetId ""}]}}
:repeatCell {:cell {}
:fields ""
:range {}}
:setBasicFilter {:filter {:criteria {}
:filterSpecs [{}]
:range {}
:sortSpecs [{}]}}
:setDataValidation {:range {}
:rule {}}
:sortRange {:range {}
:sortSpecs [{}]}
:textToColumns {:delimiter ""
:delimiterType ""
:source {}}
:trimWhitespace {:range {}}
:unmergeCells {:range {}}
:updateBanding {:bandedRange {}
:fields ""}
:updateBorders {:bottom {}
:innerHorizontal {}
:innerVertical {}
:left {}
:range {}
:right {}
:top {}}
:updateCells {:fields ""
:range {}
:rows [{}]
:start {}}
:updateChartSpec {:chartId 0
:spec {}}
:updateConditionalFormatRule {:index 0
:newIndex 0
:rule {}
:sheetId 0}
:updateDataSource {:dataSource {}
:fields ""}
:updateDeveloperMetadata {:dataFilters [{}]
:developerMetadata {}
:fields ""}
:updateDimensionGroup {:dimensionGroup {:collapsed false
:depth 0
:range {}}
:fields ""}
:updateDimensionProperties {:dataSourceSheetRange {}
:fields ""
:properties {:dataSourceColumnReference {}
:developerMetadata [{}]
:hiddenByFilter false
:hiddenByUser false
:pixelSize 0}
:range {}}
:updateEmbeddedObjectBorder {:border {}
:fields ""
:objectId 0}
:updateEmbeddedObjectPosition {:fields ""
:newPosition {}
:objectId 0}
:updateFilterView {:fields ""
:filter {}}
:updateNamedRange {:fields ""
:namedRange {}}
:updateProtectedRange {:fields ""
:protectedRange {}}
:updateSheetProperties {:fields ""
:properties {}}
:updateSlicerSpec {:fields ""
:slicerId 0
:spec {}}
:updateSpreadsheetProperties {:fields ""
:properties {:autoRecalc ""
:defaultFormat {}
:iterativeCalculationSettings {:convergenceThreshold ""
:maxIterations 0}
:locale ""
:spreadsheetTheme {:primaryFontFamily ""
:themeColors [{:color {}
:colorType ""}]}
:timeZone ""
:title ""}}}]
:responseIncludeGridData false
:responseRanges []}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"),
Content = new StringContent("{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"
payload := strings.NewReader("{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId:batchUpdate HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 26796
{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate")
.setHeader("content-type", "application/json")
.setBody("{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate")
.header("content-type", "application/json")
.body("{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}")
.asString();
const data = JSON.stringify({
includeSpreadsheetInResponse: false,
requests: [
{
addBanding: {
bandedRange: {
bandedRangeId: 0,
columnProperties: {
firstBandColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
firstBandColorStyle: {
rgbColor: {},
themeColor: ''
},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
},
rowProperties: {}
}
},
addChart: {
chart: {
border: {
color: {},
colorStyle: {}
},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {
columnIndex: 0,
rowIndex: 0,
sheetId: 0
},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {
uri: ''
},
strikethrough: false,
underline: false
},
position: '',
title: '',
titleTextPosition: {
horizontalAlignment: ''
},
viewWindowOptions: {
viewWindowMax: '',
viewWindowMin: '',
viewWindowMode: ''
}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {
name: ''
},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
intervalSize: '',
maxValue: '',
minValue: ''
}
},
sourceRange: {
sources: [
{}
]
}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {
customLabelData: {},
placement: '',
textFormat: {},
type: ''
},
lineStyle: {
type: '',
width: 0
},
pointStyle: {
shape: '',
size: ''
},
series: {},
styleOverrides: [
{
color: {},
colorStyle: {},
index: 0,
pointStyle: {}
}
],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [
{
closeSeries: {
data: {}
},
highSeries: {},
lowSeries: {},
openSeries: {}
}
],
domain: {
data: {},
reversed: false
}
},
dataSourceChartProperties: {
dataExecutionStatus: {
errorCode: '',
errorMessage: '',
lastRefreshTime: '',
state: ''
},
dataSourceId: ''
},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {
type: '',
values: [
{
relativeDate: '',
userEnteredValue: ''
}
]
},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [
{
barColor: {},
barColorStyle: {},
data: {}
}
],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {
prefix: '',
suffix: ''
},
keyValueData: {},
keyValueFormat: {
position: {},
textFormat: {}
},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {
data: {},
reversed: false
},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [
{
dataIsSubtotal: false,
label: '',
subtotalIndex: 0
}
],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {
color: {},
colorStyle: {},
label: ''
},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
},
addConditionalFormatRule: {
index: 0,
rule: {
booleanRule: {
condition: {},
format: {
backgroundColor: {},
backgroundColorStyle: {},
borders: {
bottom: {
color: {},
colorStyle: {},
style: '',
width: 0
},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {
pattern: '',
type: ''
},
padding: {
bottom: 0,
left: 0,
right: 0,
top: 0
},
textDirection: '',
textFormat: {},
textRotation: {
angle: 0,
vertical: false
},
verticalAlignment: '',
wrapStrategy: ''
}
},
gradientRule: {
maxpoint: {
color: {},
colorStyle: {},
type: '',
value: ''
},
midpoint: {},
minpoint: {}
},
ranges: [
{}
]
}
},
addDataSource: {
dataSource: {
calculatedColumns: [
{
formula: '',
reference: {}
}
],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {
rawQuery: ''
},
tableSpec: {
datasetId: '',
tableId: '',
tableProjectId: ''
}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {}
}
]
}
}
},
addDimensionGroup: {
range: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
}
},
addFilterView: {
filter: {
criteria: {},
filterSpecs: [
{}
],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [
{}
],
title: ''
}
},
addNamedRange: {
namedRange: {
name: '',
namedRangeId: '',
range: {}
}
},
addProtectedRange: {
protectedRange: {
description: '',
editors: {
domainUsersCanEdit: false,
groups: [],
users: []
},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [
{}
],
warningOnly: false
}
},
addSheet: {
properties: {
dataSourceSheetProperties: {
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: ''
},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
}
},
addSlicer: {
slicer: {
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
},
appendCells: {
fields: '',
rows: [
{
values: [
{
dataSourceFormula: {
dataExecutionStatus: {},
dataSourceId: ''
},
dataSourceTable: {
columnSelectionType: '',
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{}
],
rowLimit: 0,
sortSpecs: [
{}
]
},
dataValidation: {
condition: {},
inputMessage: '',
showCustomUi: false,
strict: false
},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {
message: '',
type: ''
},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {
applyOrder: 0,
countLimit: 0
},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
end: '',
interval: '',
start: ''
},
manualRule: {
groups: [
{
groupName: {},
items: [
{}
]
}
]
}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {
buckets: [
{}
],
valuesIndex: 0
},
valueMetadata: [
{
collapsed: false,
value: {}
}
]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {},
visibleByDefault: false,
visibleValues: []
}
}
],
rows: [
{}
],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [
{
format: {},
startIndex: 0
}
],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
sheetId: 0
},
appendDimension: {
dimension: '',
length: 0,
sheetId: 0
},
autoFill: {
range: {},
sourceAndDestination: {
dimension: '',
fillLength: 0,
source: {}
},
useAlternateSeries: false
},
autoResizeDimensions: {
dataSourceSheetDimensions: {
columnReferences: [
{}
],
sheetId: 0
},
dimensions: {}
},
clearBasicFilter: {
sheetId: 0
},
copyPaste: {
destination: {},
pasteOrientation: '',
pasteType: '',
source: {}
},
createDeveloperMetadata: {
developerMetadata: {
location: {
dimensionRange: {},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
},
cutPaste: {
destination: {},
pasteType: '',
source: {}
},
deleteBanding: {
bandedRangeId: 0
},
deleteConditionalFormatRule: {
index: 0,
sheetId: 0
},
deleteDataSource: {
dataSourceId: ''
},
deleteDeveloperMetadata: {
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {},
metadataValue: '',
visibility: ''
},
gridRange: {}
}
},
deleteDimension: {
range: {}
},
deleteDimensionGroup: {
range: {}
},
deleteDuplicates: {
comparisonColumns: [
{}
],
range: {}
},
deleteEmbeddedObject: {
objectId: 0
},
deleteFilterView: {
filterId: 0
},
deleteNamedRange: {
namedRangeId: ''
},
deleteProtectedRange: {
protectedRangeId: 0
},
deleteRange: {
range: {},
shiftDimension: ''
},
deleteSheet: {
sheetId: 0
},
duplicateFilterView: {
filterId: 0
},
duplicateSheet: {
insertSheetIndex: 0,
newSheetId: 0,
newSheetName: '',
sourceSheetId: 0
},
findReplace: {
allSheets: false,
find: '',
includeFormulas: false,
matchCase: false,
matchEntireCell: false,
range: {},
replacement: '',
searchByRegex: false,
sheetId: 0
},
insertDimension: {
inheritFromBefore: false,
range: {}
},
insertRange: {
range: {},
shiftDimension: ''
},
mergeCells: {
mergeType: '',
range: {}
},
moveDimension: {
destinationIndex: 0,
source: {}
},
pasteData: {
coordinate: {},
data: '',
delimiter: '',
html: false,
type: ''
},
randomizeRange: {
range: {}
},
refreshDataSource: {
dataSourceId: '',
force: false,
isAll: false,
references: {
references: [
{
chartId: 0,
dataSourceFormulaCell: {},
dataSourcePivotTableAnchorCell: {},
dataSourceTableAnchorCell: {},
sheetId: ''
}
]
}
},
repeatCell: {
cell: {},
fields: '',
range: {}
},
setBasicFilter: {
filter: {
criteria: {},
filterSpecs: [
{}
],
range: {},
sortSpecs: [
{}
]
}
},
setDataValidation: {
range: {},
rule: {}
},
sortRange: {
range: {},
sortSpecs: [
{}
]
},
textToColumns: {
delimiter: '',
delimiterType: '',
source: {}
},
trimWhitespace: {
range: {}
},
unmergeCells: {
range: {}
},
updateBanding: {
bandedRange: {},
fields: ''
},
updateBorders: {
bottom: {},
innerHorizontal: {},
innerVertical: {},
left: {},
range: {},
right: {},
top: {}
},
updateCells: {
fields: '',
range: {},
rows: [
{}
],
start: {}
},
updateChartSpec: {
chartId: 0,
spec: {}
},
updateConditionalFormatRule: {
index: 0,
newIndex: 0,
rule: {},
sheetId: 0
},
updateDataSource: {
dataSource: {},
fields: ''
},
updateDeveloperMetadata: {
dataFilters: [
{}
],
developerMetadata: {},
fields: ''
},
updateDimensionGroup: {
dimensionGroup: {
collapsed: false,
depth: 0,
range: {}
},
fields: ''
},
updateDimensionProperties: {
dataSourceSheetRange: {},
fields: '',
properties: {
dataSourceColumnReference: {},
developerMetadata: [
{}
],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
},
range: {}
},
updateEmbeddedObjectBorder: {
border: {},
fields: '',
objectId: 0
},
updateEmbeddedObjectPosition: {
fields: '',
newPosition: {},
objectId: 0
},
updateFilterView: {
fields: '',
filter: {}
},
updateNamedRange: {
fields: '',
namedRange: {}
},
updateProtectedRange: {
fields: '',
protectedRange: {}
},
updateSheetProperties: {
fields: '',
properties: {}
},
updateSlicerSpec: {
fields: '',
slicerId: 0,
spec: {}
},
updateSpreadsheetProperties: {
fields: '',
properties: {
autoRecalc: '',
defaultFormat: {},
iterativeCalculationSettings: {
convergenceThreshold: '',
maxIterations: 0
},
locale: '',
spreadsheetTheme: {
primaryFontFamily: '',
themeColors: [
{
color: {},
colorType: ''
}
]
},
timeZone: '',
title: ''
}
}
}
],
responseIncludeGridData: false,
responseRanges: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate',
headers: {'content-type': 'application/json'},
data: {
includeSpreadsheetInResponse: false,
requests: [
{
addBanding: {
bandedRange: {
bandedRangeId: 0,
columnProperties: {
firstBandColor: {alpha: '', blue: '', green: '', red: ''},
firstBandColorStyle: {rgbColor: {}, themeColor: ''},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
},
rowProperties: {}
}
},
addChart: {
chart: {
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {name: ''},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
},
addConditionalFormatRule: {
index: 0,
rule: {
booleanRule: {
condition: {},
format: {
backgroundColor: {},
backgroundColorStyle: {},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
}
},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
},
addDataSource: {
dataSource: {
calculatedColumns: [{formula: '', reference: {}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [{name: '', namedRangeId: '', range: {}}]
}
}
},
addDimensionGroup: {range: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0}},
addFilterView: {
filter: {
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
},
addNamedRange: {namedRange: {name: '', namedRangeId: '', range: {}}},
addProtectedRange: {
protectedRange: {
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
},
addSheet: {
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
}
},
addSlicer: {
slicer: {
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
},
appendCells: {
fields: '',
rows: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
sheetId: 0
},
appendDimension: {dimension: '', length: 0, sheetId: 0},
autoFill: {
range: {},
sourceAndDestination: {dimension: '', fillLength: 0, source: {}},
useAlternateSeries: false
},
autoResizeDimensions: {
dataSourceSheetDimensions: {columnReferences: [{}], sheetId: 0},
dimensions: {}
},
clearBasicFilter: {sheetId: 0},
copyPaste: {destination: {}, pasteOrientation: '', pasteType: '', source: {}},
createDeveloperMetadata: {
developerMetadata: {
location: {dimensionRange: {}, locationType: '', sheetId: 0, spreadsheet: false},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
},
cutPaste: {destination: {}, pasteType: '', source: {}},
deleteBanding: {bandedRangeId: 0},
deleteConditionalFormatRule: {index: 0, sheetId: 0},
deleteDataSource: {dataSourceId: ''},
deleteDeveloperMetadata: {
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {},
metadataValue: '',
visibility: ''
},
gridRange: {}
}
},
deleteDimension: {range: {}},
deleteDimensionGroup: {range: {}},
deleteDuplicates: {comparisonColumns: [{}], range: {}},
deleteEmbeddedObject: {objectId: 0},
deleteFilterView: {filterId: 0},
deleteNamedRange: {namedRangeId: ''},
deleteProtectedRange: {protectedRangeId: 0},
deleteRange: {range: {}, shiftDimension: ''},
deleteSheet: {sheetId: 0},
duplicateFilterView: {filterId: 0},
duplicateSheet: {insertSheetIndex: 0, newSheetId: 0, newSheetName: '', sourceSheetId: 0},
findReplace: {
allSheets: false,
find: '',
includeFormulas: false,
matchCase: false,
matchEntireCell: false,
range: {},
replacement: '',
searchByRegex: false,
sheetId: 0
},
insertDimension: {inheritFromBefore: false, range: {}},
insertRange: {range: {}, shiftDimension: ''},
mergeCells: {mergeType: '', range: {}},
moveDimension: {destinationIndex: 0, source: {}},
pasteData: {coordinate: {}, data: '', delimiter: '', html: false, type: ''},
randomizeRange: {range: {}},
refreshDataSource: {
dataSourceId: '',
force: false,
isAll: false,
references: {
references: [
{
chartId: 0,
dataSourceFormulaCell: {},
dataSourcePivotTableAnchorCell: {},
dataSourceTableAnchorCell: {},
sheetId: ''
}
]
}
},
repeatCell: {cell: {}, fields: '', range: {}},
setBasicFilter: {filter: {criteria: {}, filterSpecs: [{}], range: {}, sortSpecs: [{}]}},
setDataValidation: {range: {}, rule: {}},
sortRange: {range: {}, sortSpecs: [{}]},
textToColumns: {delimiter: '', delimiterType: '', source: {}},
trimWhitespace: {range: {}},
unmergeCells: {range: {}},
updateBanding: {bandedRange: {}, fields: ''},
updateBorders: {
bottom: {},
innerHorizontal: {},
innerVertical: {},
left: {},
range: {},
right: {},
top: {}
},
updateCells: {fields: '', range: {}, rows: [{}], start: {}},
updateChartSpec: {chartId: 0, spec: {}},
updateConditionalFormatRule: {index: 0, newIndex: 0, rule: {}, sheetId: 0},
updateDataSource: {dataSource: {}, fields: ''},
updateDeveloperMetadata: {dataFilters: [{}], developerMetadata: {}, fields: ''},
updateDimensionGroup: {dimensionGroup: {collapsed: false, depth: 0, range: {}}, fields: ''},
updateDimensionProperties: {
dataSourceSheetRange: {},
fields: '',
properties: {
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
},
range: {}
},
updateEmbeddedObjectBorder: {border: {}, fields: '', objectId: 0},
updateEmbeddedObjectPosition: {fields: '', newPosition: {}, objectId: 0},
updateFilterView: {fields: '', filter: {}},
updateNamedRange: {fields: '', namedRange: {}},
updateProtectedRange: {fields: '', protectedRange: {}},
updateSheetProperties: {fields: '', properties: {}},
updateSlicerSpec: {fields: '', slicerId: 0, spec: {}},
updateSpreadsheetProperties: {
fields: '',
properties: {
autoRecalc: '',
defaultFormat: {},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
}
}
}
],
responseIncludeGridData: false,
responseRanges: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"includeSpreadsheetInResponse":false,"requests":[{"addBanding":{"bandedRange":{"bandedRangeId":0,"columnProperties":{"firstBandColor":{"alpha":"","blue":"","green":"","red":""},"firstBandColorStyle":{"rgbColor":{},"themeColor":""},"footerColor":{},"footerColorStyle":{},"headerColor":{},"headerColorStyle":{},"secondBandColor":{},"secondBandColorStyle":{}},"range":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0},"rowProperties":{}}},"addChart":{"chart":{"border":{"color":{},"colorStyle":{}},"chartId":0,"position":{"newSheet":false,"overlayPosition":{"anchorCell":{"columnIndex":0,"rowIndex":0,"sheetId":0},"heightPixels":0,"offsetXPixels":0,"offsetYPixels":0,"widthPixels":0},"sheetId":0},"spec":{"altText":"","backgroundColor":{},"backgroundColorStyle":{},"basicChart":{"axis":[{"format":{"bold":false,"fontFamily":"","fontSize":0,"foregroundColor":{},"foregroundColorStyle":{},"italic":false,"link":{"uri":""},"strikethrough":false,"underline":false},"position":"","title":"","titleTextPosition":{"horizontalAlignment":""},"viewWindowOptions":{"viewWindowMax":"","viewWindowMin":"","viewWindowMode":""}}],"chartType":"","compareMode":"","domains":[{"domain":{"aggregateType":"","columnReference":{"name":""},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"intervalSize":"","maxValue":"","minValue":""}},"sourceRange":{"sources":[{}]}},"reversed":false}],"headerCount":0,"interpolateNulls":false,"legendPosition":"","lineSmoothing":false,"series":[{"color":{},"colorStyle":{},"dataLabel":{"customLabelData":{},"placement":"","textFormat":{},"type":""},"lineStyle":{"type":"","width":0},"pointStyle":{"shape":"","size":""},"series":{},"styleOverrides":[{"color":{},"colorStyle":{},"index":0,"pointStyle":{}}],"targetAxis":"","type":""}],"stackedType":"","threeDimensional":false,"totalDataLabel":{}},"bubbleChart":{"bubbleBorderColor":{},"bubbleBorderColorStyle":{},"bubbleLabels":{},"bubbleMaxRadiusSize":0,"bubbleMinRadiusSize":0,"bubbleOpacity":"","bubbleSizes":{},"bubbleTextStyle":{},"domain":{},"groupIds":{},"legendPosition":"","series":{}},"candlestickChart":{"data":[{"closeSeries":{"data":{}},"highSeries":{},"lowSeries":{},"openSeries":{}}],"domain":{"data":{},"reversed":false}},"dataSourceChartProperties":{"dataExecutionStatus":{"errorCode":"","errorMessage":"","lastRefreshTime":"","state":""},"dataSourceId":""},"filterSpecs":[{"columnIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{"type":"","values":[{"relativeDate":"","userEnteredValue":""}]},"hiddenValues":[],"visibleBackgroundColor":{},"visibleBackgroundColorStyle":{},"visibleForegroundColor":{},"visibleForegroundColorStyle":{}}}],"fontName":"","hiddenDimensionStrategy":"","histogramChart":{"bucketSize":"","legendPosition":"","outlierPercentile":"","series":[{"barColor":{},"barColorStyle":{},"data":{}}],"showItemDividers":false},"maximized":false,"orgChart":{"labels":{},"nodeColor":{},"nodeColorStyle":{},"nodeSize":"","parentLabels":{},"selectedNodeColor":{},"selectedNodeColorStyle":{},"tooltips":{}},"pieChart":{"domain":{},"legendPosition":"","pieHole":"","series":{},"threeDimensional":false},"scorecardChart":{"aggregateType":"","baselineValueData":{},"baselineValueFormat":{"comparisonType":"","description":"","negativeColor":{},"negativeColorStyle":{},"position":{},"positiveColor":{},"positiveColorStyle":{},"textFormat":{}},"customFormatOptions":{"prefix":"","suffix":""},"keyValueData":{},"keyValueFormat":{"position":{},"textFormat":{}},"numberFormatSource":"","scaleFactor":""},"sortSpecs":[{"backgroundColor":{},"backgroundColorStyle":{},"dataSourceColumnReference":{},"dimensionIndex":0,"foregroundColor":{},"foregroundColorStyle":{},"sortOrder":""}],"subtitle":"","subtitleTextFormat":{},"subtitleTextPosition":{},"title":"","titleTextFormat":{},"titleTextPosition":{},"treemapChart":{"colorData":{},"colorScale":{"maxValueColor":{},"maxValueColorStyle":{},"midValueColor":{},"midValueColorStyle":{},"minValueColor":{},"minValueColorStyle":{},"noDataColor":{},"noDataColorStyle":{}},"headerColor":{},"headerColorStyle":{},"hideTooltips":false,"hintedLevels":0,"labels":{},"levels":0,"maxValue":"","minValue":"","parentLabels":{},"sizeData":{},"textFormat":{}},"waterfallChart":{"connectorLineStyle":{},"domain":{"data":{},"reversed":false},"firstValueIsTotal":false,"hideConnectorLines":false,"series":[{"customSubtotals":[{"dataIsSubtotal":false,"label":"","subtotalIndex":0}],"data":{},"dataLabel":{},"hideTrailingSubtotal":false,"negativeColumnsStyle":{"color":{},"colorStyle":{},"label":""},"positiveColumnsStyle":{},"subtotalColumnsStyle":{}}],"stackedType":"","totalDataLabel":{}}}}},"addConditionalFormatRule":{"index":0,"rule":{"booleanRule":{"condition":{},"format":{"backgroundColor":{},"backgroundColorStyle":{},"borders":{"bottom":{"color":{},"colorStyle":{},"style":"","width":0},"left":{},"right":{},"top":{}},"horizontalAlignment":"","hyperlinkDisplayType":"","numberFormat":{"pattern":"","type":""},"padding":{"bottom":0,"left":0,"right":0,"top":0},"textDirection":"","textFormat":{},"textRotation":{"angle":0,"vertical":false},"verticalAlignment":"","wrapStrategy":""}},"gradientRule":{"maxpoint":{"color":{},"colorStyle":{},"type":"","value":""},"midpoint":{},"minpoint":{}},"ranges":[{}]}},"addDataSource":{"dataSource":{"calculatedColumns":[{"formula":"","reference":{}}],"dataSourceId":"","sheetId":0,"spec":{"bigQuery":{"projectId":"","querySpec":{"rawQuery":""},"tableSpec":{"datasetId":"","tableId":"","tableProjectId":""}},"parameters":[{"name":"","namedRangeId":"","range":{}}]}}},"addDimensionGroup":{"range":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0}},"addFilterView":{"filter":{"criteria":{},"filterSpecs":[{}],"filterViewId":0,"namedRangeId":"","range":{},"sortSpecs":[{}],"title":""}},"addNamedRange":{"namedRange":{"name":"","namedRangeId":"","range":{}}},"addProtectedRange":{"protectedRange":{"description":"","editors":{"domainUsersCanEdit":false,"groups":[],"users":[]},"namedRangeId":"","protectedRangeId":0,"range":{},"requestingUserCanEdit":false,"unprotectedRanges":[{}],"warningOnly":false}},"addSheet":{"properties":{"dataSourceSheetProperties":{"columns":[{}],"dataExecutionStatus":{},"dataSourceId":""},"gridProperties":{"columnCount":0,"columnGroupControlAfter":false,"frozenColumnCount":0,"frozenRowCount":0,"hideGridlines":false,"rowCount":0,"rowGroupControlAfter":false},"hidden":false,"index":0,"rightToLeft":false,"sheetId":0,"sheetType":"","tabColor":{},"tabColorStyle":{},"title":""}},"addSlicer":{"slicer":{"position":{},"slicerId":0,"spec":{"applyToPivotTables":false,"backgroundColor":{},"backgroundColorStyle":{},"columnIndex":0,"dataRange":{},"filterCriteria":{},"horizontalAlignment":"","textFormat":{},"title":""}}},"appendCells":{"fields":"","rows":[{"values":[{"dataSourceFormula":{"dataExecutionStatus":{},"dataSourceId":""},"dataSourceTable":{"columnSelectionType":"","columns":[{}],"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{}],"rowLimit":0,"sortSpecs":[{}]},"dataValidation":{"condition":{},"inputMessage":"","showCustomUi":false,"strict":false},"effectiveFormat":{},"effectiveValue":{"boolValue":false,"errorValue":{"message":"","type":""},"formulaValue":"","numberValue":"","stringValue":""},"formattedValue":"","hyperlink":"","note":"","pivotTable":{"columns":[{"dataSourceColumnReference":{},"groupLimit":{"applyOrder":0,"countLimit":0},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"end":"","interval":"","start":""},"manualRule":{"groups":[{"groupName":{},"items":[{}]}]}},"label":"","repeatHeadings":false,"showTotals":false,"sortOrder":"","sourceColumnOffset":0,"valueBucket":{"buckets":[{}],"valuesIndex":0},"valueMetadata":[{"collapsed":false,"value":{}}]}],"criteria":{},"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{"columnOffsetIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{},"visibleByDefault":false,"visibleValues":[]}}],"rows":[{}],"source":{},"valueLayout":"","values":[{"calculatedDisplayType":"","dataSourceColumnReference":{},"formula":"","name":"","sourceColumnOffset":0,"summarizeFunction":""}]},"textFormatRuns":[{"format":{},"startIndex":0}],"userEnteredFormat":{},"userEnteredValue":{}}]}],"sheetId":0},"appendDimension":{"dimension":"","length":0,"sheetId":0},"autoFill":{"range":{},"sourceAndDestination":{"dimension":"","fillLength":0,"source":{}},"useAlternateSeries":false},"autoResizeDimensions":{"dataSourceSheetDimensions":{"columnReferences":[{}],"sheetId":0},"dimensions":{}},"clearBasicFilter":{"sheetId":0},"copyPaste":{"destination":{},"pasteOrientation":"","pasteType":"","source":{}},"createDeveloperMetadata":{"developerMetadata":{"location":{"dimensionRange":{},"locationType":"","sheetId":0,"spreadsheet":false},"metadataId":0,"metadataKey":"","metadataValue":"","visibility":""}},"cutPaste":{"destination":{},"pasteType":"","source":{}},"deleteBanding":{"bandedRangeId":0},"deleteConditionalFormatRule":{"index":0,"sheetId":0},"deleteDataSource":{"dataSourceId":""},"deleteDeveloperMetadata":{"dataFilter":{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{},"metadataValue":"","visibility":""},"gridRange":{}}},"deleteDimension":{"range":{}},"deleteDimensionGroup":{"range":{}},"deleteDuplicates":{"comparisonColumns":[{}],"range":{}},"deleteEmbeddedObject":{"objectId":0},"deleteFilterView":{"filterId":0},"deleteNamedRange":{"namedRangeId":""},"deleteProtectedRange":{"protectedRangeId":0},"deleteRange":{"range":{},"shiftDimension":""},"deleteSheet":{"sheetId":0},"duplicateFilterView":{"filterId":0},"duplicateSheet":{"insertSheetIndex":0,"newSheetId":0,"newSheetName":"","sourceSheetId":0},"findReplace":{"allSheets":false,"find":"","includeFormulas":false,"matchCase":false,"matchEntireCell":false,"range":{},"replacement":"","searchByRegex":false,"sheetId":0},"insertDimension":{"inheritFromBefore":false,"range":{}},"insertRange":{"range":{},"shiftDimension":""},"mergeCells":{"mergeType":"","range":{}},"moveDimension":{"destinationIndex":0,"source":{}},"pasteData":{"coordinate":{},"data":"","delimiter":"","html":false,"type":""},"randomizeRange":{"range":{}},"refreshDataSource":{"dataSourceId":"","force":false,"isAll":false,"references":{"references":[{"chartId":0,"dataSourceFormulaCell":{},"dataSourcePivotTableAnchorCell":{},"dataSourceTableAnchorCell":{},"sheetId":""}]}},"repeatCell":{"cell":{},"fields":"","range":{}},"setBasicFilter":{"filter":{"criteria":{},"filterSpecs":[{}],"range":{},"sortSpecs":[{}]}},"setDataValidation":{"range":{},"rule":{}},"sortRange":{"range":{},"sortSpecs":[{}]},"textToColumns":{"delimiter":"","delimiterType":"","source":{}},"trimWhitespace":{"range":{}},"unmergeCells":{"range":{}},"updateBanding":{"bandedRange":{},"fields":""},"updateBorders":{"bottom":{},"innerHorizontal":{},"innerVertical":{},"left":{},"range":{},"right":{},"top":{}},"updateCells":{"fields":"","range":{},"rows":[{}],"start":{}},"updateChartSpec":{"chartId":0,"spec":{}},"updateConditionalFormatRule":{"index":0,"newIndex":0,"rule":{},"sheetId":0},"updateDataSource":{"dataSource":{},"fields":""},"updateDeveloperMetadata":{"dataFilters":[{}],"developerMetadata":{},"fields":""},"updateDimensionGroup":{"dimensionGroup":{"collapsed":false,"depth":0,"range":{}},"fields":""},"updateDimensionProperties":{"dataSourceSheetRange":{},"fields":"","properties":{"dataSourceColumnReference":{},"developerMetadata":[{}],"hiddenByFilter":false,"hiddenByUser":false,"pixelSize":0},"range":{}},"updateEmbeddedObjectBorder":{"border":{},"fields":"","objectId":0},"updateEmbeddedObjectPosition":{"fields":"","newPosition":{},"objectId":0},"updateFilterView":{"fields":"","filter":{}},"updateNamedRange":{"fields":"","namedRange":{}},"updateProtectedRange":{"fields":"","protectedRange":{}},"updateSheetProperties":{"fields":"","properties":{}},"updateSlicerSpec":{"fields":"","slicerId":0,"spec":{}},"updateSpreadsheetProperties":{"fields":"","properties":{"autoRecalc":"","defaultFormat":{},"iterativeCalculationSettings":{"convergenceThreshold":"","maxIterations":0},"locale":"","spreadsheetTheme":{"primaryFontFamily":"","themeColors":[{"color":{},"colorType":""}]},"timeZone":"","title":""}}}],"responseIncludeGridData":false,"responseRanges":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "includeSpreadsheetInResponse": false,\n "requests": [\n {\n "addBanding": {\n "bandedRange": {\n "bandedRangeId": 0,\n "columnProperties": {\n "firstBandColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "firstBandColorStyle": {\n "rgbColor": {},\n "themeColor": ""\n },\n "footerColor": {},\n "footerColorStyle": {},\n "headerColor": {},\n "headerColorStyle": {},\n "secondBandColor": {},\n "secondBandColorStyle": {}\n },\n "range": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n },\n "rowProperties": {}\n }\n },\n "addChart": {\n "chart": {\n "border": {\n "color": {},\n "colorStyle": {}\n },\n "chartId": 0,\n "position": {\n "newSheet": false,\n "overlayPosition": {\n "anchorCell": {\n "columnIndex": 0,\n "rowIndex": 0,\n "sheetId": 0\n },\n "heightPixels": 0,\n "offsetXPixels": 0,\n "offsetYPixels": 0,\n "widthPixels": 0\n },\n "sheetId": 0\n },\n "spec": {\n "altText": "",\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "basicChart": {\n "axis": [\n {\n "format": {\n "bold": false,\n "fontFamily": "",\n "fontSize": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "italic": false,\n "link": {\n "uri": ""\n },\n "strikethrough": false,\n "underline": false\n },\n "position": "",\n "title": "",\n "titleTextPosition": {\n "horizontalAlignment": ""\n },\n "viewWindowOptions": {\n "viewWindowMax": "",\n "viewWindowMin": "",\n "viewWindowMode": ""\n }\n }\n ],\n "chartType": "",\n "compareMode": "",\n "domains": [\n {\n "domain": {\n "aggregateType": "",\n "columnReference": {\n "name": ""\n },\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "intervalSize": "",\n "maxValue": "",\n "minValue": ""\n }\n },\n "sourceRange": {\n "sources": [\n {}\n ]\n }\n },\n "reversed": false\n }\n ],\n "headerCount": 0,\n "interpolateNulls": false,\n "legendPosition": "",\n "lineSmoothing": false,\n "series": [\n {\n "color": {},\n "colorStyle": {},\n "dataLabel": {\n "customLabelData": {},\n "placement": "",\n "textFormat": {},\n "type": ""\n },\n "lineStyle": {\n "type": "",\n "width": 0\n },\n "pointStyle": {\n "shape": "",\n "size": ""\n },\n "series": {},\n "styleOverrides": [\n {\n "color": {},\n "colorStyle": {},\n "index": 0,\n "pointStyle": {}\n }\n ],\n "targetAxis": "",\n "type": ""\n }\n ],\n "stackedType": "",\n "threeDimensional": false,\n "totalDataLabel": {}\n },\n "bubbleChart": {\n "bubbleBorderColor": {},\n "bubbleBorderColorStyle": {},\n "bubbleLabels": {},\n "bubbleMaxRadiusSize": 0,\n "bubbleMinRadiusSize": 0,\n "bubbleOpacity": "",\n "bubbleSizes": {},\n "bubbleTextStyle": {},\n "domain": {},\n "groupIds": {},\n "legendPosition": "",\n "series": {}\n },\n "candlestickChart": {\n "data": [\n {\n "closeSeries": {\n "data": {}\n },\n "highSeries": {},\n "lowSeries": {},\n "openSeries": {}\n }\n ],\n "domain": {\n "data": {},\n "reversed": false\n }\n },\n "dataSourceChartProperties": {\n "dataExecutionStatus": {\n "errorCode": "",\n "errorMessage": "",\n "lastRefreshTime": "",\n "state": ""\n },\n "dataSourceId": ""\n },\n "filterSpecs": [\n {\n "columnIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {\n "type": "",\n "values": [\n {\n "relativeDate": "",\n "userEnteredValue": ""\n }\n ]\n },\n "hiddenValues": [],\n "visibleBackgroundColor": {},\n "visibleBackgroundColorStyle": {},\n "visibleForegroundColor": {},\n "visibleForegroundColorStyle": {}\n }\n }\n ],\n "fontName": "",\n "hiddenDimensionStrategy": "",\n "histogramChart": {\n "bucketSize": "",\n "legendPosition": "",\n "outlierPercentile": "",\n "series": [\n {\n "barColor": {},\n "barColorStyle": {},\n "data": {}\n }\n ],\n "showItemDividers": false\n },\n "maximized": false,\n "orgChart": {\n "labels": {},\n "nodeColor": {},\n "nodeColorStyle": {},\n "nodeSize": "",\n "parentLabels": {},\n "selectedNodeColor": {},\n "selectedNodeColorStyle": {},\n "tooltips": {}\n },\n "pieChart": {\n "domain": {},\n "legendPosition": "",\n "pieHole": "",\n "series": {},\n "threeDimensional": false\n },\n "scorecardChart": {\n "aggregateType": "",\n "baselineValueData": {},\n "baselineValueFormat": {\n "comparisonType": "",\n "description": "",\n "negativeColor": {},\n "negativeColorStyle": {},\n "position": {},\n "positiveColor": {},\n "positiveColorStyle": {},\n "textFormat": {}\n },\n "customFormatOptions": {\n "prefix": "",\n "suffix": ""\n },\n "keyValueData": {},\n "keyValueFormat": {\n "position": {},\n "textFormat": {}\n },\n "numberFormatSource": "",\n "scaleFactor": ""\n },\n "sortSpecs": [\n {\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "dataSourceColumnReference": {},\n "dimensionIndex": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "sortOrder": ""\n }\n ],\n "subtitle": "",\n "subtitleTextFormat": {},\n "subtitleTextPosition": {},\n "title": "",\n "titleTextFormat": {},\n "titleTextPosition": {},\n "treemapChart": {\n "colorData": {},\n "colorScale": {\n "maxValueColor": {},\n "maxValueColorStyle": {},\n "midValueColor": {},\n "midValueColorStyle": {},\n "minValueColor": {},\n "minValueColorStyle": {},\n "noDataColor": {},\n "noDataColorStyle": {}\n },\n "headerColor": {},\n "headerColorStyle": {},\n "hideTooltips": false,\n "hintedLevels": 0,\n "labels": {},\n "levels": 0,\n "maxValue": "",\n "minValue": "",\n "parentLabels": {},\n "sizeData": {},\n "textFormat": {}\n },\n "waterfallChart": {\n "connectorLineStyle": {},\n "domain": {\n "data": {},\n "reversed": false\n },\n "firstValueIsTotal": false,\n "hideConnectorLines": false,\n "series": [\n {\n "customSubtotals": [\n {\n "dataIsSubtotal": false,\n "label": "",\n "subtotalIndex": 0\n }\n ],\n "data": {},\n "dataLabel": {},\n "hideTrailingSubtotal": false,\n "negativeColumnsStyle": {\n "color": {},\n "colorStyle": {},\n "label": ""\n },\n "positiveColumnsStyle": {},\n "subtotalColumnsStyle": {}\n }\n ],\n "stackedType": "",\n "totalDataLabel": {}\n }\n }\n }\n },\n "addConditionalFormatRule": {\n "index": 0,\n "rule": {\n "booleanRule": {\n "condition": {},\n "format": {\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "borders": {\n "bottom": {\n "color": {},\n "colorStyle": {},\n "style": "",\n "width": 0\n },\n "left": {},\n "right": {},\n "top": {}\n },\n "horizontalAlignment": "",\n "hyperlinkDisplayType": "",\n "numberFormat": {\n "pattern": "",\n "type": ""\n },\n "padding": {\n "bottom": 0,\n "left": 0,\n "right": 0,\n "top": 0\n },\n "textDirection": "",\n "textFormat": {},\n "textRotation": {\n "angle": 0,\n "vertical": false\n },\n "verticalAlignment": "",\n "wrapStrategy": ""\n }\n },\n "gradientRule": {\n "maxpoint": {\n "color": {},\n "colorStyle": {},\n "type": "",\n "value": ""\n },\n "midpoint": {},\n "minpoint": {}\n },\n "ranges": [\n {}\n ]\n }\n },\n "addDataSource": {\n "dataSource": {\n "calculatedColumns": [\n {\n "formula": "",\n "reference": {}\n }\n ],\n "dataSourceId": "",\n "sheetId": 0,\n "spec": {\n "bigQuery": {\n "projectId": "",\n "querySpec": {\n "rawQuery": ""\n },\n "tableSpec": {\n "datasetId": "",\n "tableId": "",\n "tableProjectId": ""\n }\n },\n "parameters": [\n {\n "name": "",\n "namedRangeId": "",\n "range": {}\n }\n ]\n }\n }\n },\n "addDimensionGroup": {\n "range": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n }\n },\n "addFilterView": {\n "filter": {\n "criteria": {},\n "filterSpecs": [\n {}\n ],\n "filterViewId": 0,\n "namedRangeId": "",\n "range": {},\n "sortSpecs": [\n {}\n ],\n "title": ""\n }\n },\n "addNamedRange": {\n "namedRange": {\n "name": "",\n "namedRangeId": "",\n "range": {}\n }\n },\n "addProtectedRange": {\n "protectedRange": {\n "description": "",\n "editors": {\n "domainUsersCanEdit": false,\n "groups": [],\n "users": []\n },\n "namedRangeId": "",\n "protectedRangeId": 0,\n "range": {},\n "requestingUserCanEdit": false,\n "unprotectedRanges": [\n {}\n ],\n "warningOnly": false\n }\n },\n "addSheet": {\n "properties": {\n "dataSourceSheetProperties": {\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "gridProperties": {\n "columnCount": 0,\n "columnGroupControlAfter": false,\n "frozenColumnCount": 0,\n "frozenRowCount": 0,\n "hideGridlines": false,\n "rowCount": 0,\n "rowGroupControlAfter": false\n },\n "hidden": false,\n "index": 0,\n "rightToLeft": false,\n "sheetId": 0,\n "sheetType": "",\n "tabColor": {},\n "tabColorStyle": {},\n "title": ""\n }\n },\n "addSlicer": {\n "slicer": {\n "position": {},\n "slicerId": 0,\n "spec": {\n "applyToPivotTables": false,\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "columnIndex": 0,\n "dataRange": {},\n "filterCriteria": {},\n "horizontalAlignment": "",\n "textFormat": {},\n "title": ""\n }\n }\n },\n "appendCells": {\n "fields": "",\n "rows": [\n {\n "values": [\n {\n "dataSourceFormula": {\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "dataSourceTable": {\n "columnSelectionType": "",\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {}\n ],\n "rowLimit": 0,\n "sortSpecs": [\n {}\n ]\n },\n "dataValidation": {\n "condition": {},\n "inputMessage": "",\n "showCustomUi": false,\n "strict": false\n },\n "effectiveFormat": {},\n "effectiveValue": {\n "boolValue": false,\n "errorValue": {\n "message": "",\n "type": ""\n },\n "formulaValue": "",\n "numberValue": "",\n "stringValue": ""\n },\n "formattedValue": "",\n "hyperlink": "",\n "note": "",\n "pivotTable": {\n "columns": [\n {\n "dataSourceColumnReference": {},\n "groupLimit": {\n "applyOrder": 0,\n "countLimit": 0\n },\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "end": "",\n "interval": "",\n "start": ""\n },\n "manualRule": {\n "groups": [\n {\n "groupName": {},\n "items": [\n {}\n ]\n }\n ]\n }\n },\n "label": "",\n "repeatHeadings": false,\n "showTotals": false,\n "sortOrder": "",\n "sourceColumnOffset": 0,\n "valueBucket": {\n "buckets": [\n {}\n ],\n "valuesIndex": 0\n },\n "valueMetadata": [\n {\n "collapsed": false,\n "value": {}\n }\n ]\n }\n ],\n "criteria": {},\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {\n "columnOffsetIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {},\n "visibleByDefault": false,\n "visibleValues": []\n }\n }\n ],\n "rows": [\n {}\n ],\n "source": {},\n "valueLayout": "",\n "values": [\n {\n "calculatedDisplayType": "",\n "dataSourceColumnReference": {},\n "formula": "",\n "name": "",\n "sourceColumnOffset": 0,\n "summarizeFunction": ""\n }\n ]\n },\n "textFormatRuns": [\n {\n "format": {},\n "startIndex": 0\n }\n ],\n "userEnteredFormat": {},\n "userEnteredValue": {}\n }\n ]\n }\n ],\n "sheetId": 0\n },\n "appendDimension": {\n "dimension": "",\n "length": 0,\n "sheetId": 0\n },\n "autoFill": {\n "range": {},\n "sourceAndDestination": {\n "dimension": "",\n "fillLength": 0,\n "source": {}\n },\n "useAlternateSeries": false\n },\n "autoResizeDimensions": {\n "dataSourceSheetDimensions": {\n "columnReferences": [\n {}\n ],\n "sheetId": 0\n },\n "dimensions": {}\n },\n "clearBasicFilter": {\n "sheetId": 0\n },\n "copyPaste": {\n "destination": {},\n "pasteOrientation": "",\n "pasteType": "",\n "source": {}\n },\n "createDeveloperMetadata": {\n "developerMetadata": {\n "location": {\n "dimensionRange": {},\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataId": 0,\n "metadataKey": "",\n "metadataValue": "",\n "visibility": ""\n }\n },\n "cutPaste": {\n "destination": {},\n "pasteType": "",\n "source": {}\n },\n "deleteBanding": {\n "bandedRangeId": 0\n },\n "deleteConditionalFormatRule": {\n "index": 0,\n "sheetId": 0\n },\n "deleteDataSource": {\n "dataSourceId": ""\n },\n "deleteDeveloperMetadata": {\n "dataFilter": {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {},\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {}\n }\n },\n "deleteDimension": {\n "range": {}\n },\n "deleteDimensionGroup": {\n "range": {}\n },\n "deleteDuplicates": {\n "comparisonColumns": [\n {}\n ],\n "range": {}\n },\n "deleteEmbeddedObject": {\n "objectId": 0\n },\n "deleteFilterView": {\n "filterId": 0\n },\n "deleteNamedRange": {\n "namedRangeId": ""\n },\n "deleteProtectedRange": {\n "protectedRangeId": 0\n },\n "deleteRange": {\n "range": {},\n "shiftDimension": ""\n },\n "deleteSheet": {\n "sheetId": 0\n },\n "duplicateFilterView": {\n "filterId": 0\n },\n "duplicateSheet": {\n "insertSheetIndex": 0,\n "newSheetId": 0,\n "newSheetName": "",\n "sourceSheetId": 0\n },\n "findReplace": {\n "allSheets": false,\n "find": "",\n "includeFormulas": false,\n "matchCase": false,\n "matchEntireCell": false,\n "range": {},\n "replacement": "",\n "searchByRegex": false,\n "sheetId": 0\n },\n "insertDimension": {\n "inheritFromBefore": false,\n "range": {}\n },\n "insertRange": {\n "range": {},\n "shiftDimension": ""\n },\n "mergeCells": {\n "mergeType": "",\n "range": {}\n },\n "moveDimension": {\n "destinationIndex": 0,\n "source": {}\n },\n "pasteData": {\n "coordinate": {},\n "data": "",\n "delimiter": "",\n "html": false,\n "type": ""\n },\n "randomizeRange": {\n "range": {}\n },\n "refreshDataSource": {\n "dataSourceId": "",\n "force": false,\n "isAll": false,\n "references": {\n "references": [\n {\n "chartId": 0,\n "dataSourceFormulaCell": {},\n "dataSourcePivotTableAnchorCell": {},\n "dataSourceTableAnchorCell": {},\n "sheetId": ""\n }\n ]\n }\n },\n "repeatCell": {\n "cell": {},\n "fields": "",\n "range": {}\n },\n "setBasicFilter": {\n "filter": {\n "criteria": {},\n "filterSpecs": [\n {}\n ],\n "range": {},\n "sortSpecs": [\n {}\n ]\n }\n },\n "setDataValidation": {\n "range": {},\n "rule": {}\n },\n "sortRange": {\n "range": {},\n "sortSpecs": [\n {}\n ]\n },\n "textToColumns": {\n "delimiter": "",\n "delimiterType": "",\n "source": {}\n },\n "trimWhitespace": {\n "range": {}\n },\n "unmergeCells": {\n "range": {}\n },\n "updateBanding": {\n "bandedRange": {},\n "fields": ""\n },\n "updateBorders": {\n "bottom": {},\n "innerHorizontal": {},\n "innerVertical": {},\n "left": {},\n "range": {},\n "right": {},\n "top": {}\n },\n "updateCells": {\n "fields": "",\n "range": {},\n "rows": [\n {}\n ],\n "start": {}\n },\n "updateChartSpec": {\n "chartId": 0,\n "spec": {}\n },\n "updateConditionalFormatRule": {\n "index": 0,\n "newIndex": 0,\n "rule": {},\n "sheetId": 0\n },\n "updateDataSource": {\n "dataSource": {},\n "fields": ""\n },\n "updateDeveloperMetadata": {\n "dataFilters": [\n {}\n ],\n "developerMetadata": {},\n "fields": ""\n },\n "updateDimensionGroup": {\n "dimensionGroup": {\n "collapsed": false,\n "depth": 0,\n "range": {}\n },\n "fields": ""\n },\n "updateDimensionProperties": {\n "dataSourceSheetRange": {},\n "fields": "",\n "properties": {\n "dataSourceColumnReference": {},\n "developerMetadata": [\n {}\n ],\n "hiddenByFilter": false,\n "hiddenByUser": false,\n "pixelSize": 0\n },\n "range": {}\n },\n "updateEmbeddedObjectBorder": {\n "border": {},\n "fields": "",\n "objectId": 0\n },\n "updateEmbeddedObjectPosition": {\n "fields": "",\n "newPosition": {},\n "objectId": 0\n },\n "updateFilterView": {\n "fields": "",\n "filter": {}\n },\n "updateNamedRange": {\n "fields": "",\n "namedRange": {}\n },\n "updateProtectedRange": {\n "fields": "",\n "protectedRange": {}\n },\n "updateSheetProperties": {\n "fields": "",\n "properties": {}\n },\n "updateSlicerSpec": {\n "fields": "",\n "slicerId": 0,\n "spec": {}\n },\n "updateSpreadsheetProperties": {\n "fields": "",\n "properties": {\n "autoRecalc": "",\n "defaultFormat": {},\n "iterativeCalculationSettings": {\n "convergenceThreshold": "",\n "maxIterations": 0\n },\n "locale": "",\n "spreadsheetTheme": {\n "primaryFontFamily": "",\n "themeColors": [\n {\n "color": {},\n "colorType": ""\n }\n ]\n },\n "timeZone": "",\n "title": ""\n }\n }\n }\n ],\n "responseIncludeGridData": false,\n "responseRanges": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId:batchUpdate',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
includeSpreadsheetInResponse: false,
requests: [
{
addBanding: {
bandedRange: {
bandedRangeId: 0,
columnProperties: {
firstBandColor: {alpha: '', blue: '', green: '', red: ''},
firstBandColorStyle: {rgbColor: {}, themeColor: ''},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
},
rowProperties: {}
}
},
addChart: {
chart: {
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {name: ''},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
},
addConditionalFormatRule: {
index: 0,
rule: {
booleanRule: {
condition: {},
format: {
backgroundColor: {},
backgroundColorStyle: {},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
}
},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
},
addDataSource: {
dataSource: {
calculatedColumns: [{formula: '', reference: {}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [{name: '', namedRangeId: '', range: {}}]
}
}
},
addDimensionGroup: {range: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0}},
addFilterView: {
filter: {
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
},
addNamedRange: {namedRange: {name: '', namedRangeId: '', range: {}}},
addProtectedRange: {
protectedRange: {
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
},
addSheet: {
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
}
},
addSlicer: {
slicer: {
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
},
appendCells: {
fields: '',
rows: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
sheetId: 0
},
appendDimension: {dimension: '', length: 0, sheetId: 0},
autoFill: {
range: {},
sourceAndDestination: {dimension: '', fillLength: 0, source: {}},
useAlternateSeries: false
},
autoResizeDimensions: {
dataSourceSheetDimensions: {columnReferences: [{}], sheetId: 0},
dimensions: {}
},
clearBasicFilter: {sheetId: 0},
copyPaste: {destination: {}, pasteOrientation: '', pasteType: '', source: {}},
createDeveloperMetadata: {
developerMetadata: {
location: {dimensionRange: {}, locationType: '', sheetId: 0, spreadsheet: false},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
},
cutPaste: {destination: {}, pasteType: '', source: {}},
deleteBanding: {bandedRangeId: 0},
deleteConditionalFormatRule: {index: 0, sheetId: 0},
deleteDataSource: {dataSourceId: ''},
deleteDeveloperMetadata: {
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {},
metadataValue: '',
visibility: ''
},
gridRange: {}
}
},
deleteDimension: {range: {}},
deleteDimensionGroup: {range: {}},
deleteDuplicates: {comparisonColumns: [{}], range: {}},
deleteEmbeddedObject: {objectId: 0},
deleteFilterView: {filterId: 0},
deleteNamedRange: {namedRangeId: ''},
deleteProtectedRange: {protectedRangeId: 0},
deleteRange: {range: {}, shiftDimension: ''},
deleteSheet: {sheetId: 0},
duplicateFilterView: {filterId: 0},
duplicateSheet: {insertSheetIndex: 0, newSheetId: 0, newSheetName: '', sourceSheetId: 0},
findReplace: {
allSheets: false,
find: '',
includeFormulas: false,
matchCase: false,
matchEntireCell: false,
range: {},
replacement: '',
searchByRegex: false,
sheetId: 0
},
insertDimension: {inheritFromBefore: false, range: {}},
insertRange: {range: {}, shiftDimension: ''},
mergeCells: {mergeType: '', range: {}},
moveDimension: {destinationIndex: 0, source: {}},
pasteData: {coordinate: {}, data: '', delimiter: '', html: false, type: ''},
randomizeRange: {range: {}},
refreshDataSource: {
dataSourceId: '',
force: false,
isAll: false,
references: {
references: [
{
chartId: 0,
dataSourceFormulaCell: {},
dataSourcePivotTableAnchorCell: {},
dataSourceTableAnchorCell: {},
sheetId: ''
}
]
}
},
repeatCell: {cell: {}, fields: '', range: {}},
setBasicFilter: {filter: {criteria: {}, filterSpecs: [{}], range: {}, sortSpecs: [{}]}},
setDataValidation: {range: {}, rule: {}},
sortRange: {range: {}, sortSpecs: [{}]},
textToColumns: {delimiter: '', delimiterType: '', source: {}},
trimWhitespace: {range: {}},
unmergeCells: {range: {}},
updateBanding: {bandedRange: {}, fields: ''},
updateBorders: {
bottom: {},
innerHorizontal: {},
innerVertical: {},
left: {},
range: {},
right: {},
top: {}
},
updateCells: {fields: '', range: {}, rows: [{}], start: {}},
updateChartSpec: {chartId: 0, spec: {}},
updateConditionalFormatRule: {index: 0, newIndex: 0, rule: {}, sheetId: 0},
updateDataSource: {dataSource: {}, fields: ''},
updateDeveloperMetadata: {dataFilters: [{}], developerMetadata: {}, fields: ''},
updateDimensionGroup: {dimensionGroup: {collapsed: false, depth: 0, range: {}}, fields: ''},
updateDimensionProperties: {
dataSourceSheetRange: {},
fields: '',
properties: {
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
},
range: {}
},
updateEmbeddedObjectBorder: {border: {}, fields: '', objectId: 0},
updateEmbeddedObjectPosition: {fields: '', newPosition: {}, objectId: 0},
updateFilterView: {fields: '', filter: {}},
updateNamedRange: {fields: '', namedRange: {}},
updateProtectedRange: {fields: '', protectedRange: {}},
updateSheetProperties: {fields: '', properties: {}},
updateSlicerSpec: {fields: '', slicerId: 0, spec: {}},
updateSpreadsheetProperties: {
fields: '',
properties: {
autoRecalc: '',
defaultFormat: {},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
}
}
}
],
responseIncludeGridData: false,
responseRanges: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate',
headers: {'content-type': 'application/json'},
body: {
includeSpreadsheetInResponse: false,
requests: [
{
addBanding: {
bandedRange: {
bandedRangeId: 0,
columnProperties: {
firstBandColor: {alpha: '', blue: '', green: '', red: ''},
firstBandColorStyle: {rgbColor: {}, themeColor: ''},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
},
rowProperties: {}
}
},
addChart: {
chart: {
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {name: ''},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
},
addConditionalFormatRule: {
index: 0,
rule: {
booleanRule: {
condition: {},
format: {
backgroundColor: {},
backgroundColorStyle: {},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
}
},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
},
addDataSource: {
dataSource: {
calculatedColumns: [{formula: '', reference: {}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [{name: '', namedRangeId: '', range: {}}]
}
}
},
addDimensionGroup: {range: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0}},
addFilterView: {
filter: {
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
},
addNamedRange: {namedRange: {name: '', namedRangeId: '', range: {}}},
addProtectedRange: {
protectedRange: {
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
},
addSheet: {
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
}
},
addSlicer: {
slicer: {
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
},
appendCells: {
fields: '',
rows: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
sheetId: 0
},
appendDimension: {dimension: '', length: 0, sheetId: 0},
autoFill: {
range: {},
sourceAndDestination: {dimension: '', fillLength: 0, source: {}},
useAlternateSeries: false
},
autoResizeDimensions: {
dataSourceSheetDimensions: {columnReferences: [{}], sheetId: 0},
dimensions: {}
},
clearBasicFilter: {sheetId: 0},
copyPaste: {destination: {}, pasteOrientation: '', pasteType: '', source: {}},
createDeveloperMetadata: {
developerMetadata: {
location: {dimensionRange: {}, locationType: '', sheetId: 0, spreadsheet: false},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
},
cutPaste: {destination: {}, pasteType: '', source: {}},
deleteBanding: {bandedRangeId: 0},
deleteConditionalFormatRule: {index: 0, sheetId: 0},
deleteDataSource: {dataSourceId: ''},
deleteDeveloperMetadata: {
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {},
metadataValue: '',
visibility: ''
},
gridRange: {}
}
},
deleteDimension: {range: {}},
deleteDimensionGroup: {range: {}},
deleteDuplicates: {comparisonColumns: [{}], range: {}},
deleteEmbeddedObject: {objectId: 0},
deleteFilterView: {filterId: 0},
deleteNamedRange: {namedRangeId: ''},
deleteProtectedRange: {protectedRangeId: 0},
deleteRange: {range: {}, shiftDimension: ''},
deleteSheet: {sheetId: 0},
duplicateFilterView: {filterId: 0},
duplicateSheet: {insertSheetIndex: 0, newSheetId: 0, newSheetName: '', sourceSheetId: 0},
findReplace: {
allSheets: false,
find: '',
includeFormulas: false,
matchCase: false,
matchEntireCell: false,
range: {},
replacement: '',
searchByRegex: false,
sheetId: 0
},
insertDimension: {inheritFromBefore: false, range: {}},
insertRange: {range: {}, shiftDimension: ''},
mergeCells: {mergeType: '', range: {}},
moveDimension: {destinationIndex: 0, source: {}},
pasteData: {coordinate: {}, data: '', delimiter: '', html: false, type: ''},
randomizeRange: {range: {}},
refreshDataSource: {
dataSourceId: '',
force: false,
isAll: false,
references: {
references: [
{
chartId: 0,
dataSourceFormulaCell: {},
dataSourcePivotTableAnchorCell: {},
dataSourceTableAnchorCell: {},
sheetId: ''
}
]
}
},
repeatCell: {cell: {}, fields: '', range: {}},
setBasicFilter: {filter: {criteria: {}, filterSpecs: [{}], range: {}, sortSpecs: [{}]}},
setDataValidation: {range: {}, rule: {}},
sortRange: {range: {}, sortSpecs: [{}]},
textToColumns: {delimiter: '', delimiterType: '', source: {}},
trimWhitespace: {range: {}},
unmergeCells: {range: {}},
updateBanding: {bandedRange: {}, fields: ''},
updateBorders: {
bottom: {},
innerHorizontal: {},
innerVertical: {},
left: {},
range: {},
right: {},
top: {}
},
updateCells: {fields: '', range: {}, rows: [{}], start: {}},
updateChartSpec: {chartId: 0, spec: {}},
updateConditionalFormatRule: {index: 0, newIndex: 0, rule: {}, sheetId: 0},
updateDataSource: {dataSource: {}, fields: ''},
updateDeveloperMetadata: {dataFilters: [{}], developerMetadata: {}, fields: ''},
updateDimensionGroup: {dimensionGroup: {collapsed: false, depth: 0, range: {}}, fields: ''},
updateDimensionProperties: {
dataSourceSheetRange: {},
fields: '',
properties: {
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
},
range: {}
},
updateEmbeddedObjectBorder: {border: {}, fields: '', objectId: 0},
updateEmbeddedObjectPosition: {fields: '', newPosition: {}, objectId: 0},
updateFilterView: {fields: '', filter: {}},
updateNamedRange: {fields: '', namedRange: {}},
updateProtectedRange: {fields: '', protectedRange: {}},
updateSheetProperties: {fields: '', properties: {}},
updateSlicerSpec: {fields: '', slicerId: 0, spec: {}},
updateSpreadsheetProperties: {
fields: '',
properties: {
autoRecalc: '',
defaultFormat: {},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
}
}
}
],
responseIncludeGridData: false,
responseRanges: []
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
includeSpreadsheetInResponse: false,
requests: [
{
addBanding: {
bandedRange: {
bandedRangeId: 0,
columnProperties: {
firstBandColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
firstBandColorStyle: {
rgbColor: {},
themeColor: ''
},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
},
rowProperties: {}
}
},
addChart: {
chart: {
border: {
color: {},
colorStyle: {}
},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {
columnIndex: 0,
rowIndex: 0,
sheetId: 0
},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {
uri: ''
},
strikethrough: false,
underline: false
},
position: '',
title: '',
titleTextPosition: {
horizontalAlignment: ''
},
viewWindowOptions: {
viewWindowMax: '',
viewWindowMin: '',
viewWindowMode: ''
}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {
name: ''
},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
intervalSize: '',
maxValue: '',
minValue: ''
}
},
sourceRange: {
sources: [
{}
]
}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {
customLabelData: {},
placement: '',
textFormat: {},
type: ''
},
lineStyle: {
type: '',
width: 0
},
pointStyle: {
shape: '',
size: ''
},
series: {},
styleOverrides: [
{
color: {},
colorStyle: {},
index: 0,
pointStyle: {}
}
],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [
{
closeSeries: {
data: {}
},
highSeries: {},
lowSeries: {},
openSeries: {}
}
],
domain: {
data: {},
reversed: false
}
},
dataSourceChartProperties: {
dataExecutionStatus: {
errorCode: '',
errorMessage: '',
lastRefreshTime: '',
state: ''
},
dataSourceId: ''
},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {
type: '',
values: [
{
relativeDate: '',
userEnteredValue: ''
}
]
},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [
{
barColor: {},
barColorStyle: {},
data: {}
}
],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {
prefix: '',
suffix: ''
},
keyValueData: {},
keyValueFormat: {
position: {},
textFormat: {}
},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {
data: {},
reversed: false
},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [
{
dataIsSubtotal: false,
label: '',
subtotalIndex: 0
}
],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {
color: {},
colorStyle: {},
label: ''
},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
},
addConditionalFormatRule: {
index: 0,
rule: {
booleanRule: {
condition: {},
format: {
backgroundColor: {},
backgroundColorStyle: {},
borders: {
bottom: {
color: {},
colorStyle: {},
style: '',
width: 0
},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {
pattern: '',
type: ''
},
padding: {
bottom: 0,
left: 0,
right: 0,
top: 0
},
textDirection: '',
textFormat: {},
textRotation: {
angle: 0,
vertical: false
},
verticalAlignment: '',
wrapStrategy: ''
}
},
gradientRule: {
maxpoint: {
color: {},
colorStyle: {},
type: '',
value: ''
},
midpoint: {},
minpoint: {}
},
ranges: [
{}
]
}
},
addDataSource: {
dataSource: {
calculatedColumns: [
{
formula: '',
reference: {}
}
],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {
rawQuery: ''
},
tableSpec: {
datasetId: '',
tableId: '',
tableProjectId: ''
}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {}
}
]
}
}
},
addDimensionGroup: {
range: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
}
},
addFilterView: {
filter: {
criteria: {},
filterSpecs: [
{}
],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [
{}
],
title: ''
}
},
addNamedRange: {
namedRange: {
name: '',
namedRangeId: '',
range: {}
}
},
addProtectedRange: {
protectedRange: {
description: '',
editors: {
domainUsersCanEdit: false,
groups: [],
users: []
},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [
{}
],
warningOnly: false
}
},
addSheet: {
properties: {
dataSourceSheetProperties: {
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: ''
},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
}
},
addSlicer: {
slicer: {
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
},
appendCells: {
fields: '',
rows: [
{
values: [
{
dataSourceFormula: {
dataExecutionStatus: {},
dataSourceId: ''
},
dataSourceTable: {
columnSelectionType: '',
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{}
],
rowLimit: 0,
sortSpecs: [
{}
]
},
dataValidation: {
condition: {},
inputMessage: '',
showCustomUi: false,
strict: false
},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {
message: '',
type: ''
},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {
applyOrder: 0,
countLimit: 0
},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
end: '',
interval: '',
start: ''
},
manualRule: {
groups: [
{
groupName: {},
items: [
{}
]
}
]
}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {
buckets: [
{}
],
valuesIndex: 0
},
valueMetadata: [
{
collapsed: false,
value: {}
}
]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {},
visibleByDefault: false,
visibleValues: []
}
}
],
rows: [
{}
],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [
{
format: {},
startIndex: 0
}
],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
sheetId: 0
},
appendDimension: {
dimension: '',
length: 0,
sheetId: 0
},
autoFill: {
range: {},
sourceAndDestination: {
dimension: '',
fillLength: 0,
source: {}
},
useAlternateSeries: false
},
autoResizeDimensions: {
dataSourceSheetDimensions: {
columnReferences: [
{}
],
sheetId: 0
},
dimensions: {}
},
clearBasicFilter: {
sheetId: 0
},
copyPaste: {
destination: {},
pasteOrientation: '',
pasteType: '',
source: {}
},
createDeveloperMetadata: {
developerMetadata: {
location: {
dimensionRange: {},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
},
cutPaste: {
destination: {},
pasteType: '',
source: {}
},
deleteBanding: {
bandedRangeId: 0
},
deleteConditionalFormatRule: {
index: 0,
sheetId: 0
},
deleteDataSource: {
dataSourceId: ''
},
deleteDeveloperMetadata: {
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {},
metadataValue: '',
visibility: ''
},
gridRange: {}
}
},
deleteDimension: {
range: {}
},
deleteDimensionGroup: {
range: {}
},
deleteDuplicates: {
comparisonColumns: [
{}
],
range: {}
},
deleteEmbeddedObject: {
objectId: 0
},
deleteFilterView: {
filterId: 0
},
deleteNamedRange: {
namedRangeId: ''
},
deleteProtectedRange: {
protectedRangeId: 0
},
deleteRange: {
range: {},
shiftDimension: ''
},
deleteSheet: {
sheetId: 0
},
duplicateFilterView: {
filterId: 0
},
duplicateSheet: {
insertSheetIndex: 0,
newSheetId: 0,
newSheetName: '',
sourceSheetId: 0
},
findReplace: {
allSheets: false,
find: '',
includeFormulas: false,
matchCase: false,
matchEntireCell: false,
range: {},
replacement: '',
searchByRegex: false,
sheetId: 0
},
insertDimension: {
inheritFromBefore: false,
range: {}
},
insertRange: {
range: {},
shiftDimension: ''
},
mergeCells: {
mergeType: '',
range: {}
},
moveDimension: {
destinationIndex: 0,
source: {}
},
pasteData: {
coordinate: {},
data: '',
delimiter: '',
html: false,
type: ''
},
randomizeRange: {
range: {}
},
refreshDataSource: {
dataSourceId: '',
force: false,
isAll: false,
references: {
references: [
{
chartId: 0,
dataSourceFormulaCell: {},
dataSourcePivotTableAnchorCell: {},
dataSourceTableAnchorCell: {},
sheetId: ''
}
]
}
},
repeatCell: {
cell: {},
fields: '',
range: {}
},
setBasicFilter: {
filter: {
criteria: {},
filterSpecs: [
{}
],
range: {},
sortSpecs: [
{}
]
}
},
setDataValidation: {
range: {},
rule: {}
},
sortRange: {
range: {},
sortSpecs: [
{}
]
},
textToColumns: {
delimiter: '',
delimiterType: '',
source: {}
},
trimWhitespace: {
range: {}
},
unmergeCells: {
range: {}
},
updateBanding: {
bandedRange: {},
fields: ''
},
updateBorders: {
bottom: {},
innerHorizontal: {},
innerVertical: {},
left: {},
range: {},
right: {},
top: {}
},
updateCells: {
fields: '',
range: {},
rows: [
{}
],
start: {}
},
updateChartSpec: {
chartId: 0,
spec: {}
},
updateConditionalFormatRule: {
index: 0,
newIndex: 0,
rule: {},
sheetId: 0
},
updateDataSource: {
dataSource: {},
fields: ''
},
updateDeveloperMetadata: {
dataFilters: [
{}
],
developerMetadata: {},
fields: ''
},
updateDimensionGroup: {
dimensionGroup: {
collapsed: false,
depth: 0,
range: {}
},
fields: ''
},
updateDimensionProperties: {
dataSourceSheetRange: {},
fields: '',
properties: {
dataSourceColumnReference: {},
developerMetadata: [
{}
],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
},
range: {}
},
updateEmbeddedObjectBorder: {
border: {},
fields: '',
objectId: 0
},
updateEmbeddedObjectPosition: {
fields: '',
newPosition: {},
objectId: 0
},
updateFilterView: {
fields: '',
filter: {}
},
updateNamedRange: {
fields: '',
namedRange: {}
},
updateProtectedRange: {
fields: '',
protectedRange: {}
},
updateSheetProperties: {
fields: '',
properties: {}
},
updateSlicerSpec: {
fields: '',
slicerId: 0,
spec: {}
},
updateSpreadsheetProperties: {
fields: '',
properties: {
autoRecalc: '',
defaultFormat: {},
iterativeCalculationSettings: {
convergenceThreshold: '',
maxIterations: 0
},
locale: '',
spreadsheetTheme: {
primaryFontFamily: '',
themeColors: [
{
color: {},
colorType: ''
}
]
},
timeZone: '',
title: ''
}
}
}
],
responseIncludeGridData: false,
responseRanges: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate',
headers: {'content-type': 'application/json'},
data: {
includeSpreadsheetInResponse: false,
requests: [
{
addBanding: {
bandedRange: {
bandedRangeId: 0,
columnProperties: {
firstBandColor: {alpha: '', blue: '', green: '', red: ''},
firstBandColorStyle: {rgbColor: {}, themeColor: ''},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
},
rowProperties: {}
}
},
addChart: {
chart: {
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {name: ''},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
},
addConditionalFormatRule: {
index: 0,
rule: {
booleanRule: {
condition: {},
format: {
backgroundColor: {},
backgroundColorStyle: {},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
}
},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
},
addDataSource: {
dataSource: {
calculatedColumns: [{formula: '', reference: {}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [{name: '', namedRangeId: '', range: {}}]
}
}
},
addDimensionGroup: {range: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0}},
addFilterView: {
filter: {
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
},
addNamedRange: {namedRange: {name: '', namedRangeId: '', range: {}}},
addProtectedRange: {
protectedRange: {
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
},
addSheet: {
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
}
},
addSlicer: {
slicer: {
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
},
appendCells: {
fields: '',
rows: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
sheetId: 0
},
appendDimension: {dimension: '', length: 0, sheetId: 0},
autoFill: {
range: {},
sourceAndDestination: {dimension: '', fillLength: 0, source: {}},
useAlternateSeries: false
},
autoResizeDimensions: {
dataSourceSheetDimensions: {columnReferences: [{}], sheetId: 0},
dimensions: {}
},
clearBasicFilter: {sheetId: 0},
copyPaste: {destination: {}, pasteOrientation: '', pasteType: '', source: {}},
createDeveloperMetadata: {
developerMetadata: {
location: {dimensionRange: {}, locationType: '', sheetId: 0, spreadsheet: false},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
},
cutPaste: {destination: {}, pasteType: '', source: {}},
deleteBanding: {bandedRangeId: 0},
deleteConditionalFormatRule: {index: 0, sheetId: 0},
deleteDataSource: {dataSourceId: ''},
deleteDeveloperMetadata: {
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {},
metadataValue: '',
visibility: ''
},
gridRange: {}
}
},
deleteDimension: {range: {}},
deleteDimensionGroup: {range: {}},
deleteDuplicates: {comparisonColumns: [{}], range: {}},
deleteEmbeddedObject: {objectId: 0},
deleteFilterView: {filterId: 0},
deleteNamedRange: {namedRangeId: ''},
deleteProtectedRange: {protectedRangeId: 0},
deleteRange: {range: {}, shiftDimension: ''},
deleteSheet: {sheetId: 0},
duplicateFilterView: {filterId: 0},
duplicateSheet: {insertSheetIndex: 0, newSheetId: 0, newSheetName: '', sourceSheetId: 0},
findReplace: {
allSheets: false,
find: '',
includeFormulas: false,
matchCase: false,
matchEntireCell: false,
range: {},
replacement: '',
searchByRegex: false,
sheetId: 0
},
insertDimension: {inheritFromBefore: false, range: {}},
insertRange: {range: {}, shiftDimension: ''},
mergeCells: {mergeType: '', range: {}},
moveDimension: {destinationIndex: 0, source: {}},
pasteData: {coordinate: {}, data: '', delimiter: '', html: false, type: ''},
randomizeRange: {range: {}},
refreshDataSource: {
dataSourceId: '',
force: false,
isAll: false,
references: {
references: [
{
chartId: 0,
dataSourceFormulaCell: {},
dataSourcePivotTableAnchorCell: {},
dataSourceTableAnchorCell: {},
sheetId: ''
}
]
}
},
repeatCell: {cell: {}, fields: '', range: {}},
setBasicFilter: {filter: {criteria: {}, filterSpecs: [{}], range: {}, sortSpecs: [{}]}},
setDataValidation: {range: {}, rule: {}},
sortRange: {range: {}, sortSpecs: [{}]},
textToColumns: {delimiter: '', delimiterType: '', source: {}},
trimWhitespace: {range: {}},
unmergeCells: {range: {}},
updateBanding: {bandedRange: {}, fields: ''},
updateBorders: {
bottom: {},
innerHorizontal: {},
innerVertical: {},
left: {},
range: {},
right: {},
top: {}
},
updateCells: {fields: '', range: {}, rows: [{}], start: {}},
updateChartSpec: {chartId: 0, spec: {}},
updateConditionalFormatRule: {index: 0, newIndex: 0, rule: {}, sheetId: 0},
updateDataSource: {dataSource: {}, fields: ''},
updateDeveloperMetadata: {dataFilters: [{}], developerMetadata: {}, fields: ''},
updateDimensionGroup: {dimensionGroup: {collapsed: false, depth: 0, range: {}}, fields: ''},
updateDimensionProperties: {
dataSourceSheetRange: {},
fields: '',
properties: {
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
},
range: {}
},
updateEmbeddedObjectBorder: {border: {}, fields: '', objectId: 0},
updateEmbeddedObjectPosition: {fields: '', newPosition: {}, objectId: 0},
updateFilterView: {fields: '', filter: {}},
updateNamedRange: {fields: '', namedRange: {}},
updateProtectedRange: {fields: '', protectedRange: {}},
updateSheetProperties: {fields: '', properties: {}},
updateSlicerSpec: {fields: '', slicerId: 0, spec: {}},
updateSpreadsheetProperties: {
fields: '',
properties: {
autoRecalc: '',
defaultFormat: {},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
}
}
}
],
responseIncludeGridData: false,
responseRanges: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"includeSpreadsheetInResponse":false,"requests":[{"addBanding":{"bandedRange":{"bandedRangeId":0,"columnProperties":{"firstBandColor":{"alpha":"","blue":"","green":"","red":""},"firstBandColorStyle":{"rgbColor":{},"themeColor":""},"footerColor":{},"footerColorStyle":{},"headerColor":{},"headerColorStyle":{},"secondBandColor":{},"secondBandColorStyle":{}},"range":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0},"rowProperties":{}}},"addChart":{"chart":{"border":{"color":{},"colorStyle":{}},"chartId":0,"position":{"newSheet":false,"overlayPosition":{"anchorCell":{"columnIndex":0,"rowIndex":0,"sheetId":0},"heightPixels":0,"offsetXPixels":0,"offsetYPixels":0,"widthPixels":0},"sheetId":0},"spec":{"altText":"","backgroundColor":{},"backgroundColorStyle":{},"basicChart":{"axis":[{"format":{"bold":false,"fontFamily":"","fontSize":0,"foregroundColor":{},"foregroundColorStyle":{},"italic":false,"link":{"uri":""},"strikethrough":false,"underline":false},"position":"","title":"","titleTextPosition":{"horizontalAlignment":""},"viewWindowOptions":{"viewWindowMax":"","viewWindowMin":"","viewWindowMode":""}}],"chartType":"","compareMode":"","domains":[{"domain":{"aggregateType":"","columnReference":{"name":""},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"intervalSize":"","maxValue":"","minValue":""}},"sourceRange":{"sources":[{}]}},"reversed":false}],"headerCount":0,"interpolateNulls":false,"legendPosition":"","lineSmoothing":false,"series":[{"color":{},"colorStyle":{},"dataLabel":{"customLabelData":{},"placement":"","textFormat":{},"type":""},"lineStyle":{"type":"","width":0},"pointStyle":{"shape":"","size":""},"series":{},"styleOverrides":[{"color":{},"colorStyle":{},"index":0,"pointStyle":{}}],"targetAxis":"","type":""}],"stackedType":"","threeDimensional":false,"totalDataLabel":{}},"bubbleChart":{"bubbleBorderColor":{},"bubbleBorderColorStyle":{},"bubbleLabels":{},"bubbleMaxRadiusSize":0,"bubbleMinRadiusSize":0,"bubbleOpacity":"","bubbleSizes":{},"bubbleTextStyle":{},"domain":{},"groupIds":{},"legendPosition":"","series":{}},"candlestickChart":{"data":[{"closeSeries":{"data":{}},"highSeries":{},"lowSeries":{},"openSeries":{}}],"domain":{"data":{},"reversed":false}},"dataSourceChartProperties":{"dataExecutionStatus":{"errorCode":"","errorMessage":"","lastRefreshTime":"","state":""},"dataSourceId":""},"filterSpecs":[{"columnIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{"type":"","values":[{"relativeDate":"","userEnteredValue":""}]},"hiddenValues":[],"visibleBackgroundColor":{},"visibleBackgroundColorStyle":{},"visibleForegroundColor":{},"visibleForegroundColorStyle":{}}}],"fontName":"","hiddenDimensionStrategy":"","histogramChart":{"bucketSize":"","legendPosition":"","outlierPercentile":"","series":[{"barColor":{},"barColorStyle":{},"data":{}}],"showItemDividers":false},"maximized":false,"orgChart":{"labels":{},"nodeColor":{},"nodeColorStyle":{},"nodeSize":"","parentLabels":{},"selectedNodeColor":{},"selectedNodeColorStyle":{},"tooltips":{}},"pieChart":{"domain":{},"legendPosition":"","pieHole":"","series":{},"threeDimensional":false},"scorecardChart":{"aggregateType":"","baselineValueData":{},"baselineValueFormat":{"comparisonType":"","description":"","negativeColor":{},"negativeColorStyle":{},"position":{},"positiveColor":{},"positiveColorStyle":{},"textFormat":{}},"customFormatOptions":{"prefix":"","suffix":""},"keyValueData":{},"keyValueFormat":{"position":{},"textFormat":{}},"numberFormatSource":"","scaleFactor":""},"sortSpecs":[{"backgroundColor":{},"backgroundColorStyle":{},"dataSourceColumnReference":{},"dimensionIndex":0,"foregroundColor":{},"foregroundColorStyle":{},"sortOrder":""}],"subtitle":"","subtitleTextFormat":{},"subtitleTextPosition":{},"title":"","titleTextFormat":{},"titleTextPosition":{},"treemapChart":{"colorData":{},"colorScale":{"maxValueColor":{},"maxValueColorStyle":{},"midValueColor":{},"midValueColorStyle":{},"minValueColor":{},"minValueColorStyle":{},"noDataColor":{},"noDataColorStyle":{}},"headerColor":{},"headerColorStyle":{},"hideTooltips":false,"hintedLevels":0,"labels":{},"levels":0,"maxValue":"","minValue":"","parentLabels":{},"sizeData":{},"textFormat":{}},"waterfallChart":{"connectorLineStyle":{},"domain":{"data":{},"reversed":false},"firstValueIsTotal":false,"hideConnectorLines":false,"series":[{"customSubtotals":[{"dataIsSubtotal":false,"label":"","subtotalIndex":0}],"data":{},"dataLabel":{},"hideTrailingSubtotal":false,"negativeColumnsStyle":{"color":{},"colorStyle":{},"label":""},"positiveColumnsStyle":{},"subtotalColumnsStyle":{}}],"stackedType":"","totalDataLabel":{}}}}},"addConditionalFormatRule":{"index":0,"rule":{"booleanRule":{"condition":{},"format":{"backgroundColor":{},"backgroundColorStyle":{},"borders":{"bottom":{"color":{},"colorStyle":{},"style":"","width":0},"left":{},"right":{},"top":{}},"horizontalAlignment":"","hyperlinkDisplayType":"","numberFormat":{"pattern":"","type":""},"padding":{"bottom":0,"left":0,"right":0,"top":0},"textDirection":"","textFormat":{},"textRotation":{"angle":0,"vertical":false},"verticalAlignment":"","wrapStrategy":""}},"gradientRule":{"maxpoint":{"color":{},"colorStyle":{},"type":"","value":""},"midpoint":{},"minpoint":{}},"ranges":[{}]}},"addDataSource":{"dataSource":{"calculatedColumns":[{"formula":"","reference":{}}],"dataSourceId":"","sheetId":0,"spec":{"bigQuery":{"projectId":"","querySpec":{"rawQuery":""},"tableSpec":{"datasetId":"","tableId":"","tableProjectId":""}},"parameters":[{"name":"","namedRangeId":"","range":{}}]}}},"addDimensionGroup":{"range":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0}},"addFilterView":{"filter":{"criteria":{},"filterSpecs":[{}],"filterViewId":0,"namedRangeId":"","range":{},"sortSpecs":[{}],"title":""}},"addNamedRange":{"namedRange":{"name":"","namedRangeId":"","range":{}}},"addProtectedRange":{"protectedRange":{"description":"","editors":{"domainUsersCanEdit":false,"groups":[],"users":[]},"namedRangeId":"","protectedRangeId":0,"range":{},"requestingUserCanEdit":false,"unprotectedRanges":[{}],"warningOnly":false}},"addSheet":{"properties":{"dataSourceSheetProperties":{"columns":[{}],"dataExecutionStatus":{},"dataSourceId":""},"gridProperties":{"columnCount":0,"columnGroupControlAfter":false,"frozenColumnCount":0,"frozenRowCount":0,"hideGridlines":false,"rowCount":0,"rowGroupControlAfter":false},"hidden":false,"index":0,"rightToLeft":false,"sheetId":0,"sheetType":"","tabColor":{},"tabColorStyle":{},"title":""}},"addSlicer":{"slicer":{"position":{},"slicerId":0,"spec":{"applyToPivotTables":false,"backgroundColor":{},"backgroundColorStyle":{},"columnIndex":0,"dataRange":{},"filterCriteria":{},"horizontalAlignment":"","textFormat":{},"title":""}}},"appendCells":{"fields":"","rows":[{"values":[{"dataSourceFormula":{"dataExecutionStatus":{},"dataSourceId":""},"dataSourceTable":{"columnSelectionType":"","columns":[{}],"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{}],"rowLimit":0,"sortSpecs":[{}]},"dataValidation":{"condition":{},"inputMessage":"","showCustomUi":false,"strict":false},"effectiveFormat":{},"effectiveValue":{"boolValue":false,"errorValue":{"message":"","type":""},"formulaValue":"","numberValue":"","stringValue":""},"formattedValue":"","hyperlink":"","note":"","pivotTable":{"columns":[{"dataSourceColumnReference":{},"groupLimit":{"applyOrder":0,"countLimit":0},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"end":"","interval":"","start":""},"manualRule":{"groups":[{"groupName":{},"items":[{}]}]}},"label":"","repeatHeadings":false,"showTotals":false,"sortOrder":"","sourceColumnOffset":0,"valueBucket":{"buckets":[{}],"valuesIndex":0},"valueMetadata":[{"collapsed":false,"value":{}}]}],"criteria":{},"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{"columnOffsetIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{},"visibleByDefault":false,"visibleValues":[]}}],"rows":[{}],"source":{},"valueLayout":"","values":[{"calculatedDisplayType":"","dataSourceColumnReference":{},"formula":"","name":"","sourceColumnOffset":0,"summarizeFunction":""}]},"textFormatRuns":[{"format":{},"startIndex":0}],"userEnteredFormat":{},"userEnteredValue":{}}]}],"sheetId":0},"appendDimension":{"dimension":"","length":0,"sheetId":0},"autoFill":{"range":{},"sourceAndDestination":{"dimension":"","fillLength":0,"source":{}},"useAlternateSeries":false},"autoResizeDimensions":{"dataSourceSheetDimensions":{"columnReferences":[{}],"sheetId":0},"dimensions":{}},"clearBasicFilter":{"sheetId":0},"copyPaste":{"destination":{},"pasteOrientation":"","pasteType":"","source":{}},"createDeveloperMetadata":{"developerMetadata":{"location":{"dimensionRange":{},"locationType":"","sheetId":0,"spreadsheet":false},"metadataId":0,"metadataKey":"","metadataValue":"","visibility":""}},"cutPaste":{"destination":{},"pasteType":"","source":{}},"deleteBanding":{"bandedRangeId":0},"deleteConditionalFormatRule":{"index":0,"sheetId":0},"deleteDataSource":{"dataSourceId":""},"deleteDeveloperMetadata":{"dataFilter":{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{},"metadataValue":"","visibility":""},"gridRange":{}}},"deleteDimension":{"range":{}},"deleteDimensionGroup":{"range":{}},"deleteDuplicates":{"comparisonColumns":[{}],"range":{}},"deleteEmbeddedObject":{"objectId":0},"deleteFilterView":{"filterId":0},"deleteNamedRange":{"namedRangeId":""},"deleteProtectedRange":{"protectedRangeId":0},"deleteRange":{"range":{},"shiftDimension":""},"deleteSheet":{"sheetId":0},"duplicateFilterView":{"filterId":0},"duplicateSheet":{"insertSheetIndex":0,"newSheetId":0,"newSheetName":"","sourceSheetId":0},"findReplace":{"allSheets":false,"find":"","includeFormulas":false,"matchCase":false,"matchEntireCell":false,"range":{},"replacement":"","searchByRegex":false,"sheetId":0},"insertDimension":{"inheritFromBefore":false,"range":{}},"insertRange":{"range":{},"shiftDimension":""},"mergeCells":{"mergeType":"","range":{}},"moveDimension":{"destinationIndex":0,"source":{}},"pasteData":{"coordinate":{},"data":"","delimiter":"","html":false,"type":""},"randomizeRange":{"range":{}},"refreshDataSource":{"dataSourceId":"","force":false,"isAll":false,"references":{"references":[{"chartId":0,"dataSourceFormulaCell":{},"dataSourcePivotTableAnchorCell":{},"dataSourceTableAnchorCell":{},"sheetId":""}]}},"repeatCell":{"cell":{},"fields":"","range":{}},"setBasicFilter":{"filter":{"criteria":{},"filterSpecs":[{}],"range":{},"sortSpecs":[{}]}},"setDataValidation":{"range":{},"rule":{}},"sortRange":{"range":{},"sortSpecs":[{}]},"textToColumns":{"delimiter":"","delimiterType":"","source":{}},"trimWhitespace":{"range":{}},"unmergeCells":{"range":{}},"updateBanding":{"bandedRange":{},"fields":""},"updateBorders":{"bottom":{},"innerHorizontal":{},"innerVertical":{},"left":{},"range":{},"right":{},"top":{}},"updateCells":{"fields":"","range":{},"rows":[{}],"start":{}},"updateChartSpec":{"chartId":0,"spec":{}},"updateConditionalFormatRule":{"index":0,"newIndex":0,"rule":{},"sheetId":0},"updateDataSource":{"dataSource":{},"fields":""},"updateDeveloperMetadata":{"dataFilters":[{}],"developerMetadata":{},"fields":""},"updateDimensionGroup":{"dimensionGroup":{"collapsed":false,"depth":0,"range":{}},"fields":""},"updateDimensionProperties":{"dataSourceSheetRange":{},"fields":"","properties":{"dataSourceColumnReference":{},"developerMetadata":[{}],"hiddenByFilter":false,"hiddenByUser":false,"pixelSize":0},"range":{}},"updateEmbeddedObjectBorder":{"border":{},"fields":"","objectId":0},"updateEmbeddedObjectPosition":{"fields":"","newPosition":{},"objectId":0},"updateFilterView":{"fields":"","filter":{}},"updateNamedRange":{"fields":"","namedRange":{}},"updateProtectedRange":{"fields":"","protectedRange":{}},"updateSheetProperties":{"fields":"","properties":{}},"updateSlicerSpec":{"fields":"","slicerId":0,"spec":{}},"updateSpreadsheetProperties":{"fields":"","properties":{"autoRecalc":"","defaultFormat":{},"iterativeCalculationSettings":{"convergenceThreshold":"","maxIterations":0},"locale":"","spreadsheetTheme":{"primaryFontFamily":"","themeColors":[{"color":{},"colorType":""}]},"timeZone":"","title":""}}}],"responseIncludeGridData":false,"responseRanges":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"includeSpreadsheetInResponse": @NO,
@"requests": @[ @{ @"addBanding": @{ @"bandedRange": @{ @"bandedRangeId": @0, @"columnProperties": @{ @"firstBandColor": @{ @"alpha": @"", @"blue": @"", @"green": @"", @"red": @"" }, @"firstBandColorStyle": @{ @"rgbColor": @{ }, @"themeColor": @"" }, @"footerColor": @{ }, @"footerColorStyle": @{ }, @"headerColor": @{ }, @"headerColorStyle": @{ }, @"secondBandColor": @{ }, @"secondBandColorStyle": @{ } }, @"range": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 }, @"rowProperties": @{ } } }, @"addChart": @{ @"chart": @{ @"border": @{ @"color": @{ }, @"colorStyle": @{ } }, @"chartId": @0, @"position": @{ @"newSheet": @NO, @"overlayPosition": @{ @"anchorCell": @{ @"columnIndex": @0, @"rowIndex": @0, @"sheetId": @0 }, @"heightPixels": @0, @"offsetXPixels": @0, @"offsetYPixels": @0, @"widthPixels": @0 }, @"sheetId": @0 }, @"spec": @{ @"altText": @"", @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"basicChart": @{ @"axis": @[ @{ @"format": @{ @"bold": @NO, @"fontFamily": @"", @"fontSize": @0, @"foregroundColor": @{ }, @"foregroundColorStyle": @{ }, @"italic": @NO, @"link": @{ @"uri": @"" }, @"strikethrough": @NO, @"underline": @NO }, @"position": @"", @"title": @"", @"titleTextPosition": @{ @"horizontalAlignment": @"" }, @"viewWindowOptions": @{ @"viewWindowMax": @"", @"viewWindowMin": @"", @"viewWindowMode": @"" } } ], @"chartType": @"", @"compareMode": @"", @"domains": @[ @{ @"domain": @{ @"aggregateType": @"", @"columnReference": @{ @"name": @"" }, @"groupRule": @{ @"dateTimeRule": @{ @"type": @"" }, @"histogramRule": @{ @"intervalSize": @"", @"maxValue": @"", @"minValue": @"" } }, @"sourceRange": @{ @"sources": @[ @{ } ] } }, @"reversed": @NO } ], @"headerCount": @0, @"interpolateNulls": @NO, @"legendPosition": @"", @"lineSmoothing": @NO, @"series": @[ @{ @"color": @{ }, @"colorStyle": @{ }, @"dataLabel": @{ @"customLabelData": @{ }, @"placement": @"", @"textFormat": @{ }, @"type": @"" }, @"lineStyle": @{ @"type": @"", @"width": @0 }, @"pointStyle": @{ @"shape": @"", @"size": @"" }, @"series": @{ }, @"styleOverrides": @[ @{ @"color": @{ }, @"colorStyle": @{ }, @"index": @0, @"pointStyle": @{ } } ], @"targetAxis": @"", @"type": @"" } ], @"stackedType": @"", @"threeDimensional": @NO, @"totalDataLabel": @{ } }, @"bubbleChart": @{ @"bubbleBorderColor": @{ }, @"bubbleBorderColorStyle": @{ }, @"bubbleLabels": @{ }, @"bubbleMaxRadiusSize": @0, @"bubbleMinRadiusSize": @0, @"bubbleOpacity": @"", @"bubbleSizes": @{ }, @"bubbleTextStyle": @{ }, @"domain": @{ }, @"groupIds": @{ }, @"legendPosition": @"", @"series": @{ } }, @"candlestickChart": @{ @"data": @[ @{ @"closeSeries": @{ @"data": @{ } }, @"highSeries": @{ }, @"lowSeries": @{ }, @"openSeries": @{ } } ], @"domain": @{ @"data": @{ }, @"reversed": @NO } }, @"dataSourceChartProperties": @{ @"dataExecutionStatus": @{ @"errorCode": @"", @"errorMessage": @"", @"lastRefreshTime": @"", @"state": @"" }, @"dataSourceId": @"" }, @"filterSpecs": @[ @{ @"columnIndex": @0, @"dataSourceColumnReference": @{ }, @"filterCriteria": @{ @"condition": @{ @"type": @"", @"values": @[ @{ @"relativeDate": @"", @"userEnteredValue": @"" } ] }, @"hiddenValues": @[ ], @"visibleBackgroundColor": @{ }, @"visibleBackgroundColorStyle": @{ }, @"visibleForegroundColor": @{ }, @"visibleForegroundColorStyle": @{ } } } ], @"fontName": @"", @"hiddenDimensionStrategy": @"", @"histogramChart": @{ @"bucketSize": @"", @"legendPosition": @"", @"outlierPercentile": @"", @"series": @[ @{ @"barColor": @{ }, @"barColorStyle": @{ }, @"data": @{ } } ], @"showItemDividers": @NO }, @"maximized": @NO, @"orgChart": @{ @"labels": @{ }, @"nodeColor": @{ }, @"nodeColorStyle": @{ }, @"nodeSize": @"", @"parentLabels": @{ }, @"selectedNodeColor": @{ }, @"selectedNodeColorStyle": @{ }, @"tooltips": @{ } }, @"pieChart": @{ @"domain": @{ }, @"legendPosition": @"", @"pieHole": @"", @"series": @{ }, @"threeDimensional": @NO }, @"scorecardChart": @{ @"aggregateType": @"", @"baselineValueData": @{ }, @"baselineValueFormat": @{ @"comparisonType": @"", @"description": @"", @"negativeColor": @{ }, @"negativeColorStyle": @{ }, @"position": @{ }, @"positiveColor": @{ }, @"positiveColorStyle": @{ }, @"textFormat": @{ } }, @"customFormatOptions": @{ @"prefix": @"", @"suffix": @"" }, @"keyValueData": @{ }, @"keyValueFormat": @{ @"position": @{ }, @"textFormat": @{ } }, @"numberFormatSource": @"", @"scaleFactor": @"" }, @"sortSpecs": @[ @{ @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"dataSourceColumnReference": @{ }, @"dimensionIndex": @0, @"foregroundColor": @{ }, @"foregroundColorStyle": @{ }, @"sortOrder": @"" } ], @"subtitle": @"", @"subtitleTextFormat": @{ }, @"subtitleTextPosition": @{ }, @"title": @"", @"titleTextFormat": @{ }, @"titleTextPosition": @{ }, @"treemapChart": @{ @"colorData": @{ }, @"colorScale": @{ @"maxValueColor": @{ }, @"maxValueColorStyle": @{ }, @"midValueColor": @{ }, @"midValueColorStyle": @{ }, @"minValueColor": @{ }, @"minValueColorStyle": @{ }, @"noDataColor": @{ }, @"noDataColorStyle": @{ } }, @"headerColor": @{ }, @"headerColorStyle": @{ }, @"hideTooltips": @NO, @"hintedLevels": @0, @"labels": @{ }, @"levels": @0, @"maxValue": @"", @"minValue": @"", @"parentLabels": @{ }, @"sizeData": @{ }, @"textFormat": @{ } }, @"waterfallChart": @{ @"connectorLineStyle": @{ }, @"domain": @{ @"data": @{ }, @"reversed": @NO }, @"firstValueIsTotal": @NO, @"hideConnectorLines": @NO, @"series": @[ @{ @"customSubtotals": @[ @{ @"dataIsSubtotal": @NO, @"label": @"", @"subtotalIndex": @0 } ], @"data": @{ }, @"dataLabel": @{ }, @"hideTrailingSubtotal": @NO, @"negativeColumnsStyle": @{ @"color": @{ }, @"colorStyle": @{ }, @"label": @"" }, @"positiveColumnsStyle": @{ }, @"subtotalColumnsStyle": @{ } } ], @"stackedType": @"", @"totalDataLabel": @{ } } } } }, @"addConditionalFormatRule": @{ @"index": @0, @"rule": @{ @"booleanRule": @{ @"condition": @{ }, @"format": @{ @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"borders": @{ @"bottom": @{ @"color": @{ }, @"colorStyle": @{ }, @"style": @"", @"width": @0 }, @"left": @{ }, @"right": @{ }, @"top": @{ } }, @"horizontalAlignment": @"", @"hyperlinkDisplayType": @"", @"numberFormat": @{ @"pattern": @"", @"type": @"" }, @"padding": @{ @"bottom": @0, @"left": @0, @"right": @0, @"top": @0 }, @"textDirection": @"", @"textFormat": @{ }, @"textRotation": @{ @"angle": @0, @"vertical": @NO }, @"verticalAlignment": @"", @"wrapStrategy": @"" } }, @"gradientRule": @{ @"maxpoint": @{ @"color": @{ }, @"colorStyle": @{ }, @"type": @"", @"value": @"" }, @"midpoint": @{ }, @"minpoint": @{ } }, @"ranges": @[ @{ } ] } }, @"addDataSource": @{ @"dataSource": @{ @"calculatedColumns": @[ @{ @"formula": @"", @"reference": @{ } } ], @"dataSourceId": @"", @"sheetId": @0, @"spec": @{ @"bigQuery": @{ @"projectId": @"", @"querySpec": @{ @"rawQuery": @"" }, @"tableSpec": @{ @"datasetId": @"", @"tableId": @"", @"tableProjectId": @"" } }, @"parameters": @[ @{ @"name": @"", @"namedRangeId": @"", @"range": @{ } } ] } } }, @"addDimensionGroup": @{ @"range": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 } }, @"addFilterView": @{ @"filter": @{ @"criteria": @{ }, @"filterSpecs": @[ @{ } ], @"filterViewId": @0, @"namedRangeId": @"", @"range": @{ }, @"sortSpecs": @[ @{ } ], @"title": @"" } }, @"addNamedRange": @{ @"namedRange": @{ @"name": @"", @"namedRangeId": @"", @"range": @{ } } }, @"addProtectedRange": @{ @"protectedRange": @{ @"description": @"", @"editors": @{ @"domainUsersCanEdit": @NO, @"groups": @[ ], @"users": @[ ] }, @"namedRangeId": @"", @"protectedRangeId": @0, @"range": @{ }, @"requestingUserCanEdit": @NO, @"unprotectedRanges": @[ @{ } ], @"warningOnly": @NO } }, @"addSheet": @{ @"properties": @{ @"dataSourceSheetProperties": @{ @"columns": @[ @{ } ], @"dataExecutionStatus": @{ }, @"dataSourceId": @"" }, @"gridProperties": @{ @"columnCount": @0, @"columnGroupControlAfter": @NO, @"frozenColumnCount": @0, @"frozenRowCount": @0, @"hideGridlines": @NO, @"rowCount": @0, @"rowGroupControlAfter": @NO }, @"hidden": @NO, @"index": @0, @"rightToLeft": @NO, @"sheetId": @0, @"sheetType": @"", @"tabColor": @{ }, @"tabColorStyle": @{ }, @"title": @"" } }, @"addSlicer": @{ @"slicer": @{ @"position": @{ }, @"slicerId": @0, @"spec": @{ @"applyToPivotTables": @NO, @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"columnIndex": @0, @"dataRange": @{ }, @"filterCriteria": @{ }, @"horizontalAlignment": @"", @"textFormat": @{ }, @"title": @"" } } }, @"appendCells": @{ @"fields": @"", @"rows": @[ @{ @"values": @[ @{ @"dataSourceFormula": @{ @"dataExecutionStatus": @{ }, @"dataSourceId": @"" }, @"dataSourceTable": @{ @"columnSelectionType": @"", @"columns": @[ @{ } ], @"dataExecutionStatus": @{ }, @"dataSourceId": @"", @"filterSpecs": @[ @{ } ], @"rowLimit": @0, @"sortSpecs": @[ @{ } ] }, @"dataValidation": @{ @"condition": @{ }, @"inputMessage": @"", @"showCustomUi": @NO, @"strict": @NO }, @"effectiveFormat": @{ }, @"effectiveValue": @{ @"boolValue": @NO, @"errorValue": @{ @"message": @"", @"type": @"" }, @"formulaValue": @"", @"numberValue": @"", @"stringValue": @"" }, @"formattedValue": @"", @"hyperlink": @"", @"note": @"", @"pivotTable": @{ @"columns": @[ @{ @"dataSourceColumnReference": @{ }, @"groupLimit": @{ @"applyOrder": @0, @"countLimit": @0 }, @"groupRule": @{ @"dateTimeRule": @{ @"type": @"" }, @"histogramRule": @{ @"end": @"", @"interval": @"", @"start": @"" }, @"manualRule": @{ @"groups": @[ @{ @"groupName": @{ }, @"items": @[ @{ } ] } ] } }, @"label": @"", @"repeatHeadings": @NO, @"showTotals": @NO, @"sortOrder": @"", @"sourceColumnOffset": @0, @"valueBucket": @{ @"buckets": @[ @{ } ], @"valuesIndex": @0 }, @"valueMetadata": @[ @{ @"collapsed": @NO, @"value": @{ } } ] } ], @"criteria": @{ }, @"dataExecutionStatus": @{ }, @"dataSourceId": @"", @"filterSpecs": @[ @{ @"columnOffsetIndex": @0, @"dataSourceColumnReference": @{ }, @"filterCriteria": @{ @"condition": @{ }, @"visibleByDefault": @NO, @"visibleValues": @[ ] } } ], @"rows": @[ @{ } ], @"source": @{ }, @"valueLayout": @"", @"values": @[ @{ @"calculatedDisplayType": @"", @"dataSourceColumnReference": @{ }, @"formula": @"", @"name": @"", @"sourceColumnOffset": @0, @"summarizeFunction": @"" } ] }, @"textFormatRuns": @[ @{ @"format": @{ }, @"startIndex": @0 } ], @"userEnteredFormat": @{ }, @"userEnteredValue": @{ } } ] } ], @"sheetId": @0 }, @"appendDimension": @{ @"dimension": @"", @"length": @0, @"sheetId": @0 }, @"autoFill": @{ @"range": @{ }, @"sourceAndDestination": @{ @"dimension": @"", @"fillLength": @0, @"source": @{ } }, @"useAlternateSeries": @NO }, @"autoResizeDimensions": @{ @"dataSourceSheetDimensions": @{ @"columnReferences": @[ @{ } ], @"sheetId": @0 }, @"dimensions": @{ } }, @"clearBasicFilter": @{ @"sheetId": @0 }, @"copyPaste": @{ @"destination": @{ }, @"pasteOrientation": @"", @"pasteType": @"", @"source": @{ } }, @"createDeveloperMetadata": @{ @"developerMetadata": @{ @"location": @{ @"dimensionRange": @{ }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataId": @0, @"metadataKey": @"", @"metadataValue": @"", @"visibility": @"" } }, @"cutPaste": @{ @"destination": @{ }, @"pasteType": @"", @"source": @{ } }, @"deleteBanding": @{ @"bandedRangeId": @0 }, @"deleteConditionalFormatRule": @{ @"index": @0, @"sheetId": @0 }, @"deleteDataSource": @{ @"dataSourceId": @"" }, @"deleteDeveloperMetadata": @{ @"dataFilter": @{ @"a1Range": @"", @"developerMetadataLookup": @{ @"locationMatchingStrategy": @"", @"locationType": @"", @"metadataId": @0, @"metadataKey": @"", @"metadataLocation": @{ }, @"metadataValue": @"", @"visibility": @"" }, @"gridRange": @{ } } }, @"deleteDimension": @{ @"range": @{ } }, @"deleteDimensionGroup": @{ @"range": @{ } }, @"deleteDuplicates": @{ @"comparisonColumns": @[ @{ } ], @"range": @{ } }, @"deleteEmbeddedObject": @{ @"objectId": @0 }, @"deleteFilterView": @{ @"filterId": @0 }, @"deleteNamedRange": @{ @"namedRangeId": @"" }, @"deleteProtectedRange": @{ @"protectedRangeId": @0 }, @"deleteRange": @{ @"range": @{ }, @"shiftDimension": @"" }, @"deleteSheet": @{ @"sheetId": @0 }, @"duplicateFilterView": @{ @"filterId": @0 }, @"duplicateSheet": @{ @"insertSheetIndex": @0, @"newSheetId": @0, @"newSheetName": @"", @"sourceSheetId": @0 }, @"findReplace": @{ @"allSheets": @NO, @"find": @"", @"includeFormulas": @NO, @"matchCase": @NO, @"matchEntireCell": @NO, @"range": @{ }, @"replacement": @"", @"searchByRegex": @NO, @"sheetId": @0 }, @"insertDimension": @{ @"inheritFromBefore": @NO, @"range": @{ } }, @"insertRange": @{ @"range": @{ }, @"shiftDimension": @"" }, @"mergeCells": @{ @"mergeType": @"", @"range": @{ } }, @"moveDimension": @{ @"destinationIndex": @0, @"source": @{ } }, @"pasteData": @{ @"coordinate": @{ }, @"data": @"", @"delimiter": @"", @"html": @NO, @"type": @"" }, @"randomizeRange": @{ @"range": @{ } }, @"refreshDataSource": @{ @"dataSourceId": @"", @"force": @NO, @"isAll": @NO, @"references": @{ @"references": @[ @{ @"chartId": @0, @"dataSourceFormulaCell": @{ }, @"dataSourcePivotTableAnchorCell": @{ }, @"dataSourceTableAnchorCell": @{ }, @"sheetId": @"" } ] } }, @"repeatCell": @{ @"cell": @{ }, @"fields": @"", @"range": @{ } }, @"setBasicFilter": @{ @"filter": @{ @"criteria": @{ }, @"filterSpecs": @[ @{ } ], @"range": @{ }, @"sortSpecs": @[ @{ } ] } }, @"setDataValidation": @{ @"range": @{ }, @"rule": @{ } }, @"sortRange": @{ @"range": @{ }, @"sortSpecs": @[ @{ } ] }, @"textToColumns": @{ @"delimiter": @"", @"delimiterType": @"", @"source": @{ } }, @"trimWhitespace": @{ @"range": @{ } }, @"unmergeCells": @{ @"range": @{ } }, @"updateBanding": @{ @"bandedRange": @{ }, @"fields": @"" }, @"updateBorders": @{ @"bottom": @{ }, @"innerHorizontal": @{ }, @"innerVertical": @{ }, @"left": @{ }, @"range": @{ }, @"right": @{ }, @"top": @{ } }, @"updateCells": @{ @"fields": @"", @"range": @{ }, @"rows": @[ @{ } ], @"start": @{ } }, @"updateChartSpec": @{ @"chartId": @0, @"spec": @{ } }, @"updateConditionalFormatRule": @{ @"index": @0, @"newIndex": @0, @"rule": @{ }, @"sheetId": @0 }, @"updateDataSource": @{ @"dataSource": @{ }, @"fields": @"" }, @"updateDeveloperMetadata": @{ @"dataFilters": @[ @{ } ], @"developerMetadata": @{ }, @"fields": @"" }, @"updateDimensionGroup": @{ @"dimensionGroup": @{ @"collapsed": @NO, @"depth": @0, @"range": @{ } }, @"fields": @"" }, @"updateDimensionProperties": @{ @"dataSourceSheetRange": @{ }, @"fields": @"", @"properties": @{ @"dataSourceColumnReference": @{ }, @"developerMetadata": @[ @{ } ], @"hiddenByFilter": @NO, @"hiddenByUser": @NO, @"pixelSize": @0 }, @"range": @{ } }, @"updateEmbeddedObjectBorder": @{ @"border": @{ }, @"fields": @"", @"objectId": @0 }, @"updateEmbeddedObjectPosition": @{ @"fields": @"", @"newPosition": @{ }, @"objectId": @0 }, @"updateFilterView": @{ @"fields": @"", @"filter": @{ } }, @"updateNamedRange": @{ @"fields": @"", @"namedRange": @{ } }, @"updateProtectedRange": @{ @"fields": @"", @"protectedRange": @{ } }, @"updateSheetProperties": @{ @"fields": @"", @"properties": @{ } }, @"updateSlicerSpec": @{ @"fields": @"", @"slicerId": @0, @"spec": @{ } }, @"updateSpreadsheetProperties": @{ @"fields": @"", @"properties": @{ @"autoRecalc": @"", @"defaultFormat": @{ }, @"iterativeCalculationSettings": @{ @"convergenceThreshold": @"", @"maxIterations": @0 }, @"locale": @"", @"spreadsheetTheme": @{ @"primaryFontFamily": @"", @"themeColors": @[ @{ @"color": @{ }, @"colorType": @"" } ] }, @"timeZone": @"", @"title": @"" } } } ],
@"responseIncludeGridData": @NO,
@"responseRanges": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'includeSpreadsheetInResponse' => null,
'requests' => [
[
'addBanding' => [
'bandedRange' => [
'bandedRangeId' => 0,
'columnProperties' => [
'firstBandColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'firstBandColorStyle' => [
'rgbColor' => [
],
'themeColor' => ''
],
'footerColor' => [
],
'footerColorStyle' => [
],
'headerColor' => [
],
'headerColorStyle' => [
],
'secondBandColor' => [
],
'secondBandColorStyle' => [
]
],
'range' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
],
'rowProperties' => [
]
]
],
'addChart' => [
'chart' => [
'border' => [
'color' => [
],
'colorStyle' => [
]
],
'chartId' => 0,
'position' => [
'newSheet' => null,
'overlayPosition' => [
'anchorCell' => [
'columnIndex' => 0,
'rowIndex' => 0,
'sheetId' => 0
],
'heightPixels' => 0,
'offsetXPixels' => 0,
'offsetYPixels' => 0,
'widthPixels' => 0
],
'sheetId' => 0
],
'spec' => [
'altText' => '',
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'basicChart' => [
'axis' => [
[
'format' => [
'bold' => null,
'fontFamily' => '',
'fontSize' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'italic' => null,
'link' => [
'uri' => ''
],
'strikethrough' => null,
'underline' => null
],
'position' => '',
'title' => '',
'titleTextPosition' => [
'horizontalAlignment' => ''
],
'viewWindowOptions' => [
'viewWindowMax' => '',
'viewWindowMin' => '',
'viewWindowMode' => ''
]
]
],
'chartType' => '',
'compareMode' => '',
'domains' => [
[
'domain' => [
'aggregateType' => '',
'columnReference' => [
'name' => ''
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'intervalSize' => '',
'maxValue' => '',
'minValue' => ''
]
],
'sourceRange' => [
'sources' => [
[
]
]
]
],
'reversed' => null
]
],
'headerCount' => 0,
'interpolateNulls' => null,
'legendPosition' => '',
'lineSmoothing' => null,
'series' => [
[
'color' => [
],
'colorStyle' => [
],
'dataLabel' => [
'customLabelData' => [
],
'placement' => '',
'textFormat' => [
],
'type' => ''
],
'lineStyle' => [
'type' => '',
'width' => 0
],
'pointStyle' => [
'shape' => '',
'size' => ''
],
'series' => [
],
'styleOverrides' => [
[
'color' => [
],
'colorStyle' => [
],
'index' => 0,
'pointStyle' => [
]
]
],
'targetAxis' => '',
'type' => ''
]
],
'stackedType' => '',
'threeDimensional' => null,
'totalDataLabel' => [
]
],
'bubbleChart' => [
'bubbleBorderColor' => [
],
'bubbleBorderColorStyle' => [
],
'bubbleLabels' => [
],
'bubbleMaxRadiusSize' => 0,
'bubbleMinRadiusSize' => 0,
'bubbleOpacity' => '',
'bubbleSizes' => [
],
'bubbleTextStyle' => [
],
'domain' => [
],
'groupIds' => [
],
'legendPosition' => '',
'series' => [
]
],
'candlestickChart' => [
'data' => [
[
'closeSeries' => [
'data' => [
]
],
'highSeries' => [
],
'lowSeries' => [
],
'openSeries' => [
]
]
],
'domain' => [
'data' => [
],
'reversed' => null
]
],
'dataSourceChartProperties' => [
'dataExecutionStatus' => [
'errorCode' => '',
'errorMessage' => '',
'lastRefreshTime' => '',
'state' => ''
],
'dataSourceId' => ''
],
'filterSpecs' => [
[
'columnIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
'type' => '',
'values' => [
[
'relativeDate' => '',
'userEnteredValue' => ''
]
]
],
'hiddenValues' => [
],
'visibleBackgroundColor' => [
],
'visibleBackgroundColorStyle' => [
],
'visibleForegroundColor' => [
],
'visibleForegroundColorStyle' => [
]
]
]
],
'fontName' => '',
'hiddenDimensionStrategy' => '',
'histogramChart' => [
'bucketSize' => '',
'legendPosition' => '',
'outlierPercentile' => '',
'series' => [
[
'barColor' => [
],
'barColorStyle' => [
],
'data' => [
]
]
],
'showItemDividers' => null
],
'maximized' => null,
'orgChart' => [
'labels' => [
],
'nodeColor' => [
],
'nodeColorStyle' => [
],
'nodeSize' => '',
'parentLabels' => [
],
'selectedNodeColor' => [
],
'selectedNodeColorStyle' => [
],
'tooltips' => [
]
],
'pieChart' => [
'domain' => [
],
'legendPosition' => '',
'pieHole' => '',
'series' => [
],
'threeDimensional' => null
],
'scorecardChart' => [
'aggregateType' => '',
'baselineValueData' => [
],
'baselineValueFormat' => [
'comparisonType' => '',
'description' => '',
'negativeColor' => [
],
'negativeColorStyle' => [
],
'position' => [
],
'positiveColor' => [
],
'positiveColorStyle' => [
],
'textFormat' => [
]
],
'customFormatOptions' => [
'prefix' => '',
'suffix' => ''
],
'keyValueData' => [
],
'keyValueFormat' => [
'position' => [
],
'textFormat' => [
]
],
'numberFormatSource' => '',
'scaleFactor' => ''
],
'sortSpecs' => [
[
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'dataSourceColumnReference' => [
],
'dimensionIndex' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'sortOrder' => ''
]
],
'subtitle' => '',
'subtitleTextFormat' => [
],
'subtitleTextPosition' => [
],
'title' => '',
'titleTextFormat' => [
],
'titleTextPosition' => [
],
'treemapChart' => [
'colorData' => [
],
'colorScale' => [
'maxValueColor' => [
],
'maxValueColorStyle' => [
],
'midValueColor' => [
],
'midValueColorStyle' => [
],
'minValueColor' => [
],
'minValueColorStyle' => [
],
'noDataColor' => [
],
'noDataColorStyle' => [
]
],
'headerColor' => [
],
'headerColorStyle' => [
],
'hideTooltips' => null,
'hintedLevels' => 0,
'labels' => [
],
'levels' => 0,
'maxValue' => '',
'minValue' => '',
'parentLabels' => [
],
'sizeData' => [
],
'textFormat' => [
]
],
'waterfallChart' => [
'connectorLineStyle' => [
],
'domain' => [
'data' => [
],
'reversed' => null
],
'firstValueIsTotal' => null,
'hideConnectorLines' => null,
'series' => [
[
'customSubtotals' => [
[
'dataIsSubtotal' => null,
'label' => '',
'subtotalIndex' => 0
]
],
'data' => [
],
'dataLabel' => [
],
'hideTrailingSubtotal' => null,
'negativeColumnsStyle' => [
'color' => [
],
'colorStyle' => [
],
'label' => ''
],
'positiveColumnsStyle' => [
],
'subtotalColumnsStyle' => [
]
]
],
'stackedType' => '',
'totalDataLabel' => [
]
]
]
]
],
'addConditionalFormatRule' => [
'index' => 0,
'rule' => [
'booleanRule' => [
'condition' => [
],
'format' => [
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'borders' => [
'bottom' => [
'color' => [
],
'colorStyle' => [
],
'style' => '',
'width' => 0
],
'left' => [
],
'right' => [
],
'top' => [
]
],
'horizontalAlignment' => '',
'hyperlinkDisplayType' => '',
'numberFormat' => [
'pattern' => '',
'type' => ''
],
'padding' => [
'bottom' => 0,
'left' => 0,
'right' => 0,
'top' => 0
],
'textDirection' => '',
'textFormat' => [
],
'textRotation' => [
'angle' => 0,
'vertical' => null
],
'verticalAlignment' => '',
'wrapStrategy' => ''
]
],
'gradientRule' => [
'maxpoint' => [
'color' => [
],
'colorStyle' => [
],
'type' => '',
'value' => ''
],
'midpoint' => [
],
'minpoint' => [
]
],
'ranges' => [
[
]
]
]
],
'addDataSource' => [
'dataSource' => [
'calculatedColumns' => [
[
'formula' => '',
'reference' => [
]
]
],
'dataSourceId' => '',
'sheetId' => 0,
'spec' => [
'bigQuery' => [
'projectId' => '',
'querySpec' => [
'rawQuery' => ''
],
'tableSpec' => [
'datasetId' => '',
'tableId' => '',
'tableProjectId' => ''
]
],
'parameters' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
]
]
]
],
'addDimensionGroup' => [
'range' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
]
],
'addFilterView' => [
'filter' => [
'criteria' => [
],
'filterSpecs' => [
[
]
],
'filterViewId' => 0,
'namedRangeId' => '',
'range' => [
],
'sortSpecs' => [
[
]
],
'title' => ''
]
],
'addNamedRange' => [
'namedRange' => [
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
],
'addProtectedRange' => [
'protectedRange' => [
'description' => '',
'editors' => [
'domainUsersCanEdit' => null,
'groups' => [
],
'users' => [
]
],
'namedRangeId' => '',
'protectedRangeId' => 0,
'range' => [
],
'requestingUserCanEdit' => null,
'unprotectedRanges' => [
[
]
],
'warningOnly' => null
]
],
'addSheet' => [
'properties' => [
'dataSourceSheetProperties' => [
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'gridProperties' => [
'columnCount' => 0,
'columnGroupControlAfter' => null,
'frozenColumnCount' => 0,
'frozenRowCount' => 0,
'hideGridlines' => null,
'rowCount' => 0,
'rowGroupControlAfter' => null
],
'hidden' => null,
'index' => 0,
'rightToLeft' => null,
'sheetId' => 0,
'sheetType' => '',
'tabColor' => [
],
'tabColorStyle' => [
],
'title' => ''
]
],
'addSlicer' => [
'slicer' => [
'position' => [
],
'slicerId' => 0,
'spec' => [
'applyToPivotTables' => null,
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'columnIndex' => 0,
'dataRange' => [
],
'filterCriteria' => [
],
'horizontalAlignment' => '',
'textFormat' => [
],
'title' => ''
]
]
],
'appendCells' => [
'fields' => '',
'rows' => [
[
'values' => [
[
'dataSourceFormula' => [
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'dataSourceTable' => [
'columnSelectionType' => '',
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
]
],
'rowLimit' => 0,
'sortSpecs' => [
[
]
]
],
'dataValidation' => [
'condition' => [
],
'inputMessage' => '',
'showCustomUi' => null,
'strict' => null
],
'effectiveFormat' => [
],
'effectiveValue' => [
'boolValue' => null,
'errorValue' => [
'message' => '',
'type' => ''
],
'formulaValue' => '',
'numberValue' => '',
'stringValue' => ''
],
'formattedValue' => '',
'hyperlink' => '',
'note' => '',
'pivotTable' => [
'columns' => [
[
'dataSourceColumnReference' => [
],
'groupLimit' => [
'applyOrder' => 0,
'countLimit' => 0
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'end' => '',
'interval' => '',
'start' => ''
],
'manualRule' => [
'groups' => [
[
'groupName' => [
],
'items' => [
[
]
]
]
]
]
],
'label' => '',
'repeatHeadings' => null,
'showTotals' => null,
'sortOrder' => '',
'sourceColumnOffset' => 0,
'valueBucket' => [
'buckets' => [
[
]
],
'valuesIndex' => 0
],
'valueMetadata' => [
[
'collapsed' => null,
'value' => [
]
]
]
]
],
'criteria' => [
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
'columnOffsetIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
],
'visibleByDefault' => null,
'visibleValues' => [
]
]
]
],
'rows' => [
[
]
],
'source' => [
],
'valueLayout' => '',
'values' => [
[
'calculatedDisplayType' => '',
'dataSourceColumnReference' => [
],
'formula' => '',
'name' => '',
'sourceColumnOffset' => 0,
'summarizeFunction' => ''
]
]
],
'textFormatRuns' => [
[
'format' => [
],
'startIndex' => 0
]
],
'userEnteredFormat' => [
],
'userEnteredValue' => [
]
]
]
]
],
'sheetId' => 0
],
'appendDimension' => [
'dimension' => '',
'length' => 0,
'sheetId' => 0
],
'autoFill' => [
'range' => [
],
'sourceAndDestination' => [
'dimension' => '',
'fillLength' => 0,
'source' => [
]
],
'useAlternateSeries' => null
],
'autoResizeDimensions' => [
'dataSourceSheetDimensions' => [
'columnReferences' => [
[
]
],
'sheetId' => 0
],
'dimensions' => [
]
],
'clearBasicFilter' => [
'sheetId' => 0
],
'copyPaste' => [
'destination' => [
],
'pasteOrientation' => '',
'pasteType' => '',
'source' => [
]
],
'createDeveloperMetadata' => [
'developerMetadata' => [
'location' => [
'dimensionRange' => [
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataId' => 0,
'metadataKey' => '',
'metadataValue' => '',
'visibility' => ''
]
],
'cutPaste' => [
'destination' => [
],
'pasteType' => '',
'source' => [
]
],
'deleteBanding' => [
'bandedRangeId' => 0
],
'deleteConditionalFormatRule' => [
'index' => 0,
'sheetId' => 0
],
'deleteDataSource' => [
'dataSourceId' => ''
],
'deleteDeveloperMetadata' => [
'dataFilter' => [
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
]
]
],
'deleteDimension' => [
'range' => [
]
],
'deleteDimensionGroup' => [
'range' => [
]
],
'deleteDuplicates' => [
'comparisonColumns' => [
[
]
],
'range' => [
]
],
'deleteEmbeddedObject' => [
'objectId' => 0
],
'deleteFilterView' => [
'filterId' => 0
],
'deleteNamedRange' => [
'namedRangeId' => ''
],
'deleteProtectedRange' => [
'protectedRangeId' => 0
],
'deleteRange' => [
'range' => [
],
'shiftDimension' => ''
],
'deleteSheet' => [
'sheetId' => 0
],
'duplicateFilterView' => [
'filterId' => 0
],
'duplicateSheet' => [
'insertSheetIndex' => 0,
'newSheetId' => 0,
'newSheetName' => '',
'sourceSheetId' => 0
],
'findReplace' => [
'allSheets' => null,
'find' => '',
'includeFormulas' => null,
'matchCase' => null,
'matchEntireCell' => null,
'range' => [
],
'replacement' => '',
'searchByRegex' => null,
'sheetId' => 0
],
'insertDimension' => [
'inheritFromBefore' => null,
'range' => [
]
],
'insertRange' => [
'range' => [
],
'shiftDimension' => ''
],
'mergeCells' => [
'mergeType' => '',
'range' => [
]
],
'moveDimension' => [
'destinationIndex' => 0,
'source' => [
]
],
'pasteData' => [
'coordinate' => [
],
'data' => '',
'delimiter' => '',
'html' => null,
'type' => ''
],
'randomizeRange' => [
'range' => [
]
],
'refreshDataSource' => [
'dataSourceId' => '',
'force' => null,
'isAll' => null,
'references' => [
'references' => [
[
'chartId' => 0,
'dataSourceFormulaCell' => [
],
'dataSourcePivotTableAnchorCell' => [
],
'dataSourceTableAnchorCell' => [
],
'sheetId' => ''
]
]
]
],
'repeatCell' => [
'cell' => [
],
'fields' => '',
'range' => [
]
],
'setBasicFilter' => [
'filter' => [
'criteria' => [
],
'filterSpecs' => [
[
]
],
'range' => [
],
'sortSpecs' => [
[
]
]
]
],
'setDataValidation' => [
'range' => [
],
'rule' => [
]
],
'sortRange' => [
'range' => [
],
'sortSpecs' => [
[
]
]
],
'textToColumns' => [
'delimiter' => '',
'delimiterType' => '',
'source' => [
]
],
'trimWhitespace' => [
'range' => [
]
],
'unmergeCells' => [
'range' => [
]
],
'updateBanding' => [
'bandedRange' => [
],
'fields' => ''
],
'updateBorders' => [
'bottom' => [
],
'innerHorizontal' => [
],
'innerVertical' => [
],
'left' => [
],
'range' => [
],
'right' => [
],
'top' => [
]
],
'updateCells' => [
'fields' => '',
'range' => [
],
'rows' => [
[
]
],
'start' => [
]
],
'updateChartSpec' => [
'chartId' => 0,
'spec' => [
]
],
'updateConditionalFormatRule' => [
'index' => 0,
'newIndex' => 0,
'rule' => [
],
'sheetId' => 0
],
'updateDataSource' => [
'dataSource' => [
],
'fields' => ''
],
'updateDeveloperMetadata' => [
'dataFilters' => [
[
]
],
'developerMetadata' => [
],
'fields' => ''
],
'updateDimensionGroup' => [
'dimensionGroup' => [
'collapsed' => null,
'depth' => 0,
'range' => [
]
],
'fields' => ''
],
'updateDimensionProperties' => [
'dataSourceSheetRange' => [
],
'fields' => '',
'properties' => [
'dataSourceColumnReference' => [
],
'developerMetadata' => [
[
]
],
'hiddenByFilter' => null,
'hiddenByUser' => null,
'pixelSize' => 0
],
'range' => [
]
],
'updateEmbeddedObjectBorder' => [
'border' => [
],
'fields' => '',
'objectId' => 0
],
'updateEmbeddedObjectPosition' => [
'fields' => '',
'newPosition' => [
],
'objectId' => 0
],
'updateFilterView' => [
'fields' => '',
'filter' => [
]
],
'updateNamedRange' => [
'fields' => '',
'namedRange' => [
]
],
'updateProtectedRange' => [
'fields' => '',
'protectedRange' => [
]
],
'updateSheetProperties' => [
'fields' => '',
'properties' => [
]
],
'updateSlicerSpec' => [
'fields' => '',
'slicerId' => 0,
'spec' => [
]
],
'updateSpreadsheetProperties' => [
'fields' => '',
'properties' => [
'autoRecalc' => '',
'defaultFormat' => [
],
'iterativeCalculationSettings' => [
'convergenceThreshold' => '',
'maxIterations' => 0
],
'locale' => '',
'spreadsheetTheme' => [
'primaryFontFamily' => '',
'themeColors' => [
[
'color' => [
],
'colorType' => ''
]
]
],
'timeZone' => '',
'title' => ''
]
]
]
],
'responseIncludeGridData' => null,
'responseRanges' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate', [
'body' => '{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'includeSpreadsheetInResponse' => null,
'requests' => [
[
'addBanding' => [
'bandedRange' => [
'bandedRangeId' => 0,
'columnProperties' => [
'firstBandColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'firstBandColorStyle' => [
'rgbColor' => [
],
'themeColor' => ''
],
'footerColor' => [
],
'footerColorStyle' => [
],
'headerColor' => [
],
'headerColorStyle' => [
],
'secondBandColor' => [
],
'secondBandColorStyle' => [
]
],
'range' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
],
'rowProperties' => [
]
]
],
'addChart' => [
'chart' => [
'border' => [
'color' => [
],
'colorStyle' => [
]
],
'chartId' => 0,
'position' => [
'newSheet' => null,
'overlayPosition' => [
'anchorCell' => [
'columnIndex' => 0,
'rowIndex' => 0,
'sheetId' => 0
],
'heightPixels' => 0,
'offsetXPixels' => 0,
'offsetYPixels' => 0,
'widthPixels' => 0
],
'sheetId' => 0
],
'spec' => [
'altText' => '',
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'basicChart' => [
'axis' => [
[
'format' => [
'bold' => null,
'fontFamily' => '',
'fontSize' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'italic' => null,
'link' => [
'uri' => ''
],
'strikethrough' => null,
'underline' => null
],
'position' => '',
'title' => '',
'titleTextPosition' => [
'horizontalAlignment' => ''
],
'viewWindowOptions' => [
'viewWindowMax' => '',
'viewWindowMin' => '',
'viewWindowMode' => ''
]
]
],
'chartType' => '',
'compareMode' => '',
'domains' => [
[
'domain' => [
'aggregateType' => '',
'columnReference' => [
'name' => ''
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'intervalSize' => '',
'maxValue' => '',
'minValue' => ''
]
],
'sourceRange' => [
'sources' => [
[
]
]
]
],
'reversed' => null
]
],
'headerCount' => 0,
'interpolateNulls' => null,
'legendPosition' => '',
'lineSmoothing' => null,
'series' => [
[
'color' => [
],
'colorStyle' => [
],
'dataLabel' => [
'customLabelData' => [
],
'placement' => '',
'textFormat' => [
],
'type' => ''
],
'lineStyle' => [
'type' => '',
'width' => 0
],
'pointStyle' => [
'shape' => '',
'size' => ''
],
'series' => [
],
'styleOverrides' => [
[
'color' => [
],
'colorStyle' => [
],
'index' => 0,
'pointStyle' => [
]
]
],
'targetAxis' => '',
'type' => ''
]
],
'stackedType' => '',
'threeDimensional' => null,
'totalDataLabel' => [
]
],
'bubbleChart' => [
'bubbleBorderColor' => [
],
'bubbleBorderColorStyle' => [
],
'bubbleLabels' => [
],
'bubbleMaxRadiusSize' => 0,
'bubbleMinRadiusSize' => 0,
'bubbleOpacity' => '',
'bubbleSizes' => [
],
'bubbleTextStyle' => [
],
'domain' => [
],
'groupIds' => [
],
'legendPosition' => '',
'series' => [
]
],
'candlestickChart' => [
'data' => [
[
'closeSeries' => [
'data' => [
]
],
'highSeries' => [
],
'lowSeries' => [
],
'openSeries' => [
]
]
],
'domain' => [
'data' => [
],
'reversed' => null
]
],
'dataSourceChartProperties' => [
'dataExecutionStatus' => [
'errorCode' => '',
'errorMessage' => '',
'lastRefreshTime' => '',
'state' => ''
],
'dataSourceId' => ''
],
'filterSpecs' => [
[
'columnIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
'type' => '',
'values' => [
[
'relativeDate' => '',
'userEnteredValue' => ''
]
]
],
'hiddenValues' => [
],
'visibleBackgroundColor' => [
],
'visibleBackgroundColorStyle' => [
],
'visibleForegroundColor' => [
],
'visibleForegroundColorStyle' => [
]
]
]
],
'fontName' => '',
'hiddenDimensionStrategy' => '',
'histogramChart' => [
'bucketSize' => '',
'legendPosition' => '',
'outlierPercentile' => '',
'series' => [
[
'barColor' => [
],
'barColorStyle' => [
],
'data' => [
]
]
],
'showItemDividers' => null
],
'maximized' => null,
'orgChart' => [
'labels' => [
],
'nodeColor' => [
],
'nodeColorStyle' => [
],
'nodeSize' => '',
'parentLabels' => [
],
'selectedNodeColor' => [
],
'selectedNodeColorStyle' => [
],
'tooltips' => [
]
],
'pieChart' => [
'domain' => [
],
'legendPosition' => '',
'pieHole' => '',
'series' => [
],
'threeDimensional' => null
],
'scorecardChart' => [
'aggregateType' => '',
'baselineValueData' => [
],
'baselineValueFormat' => [
'comparisonType' => '',
'description' => '',
'negativeColor' => [
],
'negativeColorStyle' => [
],
'position' => [
],
'positiveColor' => [
],
'positiveColorStyle' => [
],
'textFormat' => [
]
],
'customFormatOptions' => [
'prefix' => '',
'suffix' => ''
],
'keyValueData' => [
],
'keyValueFormat' => [
'position' => [
],
'textFormat' => [
]
],
'numberFormatSource' => '',
'scaleFactor' => ''
],
'sortSpecs' => [
[
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'dataSourceColumnReference' => [
],
'dimensionIndex' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'sortOrder' => ''
]
],
'subtitle' => '',
'subtitleTextFormat' => [
],
'subtitleTextPosition' => [
],
'title' => '',
'titleTextFormat' => [
],
'titleTextPosition' => [
],
'treemapChart' => [
'colorData' => [
],
'colorScale' => [
'maxValueColor' => [
],
'maxValueColorStyle' => [
],
'midValueColor' => [
],
'midValueColorStyle' => [
],
'minValueColor' => [
],
'minValueColorStyle' => [
],
'noDataColor' => [
],
'noDataColorStyle' => [
]
],
'headerColor' => [
],
'headerColorStyle' => [
],
'hideTooltips' => null,
'hintedLevels' => 0,
'labels' => [
],
'levels' => 0,
'maxValue' => '',
'minValue' => '',
'parentLabels' => [
],
'sizeData' => [
],
'textFormat' => [
]
],
'waterfallChart' => [
'connectorLineStyle' => [
],
'domain' => [
'data' => [
],
'reversed' => null
],
'firstValueIsTotal' => null,
'hideConnectorLines' => null,
'series' => [
[
'customSubtotals' => [
[
'dataIsSubtotal' => null,
'label' => '',
'subtotalIndex' => 0
]
],
'data' => [
],
'dataLabel' => [
],
'hideTrailingSubtotal' => null,
'negativeColumnsStyle' => [
'color' => [
],
'colorStyle' => [
],
'label' => ''
],
'positiveColumnsStyle' => [
],
'subtotalColumnsStyle' => [
]
]
],
'stackedType' => '',
'totalDataLabel' => [
]
]
]
]
],
'addConditionalFormatRule' => [
'index' => 0,
'rule' => [
'booleanRule' => [
'condition' => [
],
'format' => [
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'borders' => [
'bottom' => [
'color' => [
],
'colorStyle' => [
],
'style' => '',
'width' => 0
],
'left' => [
],
'right' => [
],
'top' => [
]
],
'horizontalAlignment' => '',
'hyperlinkDisplayType' => '',
'numberFormat' => [
'pattern' => '',
'type' => ''
],
'padding' => [
'bottom' => 0,
'left' => 0,
'right' => 0,
'top' => 0
],
'textDirection' => '',
'textFormat' => [
],
'textRotation' => [
'angle' => 0,
'vertical' => null
],
'verticalAlignment' => '',
'wrapStrategy' => ''
]
],
'gradientRule' => [
'maxpoint' => [
'color' => [
],
'colorStyle' => [
],
'type' => '',
'value' => ''
],
'midpoint' => [
],
'minpoint' => [
]
],
'ranges' => [
[
]
]
]
],
'addDataSource' => [
'dataSource' => [
'calculatedColumns' => [
[
'formula' => '',
'reference' => [
]
]
],
'dataSourceId' => '',
'sheetId' => 0,
'spec' => [
'bigQuery' => [
'projectId' => '',
'querySpec' => [
'rawQuery' => ''
],
'tableSpec' => [
'datasetId' => '',
'tableId' => '',
'tableProjectId' => ''
]
],
'parameters' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
]
]
]
],
'addDimensionGroup' => [
'range' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
]
],
'addFilterView' => [
'filter' => [
'criteria' => [
],
'filterSpecs' => [
[
]
],
'filterViewId' => 0,
'namedRangeId' => '',
'range' => [
],
'sortSpecs' => [
[
]
],
'title' => ''
]
],
'addNamedRange' => [
'namedRange' => [
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
],
'addProtectedRange' => [
'protectedRange' => [
'description' => '',
'editors' => [
'domainUsersCanEdit' => null,
'groups' => [
],
'users' => [
]
],
'namedRangeId' => '',
'protectedRangeId' => 0,
'range' => [
],
'requestingUserCanEdit' => null,
'unprotectedRanges' => [
[
]
],
'warningOnly' => null
]
],
'addSheet' => [
'properties' => [
'dataSourceSheetProperties' => [
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'gridProperties' => [
'columnCount' => 0,
'columnGroupControlAfter' => null,
'frozenColumnCount' => 0,
'frozenRowCount' => 0,
'hideGridlines' => null,
'rowCount' => 0,
'rowGroupControlAfter' => null
],
'hidden' => null,
'index' => 0,
'rightToLeft' => null,
'sheetId' => 0,
'sheetType' => '',
'tabColor' => [
],
'tabColorStyle' => [
],
'title' => ''
]
],
'addSlicer' => [
'slicer' => [
'position' => [
],
'slicerId' => 0,
'spec' => [
'applyToPivotTables' => null,
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'columnIndex' => 0,
'dataRange' => [
],
'filterCriteria' => [
],
'horizontalAlignment' => '',
'textFormat' => [
],
'title' => ''
]
]
],
'appendCells' => [
'fields' => '',
'rows' => [
[
'values' => [
[
'dataSourceFormula' => [
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'dataSourceTable' => [
'columnSelectionType' => '',
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
]
],
'rowLimit' => 0,
'sortSpecs' => [
[
]
]
],
'dataValidation' => [
'condition' => [
],
'inputMessage' => '',
'showCustomUi' => null,
'strict' => null
],
'effectiveFormat' => [
],
'effectiveValue' => [
'boolValue' => null,
'errorValue' => [
'message' => '',
'type' => ''
],
'formulaValue' => '',
'numberValue' => '',
'stringValue' => ''
],
'formattedValue' => '',
'hyperlink' => '',
'note' => '',
'pivotTable' => [
'columns' => [
[
'dataSourceColumnReference' => [
],
'groupLimit' => [
'applyOrder' => 0,
'countLimit' => 0
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'end' => '',
'interval' => '',
'start' => ''
],
'manualRule' => [
'groups' => [
[
'groupName' => [
],
'items' => [
[
]
]
]
]
]
],
'label' => '',
'repeatHeadings' => null,
'showTotals' => null,
'sortOrder' => '',
'sourceColumnOffset' => 0,
'valueBucket' => [
'buckets' => [
[
]
],
'valuesIndex' => 0
],
'valueMetadata' => [
[
'collapsed' => null,
'value' => [
]
]
]
]
],
'criteria' => [
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
'columnOffsetIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
],
'visibleByDefault' => null,
'visibleValues' => [
]
]
]
],
'rows' => [
[
]
],
'source' => [
],
'valueLayout' => '',
'values' => [
[
'calculatedDisplayType' => '',
'dataSourceColumnReference' => [
],
'formula' => '',
'name' => '',
'sourceColumnOffset' => 0,
'summarizeFunction' => ''
]
]
],
'textFormatRuns' => [
[
'format' => [
],
'startIndex' => 0
]
],
'userEnteredFormat' => [
],
'userEnteredValue' => [
]
]
]
]
],
'sheetId' => 0
],
'appendDimension' => [
'dimension' => '',
'length' => 0,
'sheetId' => 0
],
'autoFill' => [
'range' => [
],
'sourceAndDestination' => [
'dimension' => '',
'fillLength' => 0,
'source' => [
]
],
'useAlternateSeries' => null
],
'autoResizeDimensions' => [
'dataSourceSheetDimensions' => [
'columnReferences' => [
[
]
],
'sheetId' => 0
],
'dimensions' => [
]
],
'clearBasicFilter' => [
'sheetId' => 0
],
'copyPaste' => [
'destination' => [
],
'pasteOrientation' => '',
'pasteType' => '',
'source' => [
]
],
'createDeveloperMetadata' => [
'developerMetadata' => [
'location' => [
'dimensionRange' => [
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataId' => 0,
'metadataKey' => '',
'metadataValue' => '',
'visibility' => ''
]
],
'cutPaste' => [
'destination' => [
],
'pasteType' => '',
'source' => [
]
],
'deleteBanding' => [
'bandedRangeId' => 0
],
'deleteConditionalFormatRule' => [
'index' => 0,
'sheetId' => 0
],
'deleteDataSource' => [
'dataSourceId' => ''
],
'deleteDeveloperMetadata' => [
'dataFilter' => [
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
]
]
],
'deleteDimension' => [
'range' => [
]
],
'deleteDimensionGroup' => [
'range' => [
]
],
'deleteDuplicates' => [
'comparisonColumns' => [
[
]
],
'range' => [
]
],
'deleteEmbeddedObject' => [
'objectId' => 0
],
'deleteFilterView' => [
'filterId' => 0
],
'deleteNamedRange' => [
'namedRangeId' => ''
],
'deleteProtectedRange' => [
'protectedRangeId' => 0
],
'deleteRange' => [
'range' => [
],
'shiftDimension' => ''
],
'deleteSheet' => [
'sheetId' => 0
],
'duplicateFilterView' => [
'filterId' => 0
],
'duplicateSheet' => [
'insertSheetIndex' => 0,
'newSheetId' => 0,
'newSheetName' => '',
'sourceSheetId' => 0
],
'findReplace' => [
'allSheets' => null,
'find' => '',
'includeFormulas' => null,
'matchCase' => null,
'matchEntireCell' => null,
'range' => [
],
'replacement' => '',
'searchByRegex' => null,
'sheetId' => 0
],
'insertDimension' => [
'inheritFromBefore' => null,
'range' => [
]
],
'insertRange' => [
'range' => [
],
'shiftDimension' => ''
],
'mergeCells' => [
'mergeType' => '',
'range' => [
]
],
'moveDimension' => [
'destinationIndex' => 0,
'source' => [
]
],
'pasteData' => [
'coordinate' => [
],
'data' => '',
'delimiter' => '',
'html' => null,
'type' => ''
],
'randomizeRange' => [
'range' => [
]
],
'refreshDataSource' => [
'dataSourceId' => '',
'force' => null,
'isAll' => null,
'references' => [
'references' => [
[
'chartId' => 0,
'dataSourceFormulaCell' => [
],
'dataSourcePivotTableAnchorCell' => [
],
'dataSourceTableAnchorCell' => [
],
'sheetId' => ''
]
]
]
],
'repeatCell' => [
'cell' => [
],
'fields' => '',
'range' => [
]
],
'setBasicFilter' => [
'filter' => [
'criteria' => [
],
'filterSpecs' => [
[
]
],
'range' => [
],
'sortSpecs' => [
[
]
]
]
],
'setDataValidation' => [
'range' => [
],
'rule' => [
]
],
'sortRange' => [
'range' => [
],
'sortSpecs' => [
[
]
]
],
'textToColumns' => [
'delimiter' => '',
'delimiterType' => '',
'source' => [
]
],
'trimWhitespace' => [
'range' => [
]
],
'unmergeCells' => [
'range' => [
]
],
'updateBanding' => [
'bandedRange' => [
],
'fields' => ''
],
'updateBorders' => [
'bottom' => [
],
'innerHorizontal' => [
],
'innerVertical' => [
],
'left' => [
],
'range' => [
],
'right' => [
],
'top' => [
]
],
'updateCells' => [
'fields' => '',
'range' => [
],
'rows' => [
[
]
],
'start' => [
]
],
'updateChartSpec' => [
'chartId' => 0,
'spec' => [
]
],
'updateConditionalFormatRule' => [
'index' => 0,
'newIndex' => 0,
'rule' => [
],
'sheetId' => 0
],
'updateDataSource' => [
'dataSource' => [
],
'fields' => ''
],
'updateDeveloperMetadata' => [
'dataFilters' => [
[
]
],
'developerMetadata' => [
],
'fields' => ''
],
'updateDimensionGroup' => [
'dimensionGroup' => [
'collapsed' => null,
'depth' => 0,
'range' => [
]
],
'fields' => ''
],
'updateDimensionProperties' => [
'dataSourceSheetRange' => [
],
'fields' => '',
'properties' => [
'dataSourceColumnReference' => [
],
'developerMetadata' => [
[
]
],
'hiddenByFilter' => null,
'hiddenByUser' => null,
'pixelSize' => 0
],
'range' => [
]
],
'updateEmbeddedObjectBorder' => [
'border' => [
],
'fields' => '',
'objectId' => 0
],
'updateEmbeddedObjectPosition' => [
'fields' => '',
'newPosition' => [
],
'objectId' => 0
],
'updateFilterView' => [
'fields' => '',
'filter' => [
]
],
'updateNamedRange' => [
'fields' => '',
'namedRange' => [
]
],
'updateProtectedRange' => [
'fields' => '',
'protectedRange' => [
]
],
'updateSheetProperties' => [
'fields' => '',
'properties' => [
]
],
'updateSlicerSpec' => [
'fields' => '',
'slicerId' => 0,
'spec' => [
]
],
'updateSpreadsheetProperties' => [
'fields' => '',
'properties' => [
'autoRecalc' => '',
'defaultFormat' => [
],
'iterativeCalculationSettings' => [
'convergenceThreshold' => '',
'maxIterations' => 0
],
'locale' => '',
'spreadsheetTheme' => [
'primaryFontFamily' => '',
'themeColors' => [
[
'color' => [
],
'colorType' => ''
]
]
],
'timeZone' => '',
'title' => ''
]
]
]
],
'responseIncludeGridData' => null,
'responseRanges' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'includeSpreadsheetInResponse' => null,
'requests' => [
[
'addBanding' => [
'bandedRange' => [
'bandedRangeId' => 0,
'columnProperties' => [
'firstBandColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'firstBandColorStyle' => [
'rgbColor' => [
],
'themeColor' => ''
],
'footerColor' => [
],
'footerColorStyle' => [
],
'headerColor' => [
],
'headerColorStyle' => [
],
'secondBandColor' => [
],
'secondBandColorStyle' => [
]
],
'range' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
],
'rowProperties' => [
]
]
],
'addChart' => [
'chart' => [
'border' => [
'color' => [
],
'colorStyle' => [
]
],
'chartId' => 0,
'position' => [
'newSheet' => null,
'overlayPosition' => [
'anchorCell' => [
'columnIndex' => 0,
'rowIndex' => 0,
'sheetId' => 0
],
'heightPixels' => 0,
'offsetXPixels' => 0,
'offsetYPixels' => 0,
'widthPixels' => 0
],
'sheetId' => 0
],
'spec' => [
'altText' => '',
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'basicChart' => [
'axis' => [
[
'format' => [
'bold' => null,
'fontFamily' => '',
'fontSize' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'italic' => null,
'link' => [
'uri' => ''
],
'strikethrough' => null,
'underline' => null
],
'position' => '',
'title' => '',
'titleTextPosition' => [
'horizontalAlignment' => ''
],
'viewWindowOptions' => [
'viewWindowMax' => '',
'viewWindowMin' => '',
'viewWindowMode' => ''
]
]
],
'chartType' => '',
'compareMode' => '',
'domains' => [
[
'domain' => [
'aggregateType' => '',
'columnReference' => [
'name' => ''
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'intervalSize' => '',
'maxValue' => '',
'minValue' => ''
]
],
'sourceRange' => [
'sources' => [
[
]
]
]
],
'reversed' => null
]
],
'headerCount' => 0,
'interpolateNulls' => null,
'legendPosition' => '',
'lineSmoothing' => null,
'series' => [
[
'color' => [
],
'colorStyle' => [
],
'dataLabel' => [
'customLabelData' => [
],
'placement' => '',
'textFormat' => [
],
'type' => ''
],
'lineStyle' => [
'type' => '',
'width' => 0
],
'pointStyle' => [
'shape' => '',
'size' => ''
],
'series' => [
],
'styleOverrides' => [
[
'color' => [
],
'colorStyle' => [
],
'index' => 0,
'pointStyle' => [
]
]
],
'targetAxis' => '',
'type' => ''
]
],
'stackedType' => '',
'threeDimensional' => null,
'totalDataLabel' => [
]
],
'bubbleChart' => [
'bubbleBorderColor' => [
],
'bubbleBorderColorStyle' => [
],
'bubbleLabels' => [
],
'bubbleMaxRadiusSize' => 0,
'bubbleMinRadiusSize' => 0,
'bubbleOpacity' => '',
'bubbleSizes' => [
],
'bubbleTextStyle' => [
],
'domain' => [
],
'groupIds' => [
],
'legendPosition' => '',
'series' => [
]
],
'candlestickChart' => [
'data' => [
[
'closeSeries' => [
'data' => [
]
],
'highSeries' => [
],
'lowSeries' => [
],
'openSeries' => [
]
]
],
'domain' => [
'data' => [
],
'reversed' => null
]
],
'dataSourceChartProperties' => [
'dataExecutionStatus' => [
'errorCode' => '',
'errorMessage' => '',
'lastRefreshTime' => '',
'state' => ''
],
'dataSourceId' => ''
],
'filterSpecs' => [
[
'columnIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
'type' => '',
'values' => [
[
'relativeDate' => '',
'userEnteredValue' => ''
]
]
],
'hiddenValues' => [
],
'visibleBackgroundColor' => [
],
'visibleBackgroundColorStyle' => [
],
'visibleForegroundColor' => [
],
'visibleForegroundColorStyle' => [
]
]
]
],
'fontName' => '',
'hiddenDimensionStrategy' => '',
'histogramChart' => [
'bucketSize' => '',
'legendPosition' => '',
'outlierPercentile' => '',
'series' => [
[
'barColor' => [
],
'barColorStyle' => [
],
'data' => [
]
]
],
'showItemDividers' => null
],
'maximized' => null,
'orgChart' => [
'labels' => [
],
'nodeColor' => [
],
'nodeColorStyle' => [
],
'nodeSize' => '',
'parentLabels' => [
],
'selectedNodeColor' => [
],
'selectedNodeColorStyle' => [
],
'tooltips' => [
]
],
'pieChart' => [
'domain' => [
],
'legendPosition' => '',
'pieHole' => '',
'series' => [
],
'threeDimensional' => null
],
'scorecardChart' => [
'aggregateType' => '',
'baselineValueData' => [
],
'baselineValueFormat' => [
'comparisonType' => '',
'description' => '',
'negativeColor' => [
],
'negativeColorStyle' => [
],
'position' => [
],
'positiveColor' => [
],
'positiveColorStyle' => [
],
'textFormat' => [
]
],
'customFormatOptions' => [
'prefix' => '',
'suffix' => ''
],
'keyValueData' => [
],
'keyValueFormat' => [
'position' => [
],
'textFormat' => [
]
],
'numberFormatSource' => '',
'scaleFactor' => ''
],
'sortSpecs' => [
[
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'dataSourceColumnReference' => [
],
'dimensionIndex' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'sortOrder' => ''
]
],
'subtitle' => '',
'subtitleTextFormat' => [
],
'subtitleTextPosition' => [
],
'title' => '',
'titleTextFormat' => [
],
'titleTextPosition' => [
],
'treemapChart' => [
'colorData' => [
],
'colorScale' => [
'maxValueColor' => [
],
'maxValueColorStyle' => [
],
'midValueColor' => [
],
'midValueColorStyle' => [
],
'minValueColor' => [
],
'minValueColorStyle' => [
],
'noDataColor' => [
],
'noDataColorStyle' => [
]
],
'headerColor' => [
],
'headerColorStyle' => [
],
'hideTooltips' => null,
'hintedLevels' => 0,
'labels' => [
],
'levels' => 0,
'maxValue' => '',
'minValue' => '',
'parentLabels' => [
],
'sizeData' => [
],
'textFormat' => [
]
],
'waterfallChart' => [
'connectorLineStyle' => [
],
'domain' => [
'data' => [
],
'reversed' => null
],
'firstValueIsTotal' => null,
'hideConnectorLines' => null,
'series' => [
[
'customSubtotals' => [
[
'dataIsSubtotal' => null,
'label' => '',
'subtotalIndex' => 0
]
],
'data' => [
],
'dataLabel' => [
],
'hideTrailingSubtotal' => null,
'negativeColumnsStyle' => [
'color' => [
],
'colorStyle' => [
],
'label' => ''
],
'positiveColumnsStyle' => [
],
'subtotalColumnsStyle' => [
]
]
],
'stackedType' => '',
'totalDataLabel' => [
]
]
]
]
],
'addConditionalFormatRule' => [
'index' => 0,
'rule' => [
'booleanRule' => [
'condition' => [
],
'format' => [
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'borders' => [
'bottom' => [
'color' => [
],
'colorStyle' => [
],
'style' => '',
'width' => 0
],
'left' => [
],
'right' => [
],
'top' => [
]
],
'horizontalAlignment' => '',
'hyperlinkDisplayType' => '',
'numberFormat' => [
'pattern' => '',
'type' => ''
],
'padding' => [
'bottom' => 0,
'left' => 0,
'right' => 0,
'top' => 0
],
'textDirection' => '',
'textFormat' => [
],
'textRotation' => [
'angle' => 0,
'vertical' => null
],
'verticalAlignment' => '',
'wrapStrategy' => ''
]
],
'gradientRule' => [
'maxpoint' => [
'color' => [
],
'colorStyle' => [
],
'type' => '',
'value' => ''
],
'midpoint' => [
],
'minpoint' => [
]
],
'ranges' => [
[
]
]
]
],
'addDataSource' => [
'dataSource' => [
'calculatedColumns' => [
[
'formula' => '',
'reference' => [
]
]
],
'dataSourceId' => '',
'sheetId' => 0,
'spec' => [
'bigQuery' => [
'projectId' => '',
'querySpec' => [
'rawQuery' => ''
],
'tableSpec' => [
'datasetId' => '',
'tableId' => '',
'tableProjectId' => ''
]
],
'parameters' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
]
]
]
],
'addDimensionGroup' => [
'range' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
]
],
'addFilterView' => [
'filter' => [
'criteria' => [
],
'filterSpecs' => [
[
]
],
'filterViewId' => 0,
'namedRangeId' => '',
'range' => [
],
'sortSpecs' => [
[
]
],
'title' => ''
]
],
'addNamedRange' => [
'namedRange' => [
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
],
'addProtectedRange' => [
'protectedRange' => [
'description' => '',
'editors' => [
'domainUsersCanEdit' => null,
'groups' => [
],
'users' => [
]
],
'namedRangeId' => '',
'protectedRangeId' => 0,
'range' => [
],
'requestingUserCanEdit' => null,
'unprotectedRanges' => [
[
]
],
'warningOnly' => null
]
],
'addSheet' => [
'properties' => [
'dataSourceSheetProperties' => [
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'gridProperties' => [
'columnCount' => 0,
'columnGroupControlAfter' => null,
'frozenColumnCount' => 0,
'frozenRowCount' => 0,
'hideGridlines' => null,
'rowCount' => 0,
'rowGroupControlAfter' => null
],
'hidden' => null,
'index' => 0,
'rightToLeft' => null,
'sheetId' => 0,
'sheetType' => '',
'tabColor' => [
],
'tabColorStyle' => [
],
'title' => ''
]
],
'addSlicer' => [
'slicer' => [
'position' => [
],
'slicerId' => 0,
'spec' => [
'applyToPivotTables' => null,
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'columnIndex' => 0,
'dataRange' => [
],
'filterCriteria' => [
],
'horizontalAlignment' => '',
'textFormat' => [
],
'title' => ''
]
]
],
'appendCells' => [
'fields' => '',
'rows' => [
[
'values' => [
[
'dataSourceFormula' => [
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'dataSourceTable' => [
'columnSelectionType' => '',
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
]
],
'rowLimit' => 0,
'sortSpecs' => [
[
]
]
],
'dataValidation' => [
'condition' => [
],
'inputMessage' => '',
'showCustomUi' => null,
'strict' => null
],
'effectiveFormat' => [
],
'effectiveValue' => [
'boolValue' => null,
'errorValue' => [
'message' => '',
'type' => ''
],
'formulaValue' => '',
'numberValue' => '',
'stringValue' => ''
],
'formattedValue' => '',
'hyperlink' => '',
'note' => '',
'pivotTable' => [
'columns' => [
[
'dataSourceColumnReference' => [
],
'groupLimit' => [
'applyOrder' => 0,
'countLimit' => 0
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'end' => '',
'interval' => '',
'start' => ''
],
'manualRule' => [
'groups' => [
[
'groupName' => [
],
'items' => [
[
]
]
]
]
]
],
'label' => '',
'repeatHeadings' => null,
'showTotals' => null,
'sortOrder' => '',
'sourceColumnOffset' => 0,
'valueBucket' => [
'buckets' => [
[
]
],
'valuesIndex' => 0
],
'valueMetadata' => [
[
'collapsed' => null,
'value' => [
]
]
]
]
],
'criteria' => [
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
'columnOffsetIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
],
'visibleByDefault' => null,
'visibleValues' => [
]
]
]
],
'rows' => [
[
]
],
'source' => [
],
'valueLayout' => '',
'values' => [
[
'calculatedDisplayType' => '',
'dataSourceColumnReference' => [
],
'formula' => '',
'name' => '',
'sourceColumnOffset' => 0,
'summarizeFunction' => ''
]
]
],
'textFormatRuns' => [
[
'format' => [
],
'startIndex' => 0
]
],
'userEnteredFormat' => [
],
'userEnteredValue' => [
]
]
]
]
],
'sheetId' => 0
],
'appendDimension' => [
'dimension' => '',
'length' => 0,
'sheetId' => 0
],
'autoFill' => [
'range' => [
],
'sourceAndDestination' => [
'dimension' => '',
'fillLength' => 0,
'source' => [
]
],
'useAlternateSeries' => null
],
'autoResizeDimensions' => [
'dataSourceSheetDimensions' => [
'columnReferences' => [
[
]
],
'sheetId' => 0
],
'dimensions' => [
]
],
'clearBasicFilter' => [
'sheetId' => 0
],
'copyPaste' => [
'destination' => [
],
'pasteOrientation' => '',
'pasteType' => '',
'source' => [
]
],
'createDeveloperMetadata' => [
'developerMetadata' => [
'location' => [
'dimensionRange' => [
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataId' => 0,
'metadataKey' => '',
'metadataValue' => '',
'visibility' => ''
]
],
'cutPaste' => [
'destination' => [
],
'pasteType' => '',
'source' => [
]
],
'deleteBanding' => [
'bandedRangeId' => 0
],
'deleteConditionalFormatRule' => [
'index' => 0,
'sheetId' => 0
],
'deleteDataSource' => [
'dataSourceId' => ''
],
'deleteDeveloperMetadata' => [
'dataFilter' => [
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
]
]
],
'deleteDimension' => [
'range' => [
]
],
'deleteDimensionGroup' => [
'range' => [
]
],
'deleteDuplicates' => [
'comparisonColumns' => [
[
]
],
'range' => [
]
],
'deleteEmbeddedObject' => [
'objectId' => 0
],
'deleteFilterView' => [
'filterId' => 0
],
'deleteNamedRange' => [
'namedRangeId' => ''
],
'deleteProtectedRange' => [
'protectedRangeId' => 0
],
'deleteRange' => [
'range' => [
],
'shiftDimension' => ''
],
'deleteSheet' => [
'sheetId' => 0
],
'duplicateFilterView' => [
'filterId' => 0
],
'duplicateSheet' => [
'insertSheetIndex' => 0,
'newSheetId' => 0,
'newSheetName' => '',
'sourceSheetId' => 0
],
'findReplace' => [
'allSheets' => null,
'find' => '',
'includeFormulas' => null,
'matchCase' => null,
'matchEntireCell' => null,
'range' => [
],
'replacement' => '',
'searchByRegex' => null,
'sheetId' => 0
],
'insertDimension' => [
'inheritFromBefore' => null,
'range' => [
]
],
'insertRange' => [
'range' => [
],
'shiftDimension' => ''
],
'mergeCells' => [
'mergeType' => '',
'range' => [
]
],
'moveDimension' => [
'destinationIndex' => 0,
'source' => [
]
],
'pasteData' => [
'coordinate' => [
],
'data' => '',
'delimiter' => '',
'html' => null,
'type' => ''
],
'randomizeRange' => [
'range' => [
]
],
'refreshDataSource' => [
'dataSourceId' => '',
'force' => null,
'isAll' => null,
'references' => [
'references' => [
[
'chartId' => 0,
'dataSourceFormulaCell' => [
],
'dataSourcePivotTableAnchorCell' => [
],
'dataSourceTableAnchorCell' => [
],
'sheetId' => ''
]
]
]
],
'repeatCell' => [
'cell' => [
],
'fields' => '',
'range' => [
]
],
'setBasicFilter' => [
'filter' => [
'criteria' => [
],
'filterSpecs' => [
[
]
],
'range' => [
],
'sortSpecs' => [
[
]
]
]
],
'setDataValidation' => [
'range' => [
],
'rule' => [
]
],
'sortRange' => [
'range' => [
],
'sortSpecs' => [
[
]
]
],
'textToColumns' => [
'delimiter' => '',
'delimiterType' => '',
'source' => [
]
],
'trimWhitespace' => [
'range' => [
]
],
'unmergeCells' => [
'range' => [
]
],
'updateBanding' => [
'bandedRange' => [
],
'fields' => ''
],
'updateBorders' => [
'bottom' => [
],
'innerHorizontal' => [
],
'innerVertical' => [
],
'left' => [
],
'range' => [
],
'right' => [
],
'top' => [
]
],
'updateCells' => [
'fields' => '',
'range' => [
],
'rows' => [
[
]
],
'start' => [
]
],
'updateChartSpec' => [
'chartId' => 0,
'spec' => [
]
],
'updateConditionalFormatRule' => [
'index' => 0,
'newIndex' => 0,
'rule' => [
],
'sheetId' => 0
],
'updateDataSource' => [
'dataSource' => [
],
'fields' => ''
],
'updateDeveloperMetadata' => [
'dataFilters' => [
[
]
],
'developerMetadata' => [
],
'fields' => ''
],
'updateDimensionGroup' => [
'dimensionGroup' => [
'collapsed' => null,
'depth' => 0,
'range' => [
]
],
'fields' => ''
],
'updateDimensionProperties' => [
'dataSourceSheetRange' => [
],
'fields' => '',
'properties' => [
'dataSourceColumnReference' => [
],
'developerMetadata' => [
[
]
],
'hiddenByFilter' => null,
'hiddenByUser' => null,
'pixelSize' => 0
],
'range' => [
]
],
'updateEmbeddedObjectBorder' => [
'border' => [
],
'fields' => '',
'objectId' => 0
],
'updateEmbeddedObjectPosition' => [
'fields' => '',
'newPosition' => [
],
'objectId' => 0
],
'updateFilterView' => [
'fields' => '',
'filter' => [
]
],
'updateNamedRange' => [
'fields' => '',
'namedRange' => [
]
],
'updateProtectedRange' => [
'fields' => '',
'protectedRange' => [
]
],
'updateSheetProperties' => [
'fields' => '',
'properties' => [
]
],
'updateSlicerSpec' => [
'fields' => '',
'slicerId' => 0,
'spec' => [
]
],
'updateSpreadsheetProperties' => [
'fields' => '',
'properties' => [
'autoRecalc' => '',
'defaultFormat' => [
],
'iterativeCalculationSettings' => [
'convergenceThreshold' => '',
'maxIterations' => 0
],
'locale' => '',
'spreadsheetTheme' => [
'primaryFontFamily' => '',
'themeColors' => [
[
'color' => [
],
'colorType' => ''
]
]
],
'timeZone' => '',
'title' => ''
]
]
]
],
'responseIncludeGridData' => null,
'responseRanges' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId:batchUpdate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"
payload = {
"includeSpreadsheetInResponse": False,
"requests": [
{
"addBanding": { "bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
} },
"addChart": { "chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": False,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": False,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": False,
"link": { "uri": "" },
"strikethrough": False,
"underline": False
},
"position": "",
"title": "",
"titleTextPosition": { "horizontalAlignment": "" },
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": { "name": "" },
"groupRule": {
"dateTimeRule": { "type": "" },
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": { "sources": [{}] }
},
"reversed": False
}
],
"headerCount": 0,
"interpolateNulls": False,
"legendPosition": "",
"lineSmoothing": False,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": False,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": { "data": {} },
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": False
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": False
},
"maximized": False,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": False
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": False,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": False
},
"firstValueIsTotal": False,
"hideConnectorLines": False,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": False,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": False,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
} },
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": False
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [{}]
}
},
"addDataSource": { "dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": { "rawQuery": "" },
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
} },
"addDimensionGroup": { "range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
} },
"addFilterView": { "filter": {
"criteria": {},
"filterSpecs": [{}],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [{}],
"title": ""
} },
"addNamedRange": { "namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
} },
"addProtectedRange": { "protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": False,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": False,
"unprotectedRanges": [{}],
"warningOnly": False
} },
"addSheet": { "properties": {
"dataSourceSheetProperties": {
"columns": [{}],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": False,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": False,
"rowCount": 0,
"rowGroupControlAfter": False
},
"hidden": False,
"index": 0,
"rightToLeft": False,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
} },
"addSlicer": { "slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": False,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
} },
"appendCells": {
"fields": "",
"rows": [{ "values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [{}],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [{}],
"rowLimit": 0,
"sortSpecs": [{}]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": False,
"strict": False
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": False,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": { "type": "" },
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": { "groups": [
{
"groupName": {},
"items": [{}]
}
] }
},
"label": "",
"repeatHeadings": False,
"showTotals": False,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [{}],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": False,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": False,
"visibleValues": []
}
}
],
"rows": [{}],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
] }],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": False
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [{}],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": { "sheetId": 0 },
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": { "developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
} },
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": { "bandedRangeId": 0 },
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": { "dataSourceId": "" },
"deleteDeveloperMetadata": { "dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
} },
"deleteDimension": { "range": {} },
"deleteDimensionGroup": { "range": {} },
"deleteDuplicates": {
"comparisonColumns": [{}],
"range": {}
},
"deleteEmbeddedObject": { "objectId": 0 },
"deleteFilterView": { "filterId": 0 },
"deleteNamedRange": { "namedRangeId": "" },
"deleteProtectedRange": { "protectedRangeId": 0 },
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": { "sheetId": 0 },
"duplicateFilterView": { "filterId": 0 },
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": False,
"find": "",
"includeFormulas": False,
"matchCase": False,
"matchEntireCell": False,
"range": {},
"replacement": "",
"searchByRegex": False,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": False,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": False,
"type": ""
},
"randomizeRange": { "range": {} },
"refreshDataSource": {
"dataSourceId": "",
"force": False,
"isAll": False,
"references": { "references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
] }
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": { "filter": {
"criteria": {},
"filterSpecs": [{}],
"range": {},
"sortSpecs": [{}]
} },
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [{}]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": { "range": {} },
"unmergeCells": { "range": {} },
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [{}],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [{}],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": False,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [{}],
"hiddenByFilter": False,
"hiddenByUser": False,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": False,
"responseRanges": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate"
payload <- "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId:batchUpdate') do |req|
req.body = "{\n \"includeSpreadsheetInResponse\": false,\n \"requests\": [\n {\n \"addBanding\": {\n \"bandedRange\": {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"firstBandColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n },\n \"rowProperties\": {}\n }\n },\n \"addChart\": {\n \"chart\": {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {\n \"name\": \"\"\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n },\n \"addConditionalFormatRule\": {\n \"index\": 0,\n \"rule\": {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {},\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n }\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n },\n \"addDataSource\": {\n \"dataSource\": {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {}\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ]\n }\n }\n },\n \"addDimensionGroup\": {\n \"range\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n }\n },\n \"addFilterView\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n },\n \"addNamedRange\": {\n \"namedRange\": {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n },\n \"addProtectedRange\": {\n \"protectedRange\": {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n },\n \"addSheet\": {\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n }\n },\n \"addSlicer\": {\n \"slicer\": {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n },\n \"appendCells\": {\n \"fields\": \"\",\n \"rows\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"sheetId\": 0\n },\n \"appendDimension\": {\n \"dimension\": \"\",\n \"length\": 0,\n \"sheetId\": 0\n },\n \"autoFill\": {\n \"range\": {},\n \"sourceAndDestination\": {\n \"dimension\": \"\",\n \"fillLength\": 0,\n \"source\": {}\n },\n \"useAlternateSeries\": false\n },\n \"autoResizeDimensions\": {\n \"dataSourceSheetDimensions\": {\n \"columnReferences\": [\n {}\n ],\n \"sheetId\": 0\n },\n \"dimensions\": {}\n },\n \"clearBasicFilter\": {\n \"sheetId\": 0\n },\n \"copyPaste\": {\n \"destination\": {},\n \"pasteOrientation\": \"\",\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"createDeveloperMetadata\": {\n \"developerMetadata\": {\n \"location\": {\n \"dimensionRange\": {},\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n },\n \"cutPaste\": {\n \"destination\": {},\n \"pasteType\": \"\",\n \"source\": {}\n },\n \"deleteBanding\": {\n \"bandedRangeId\": 0\n },\n \"deleteConditionalFormatRule\": {\n \"index\": 0,\n \"sheetId\": 0\n },\n \"deleteDataSource\": {\n \"dataSourceId\": \"\"\n },\n \"deleteDeveloperMetadata\": {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {},\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {}\n }\n },\n \"deleteDimension\": {\n \"range\": {}\n },\n \"deleteDimensionGroup\": {\n \"range\": {}\n },\n \"deleteDuplicates\": {\n \"comparisonColumns\": [\n {}\n ],\n \"range\": {}\n },\n \"deleteEmbeddedObject\": {\n \"objectId\": 0\n },\n \"deleteFilterView\": {\n \"filterId\": 0\n },\n \"deleteNamedRange\": {\n \"namedRangeId\": \"\"\n },\n \"deleteProtectedRange\": {\n \"protectedRangeId\": 0\n },\n \"deleteRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"deleteSheet\": {\n \"sheetId\": 0\n },\n \"duplicateFilterView\": {\n \"filterId\": 0\n },\n \"duplicateSheet\": {\n \"insertSheetIndex\": 0,\n \"newSheetId\": 0,\n \"newSheetName\": \"\",\n \"sourceSheetId\": 0\n },\n \"findReplace\": {\n \"allSheets\": false,\n \"find\": \"\",\n \"includeFormulas\": false,\n \"matchCase\": false,\n \"matchEntireCell\": false,\n \"range\": {},\n \"replacement\": \"\",\n \"searchByRegex\": false,\n \"sheetId\": 0\n },\n \"insertDimension\": {\n \"inheritFromBefore\": false,\n \"range\": {}\n },\n \"insertRange\": {\n \"range\": {},\n \"shiftDimension\": \"\"\n },\n \"mergeCells\": {\n \"mergeType\": \"\",\n \"range\": {}\n },\n \"moveDimension\": {\n \"destinationIndex\": 0,\n \"source\": {}\n },\n \"pasteData\": {\n \"coordinate\": {},\n \"data\": \"\",\n \"delimiter\": \"\",\n \"html\": false,\n \"type\": \"\"\n },\n \"randomizeRange\": {\n \"range\": {}\n },\n \"refreshDataSource\": {\n \"dataSourceId\": \"\",\n \"force\": false,\n \"isAll\": false,\n \"references\": {\n \"references\": [\n {\n \"chartId\": 0,\n \"dataSourceFormulaCell\": {},\n \"dataSourcePivotTableAnchorCell\": {},\n \"dataSourceTableAnchorCell\": {},\n \"sheetId\": \"\"\n }\n ]\n }\n },\n \"repeatCell\": {\n \"cell\": {},\n \"fields\": \"\",\n \"range\": {}\n },\n \"setBasicFilter\": {\n \"filter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n }\n },\n \"setDataValidation\": {\n \"range\": {},\n \"rule\": {}\n },\n \"sortRange\": {\n \"range\": {},\n \"sortSpecs\": [\n {}\n ]\n },\n \"textToColumns\": {\n \"delimiter\": \"\",\n \"delimiterType\": \"\",\n \"source\": {}\n },\n \"trimWhitespace\": {\n \"range\": {}\n },\n \"unmergeCells\": {\n \"range\": {}\n },\n \"updateBanding\": {\n \"bandedRange\": {},\n \"fields\": \"\"\n },\n \"updateBorders\": {\n \"bottom\": {},\n \"innerHorizontal\": {},\n \"innerVertical\": {},\n \"left\": {},\n \"range\": {},\n \"right\": {},\n \"top\": {}\n },\n \"updateCells\": {\n \"fields\": \"\",\n \"range\": {},\n \"rows\": [\n {}\n ],\n \"start\": {}\n },\n \"updateChartSpec\": {\n \"chartId\": 0,\n \"spec\": {}\n },\n \"updateConditionalFormatRule\": {\n \"index\": 0,\n \"newIndex\": 0,\n \"rule\": {},\n \"sheetId\": 0\n },\n \"updateDataSource\": {\n \"dataSource\": {},\n \"fields\": \"\"\n },\n \"updateDeveloperMetadata\": {\n \"dataFilters\": [\n {}\n ],\n \"developerMetadata\": {},\n \"fields\": \"\"\n },\n \"updateDimensionGroup\": {\n \"dimensionGroup\": {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n },\n \"fields\": \"\"\n },\n \"updateDimensionProperties\": {\n \"dataSourceSheetRange\": {},\n \"fields\": \"\",\n \"properties\": {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n },\n \"range\": {}\n },\n \"updateEmbeddedObjectBorder\": {\n \"border\": {},\n \"fields\": \"\",\n \"objectId\": 0\n },\n \"updateEmbeddedObjectPosition\": {\n \"fields\": \"\",\n \"newPosition\": {},\n \"objectId\": 0\n },\n \"updateFilterView\": {\n \"fields\": \"\",\n \"filter\": {}\n },\n \"updateNamedRange\": {\n \"fields\": \"\",\n \"namedRange\": {}\n },\n \"updateProtectedRange\": {\n \"fields\": \"\",\n \"protectedRange\": {}\n },\n \"updateSheetProperties\": {\n \"fields\": \"\",\n \"properties\": {}\n },\n \"updateSlicerSpec\": {\n \"fields\": \"\",\n \"slicerId\": 0,\n \"spec\": {}\n },\n \"updateSpreadsheetProperties\": {\n \"fields\": \"\",\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {},\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n }\n }\n }\n ],\n \"responseIncludeGridData\": false,\n \"responseRanges\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate";
let payload = json!({
"includeSpreadsheetInResponse": false,
"requests": (
json!({
"addBanding": json!({"bandedRange": json!({
"bandedRangeId": 0,
"columnProperties": json!({
"firstBandColor": json!({
"alpha": "",
"blue": "",
"green": "",
"red": ""
}),
"firstBandColorStyle": json!({
"rgbColor": json!({}),
"themeColor": ""
}),
"footerColor": json!({}),
"footerColorStyle": json!({}),
"headerColor": json!({}),
"headerColorStyle": json!({}),
"secondBandColor": json!({}),
"secondBandColorStyle": json!({})
}),
"range": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}),
"rowProperties": json!({})
})}),
"addChart": json!({"chart": json!({
"border": json!({
"color": json!({}),
"colorStyle": json!({})
}),
"chartId": 0,
"position": json!({
"newSheet": false,
"overlayPosition": json!({
"anchorCell": json!({
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
}),
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
}),
"sheetId": 0
}),
"spec": json!({
"altText": "",
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"basicChart": json!({
"axis": (
json!({
"format": json!({
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": json!({}),
"foregroundColorStyle": json!({}),
"italic": false,
"link": json!({"uri": ""}),
"strikethrough": false,
"underline": false
}),
"position": "",
"title": "",
"titleTextPosition": json!({"horizontalAlignment": ""}),
"viewWindowOptions": json!({
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
})
})
),
"chartType": "",
"compareMode": "",
"domains": (
json!({
"domain": json!({
"aggregateType": "",
"columnReference": json!({"name": ""}),
"groupRule": json!({
"dateTimeRule": json!({"type": ""}),
"histogramRule": json!({
"intervalSize": "",
"maxValue": "",
"minValue": ""
})
}),
"sourceRange": json!({"sources": (json!({}))})
}),
"reversed": false
})
),
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": (
json!({
"color": json!({}),
"colorStyle": json!({}),
"dataLabel": json!({
"customLabelData": json!({}),
"placement": "",
"textFormat": json!({}),
"type": ""
}),
"lineStyle": json!({
"type": "",
"width": 0
}),
"pointStyle": json!({
"shape": "",
"size": ""
}),
"series": json!({}),
"styleOverrides": (
json!({
"color": json!({}),
"colorStyle": json!({}),
"index": 0,
"pointStyle": json!({})
})
),
"targetAxis": "",
"type": ""
})
),
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": json!({})
}),
"bubbleChart": json!({
"bubbleBorderColor": json!({}),
"bubbleBorderColorStyle": json!({}),
"bubbleLabels": json!({}),
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": json!({}),
"bubbleTextStyle": json!({}),
"domain": json!({}),
"groupIds": json!({}),
"legendPosition": "",
"series": json!({})
}),
"candlestickChart": json!({
"data": (
json!({
"closeSeries": json!({"data": json!({})}),
"highSeries": json!({}),
"lowSeries": json!({}),
"openSeries": json!({})
})
),
"domain": json!({
"data": json!({}),
"reversed": false
})
}),
"dataSourceChartProperties": json!({
"dataExecutionStatus": json!({
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
}),
"dataSourceId": ""
}),
"filterSpecs": (
json!({
"columnIndex": 0,
"dataSourceColumnReference": json!({}),
"filterCriteria": json!({
"condition": json!({
"type": "",
"values": (
json!({
"relativeDate": "",
"userEnteredValue": ""
})
)
}),
"hiddenValues": (),
"visibleBackgroundColor": json!({}),
"visibleBackgroundColorStyle": json!({}),
"visibleForegroundColor": json!({}),
"visibleForegroundColorStyle": json!({})
})
})
),
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": json!({
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": (
json!({
"barColor": json!({}),
"barColorStyle": json!({}),
"data": json!({})
})
),
"showItemDividers": false
}),
"maximized": false,
"orgChart": json!({
"labels": json!({}),
"nodeColor": json!({}),
"nodeColorStyle": json!({}),
"nodeSize": "",
"parentLabels": json!({}),
"selectedNodeColor": json!({}),
"selectedNodeColorStyle": json!({}),
"tooltips": json!({})
}),
"pieChart": json!({
"domain": json!({}),
"legendPosition": "",
"pieHole": "",
"series": json!({}),
"threeDimensional": false
}),
"scorecardChart": json!({
"aggregateType": "",
"baselineValueData": json!({}),
"baselineValueFormat": json!({
"comparisonType": "",
"description": "",
"negativeColor": json!({}),
"negativeColorStyle": json!({}),
"position": json!({}),
"positiveColor": json!({}),
"positiveColorStyle": json!({}),
"textFormat": json!({})
}),
"customFormatOptions": json!({
"prefix": "",
"suffix": ""
}),
"keyValueData": json!({}),
"keyValueFormat": json!({
"position": json!({}),
"textFormat": json!({})
}),
"numberFormatSource": "",
"scaleFactor": ""
}),
"sortSpecs": (
json!({
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"dataSourceColumnReference": json!({}),
"dimensionIndex": 0,
"foregroundColor": json!({}),
"foregroundColorStyle": json!({}),
"sortOrder": ""
})
),
"subtitle": "",
"subtitleTextFormat": json!({}),
"subtitleTextPosition": json!({}),
"title": "",
"titleTextFormat": json!({}),
"titleTextPosition": json!({}),
"treemapChart": json!({
"colorData": json!({}),
"colorScale": json!({
"maxValueColor": json!({}),
"maxValueColorStyle": json!({}),
"midValueColor": json!({}),
"midValueColorStyle": json!({}),
"minValueColor": json!({}),
"minValueColorStyle": json!({}),
"noDataColor": json!({}),
"noDataColorStyle": json!({})
}),
"headerColor": json!({}),
"headerColorStyle": json!({}),
"hideTooltips": false,
"hintedLevels": 0,
"labels": json!({}),
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": json!({}),
"sizeData": json!({}),
"textFormat": json!({})
}),
"waterfallChart": json!({
"connectorLineStyle": json!({}),
"domain": json!({
"data": json!({}),
"reversed": false
}),
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": (
json!({
"customSubtotals": (
json!({
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
})
),
"data": json!({}),
"dataLabel": json!({}),
"hideTrailingSubtotal": false,
"negativeColumnsStyle": json!({
"color": json!({}),
"colorStyle": json!({}),
"label": ""
}),
"positiveColumnsStyle": json!({}),
"subtotalColumnsStyle": json!({})
})
),
"stackedType": "",
"totalDataLabel": json!({})
})
})
})}),
"addConditionalFormatRule": json!({
"index": 0,
"rule": json!({
"booleanRule": json!({
"condition": json!({}),
"format": json!({
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"borders": json!({
"bottom": json!({
"color": json!({}),
"colorStyle": json!({}),
"style": "",
"width": 0
}),
"left": json!({}),
"right": json!({}),
"top": json!({})
}),
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": json!({
"pattern": "",
"type": ""
}),
"padding": json!({
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
}),
"textDirection": "",
"textFormat": json!({}),
"textRotation": json!({
"angle": 0,
"vertical": false
}),
"verticalAlignment": "",
"wrapStrategy": ""
})
}),
"gradientRule": json!({
"maxpoint": json!({
"color": json!({}),
"colorStyle": json!({}),
"type": "",
"value": ""
}),
"midpoint": json!({}),
"minpoint": json!({})
}),
"ranges": (json!({}))
})
}),
"addDataSource": json!({"dataSource": json!({
"calculatedColumns": (
json!({
"formula": "",
"reference": json!({})
})
),
"dataSourceId": "",
"sheetId": 0,
"spec": json!({
"bigQuery": json!({
"projectId": "",
"querySpec": json!({"rawQuery": ""}),
"tableSpec": json!({
"datasetId": "",
"tableId": "",
"tableProjectId": ""
})
}),
"parameters": (
json!({
"name": "",
"namedRangeId": "",
"range": json!({})
})
)
})
})}),
"addDimensionGroup": json!({"range": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
})}),
"addFilterView": json!({"filter": json!({
"criteria": json!({}),
"filterSpecs": (json!({})),
"filterViewId": 0,
"namedRangeId": "",
"range": json!({}),
"sortSpecs": (json!({})),
"title": ""
})}),
"addNamedRange": json!({"namedRange": json!({
"name": "",
"namedRangeId": "",
"range": json!({})
})}),
"addProtectedRange": json!({"protectedRange": json!({
"description": "",
"editors": json!({
"domainUsersCanEdit": false,
"groups": (),
"users": ()
}),
"namedRangeId": "",
"protectedRangeId": 0,
"range": json!({}),
"requestingUserCanEdit": false,
"unprotectedRanges": (json!({})),
"warningOnly": false
})}),
"addSheet": json!({"properties": json!({
"dataSourceSheetProperties": json!({
"columns": (json!({})),
"dataExecutionStatus": json!({}),
"dataSourceId": ""
}),
"gridProperties": json!({
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
}),
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": json!({}),
"tabColorStyle": json!({}),
"title": ""
})}),
"addSlicer": json!({"slicer": json!({
"position": json!({}),
"slicerId": 0,
"spec": json!({
"applyToPivotTables": false,
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"columnIndex": 0,
"dataRange": json!({}),
"filterCriteria": json!({}),
"horizontalAlignment": "",
"textFormat": json!({}),
"title": ""
})
})}),
"appendCells": json!({
"fields": "",
"rows": (json!({"values": (
json!({
"dataSourceFormula": json!({
"dataExecutionStatus": json!({}),
"dataSourceId": ""
}),
"dataSourceTable": json!({
"columnSelectionType": "",
"columns": (json!({})),
"dataExecutionStatus": json!({}),
"dataSourceId": "",
"filterSpecs": (json!({})),
"rowLimit": 0,
"sortSpecs": (json!({}))
}),
"dataValidation": json!({
"condition": json!({}),
"inputMessage": "",
"showCustomUi": false,
"strict": false
}),
"effectiveFormat": json!({}),
"effectiveValue": json!({
"boolValue": false,
"errorValue": json!({
"message": "",
"type": ""
}),
"formulaValue": "",
"numberValue": "",
"stringValue": ""
}),
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": json!({
"columns": (
json!({
"dataSourceColumnReference": json!({}),
"groupLimit": json!({
"applyOrder": 0,
"countLimit": 0
}),
"groupRule": json!({
"dateTimeRule": json!({"type": ""}),
"histogramRule": json!({
"end": "",
"interval": "",
"start": ""
}),
"manualRule": json!({"groups": (
json!({
"groupName": json!({}),
"items": (json!({}))
})
)})
}),
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": json!({
"buckets": (json!({})),
"valuesIndex": 0
}),
"valueMetadata": (
json!({
"collapsed": false,
"value": json!({})
})
)
})
),
"criteria": json!({}),
"dataExecutionStatus": json!({}),
"dataSourceId": "",
"filterSpecs": (
json!({
"columnOffsetIndex": 0,
"dataSourceColumnReference": json!({}),
"filterCriteria": json!({
"condition": json!({}),
"visibleByDefault": false,
"visibleValues": ()
})
})
),
"rows": (json!({})),
"source": json!({}),
"valueLayout": "",
"values": (
json!({
"calculatedDisplayType": "",
"dataSourceColumnReference": json!({}),
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
})
)
}),
"textFormatRuns": (
json!({
"format": json!({}),
"startIndex": 0
})
),
"userEnteredFormat": json!({}),
"userEnteredValue": json!({})
})
)})),
"sheetId": 0
}),
"appendDimension": json!({
"dimension": "",
"length": 0,
"sheetId": 0
}),
"autoFill": json!({
"range": json!({}),
"sourceAndDestination": json!({
"dimension": "",
"fillLength": 0,
"source": json!({})
}),
"useAlternateSeries": false
}),
"autoResizeDimensions": json!({
"dataSourceSheetDimensions": json!({
"columnReferences": (json!({})),
"sheetId": 0
}),
"dimensions": json!({})
}),
"clearBasicFilter": json!({"sheetId": 0}),
"copyPaste": json!({
"destination": json!({}),
"pasteOrientation": "",
"pasteType": "",
"source": json!({})
}),
"createDeveloperMetadata": json!({"developerMetadata": json!({
"location": json!({
"dimensionRange": json!({}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
})}),
"cutPaste": json!({
"destination": json!({}),
"pasteType": "",
"source": json!({})
}),
"deleteBanding": json!({"bandedRangeId": 0}),
"deleteConditionalFormatRule": json!({
"index": 0,
"sheetId": 0
}),
"deleteDataSource": json!({"dataSourceId": ""}),
"deleteDeveloperMetadata": json!({"dataFilter": json!({
"a1Range": "",
"developerMetadataLookup": json!({
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": json!({}),
"metadataValue": "",
"visibility": ""
}),
"gridRange": json!({})
})}),
"deleteDimension": json!({"range": json!({})}),
"deleteDimensionGroup": json!({"range": json!({})}),
"deleteDuplicates": json!({
"comparisonColumns": (json!({})),
"range": json!({})
}),
"deleteEmbeddedObject": json!({"objectId": 0}),
"deleteFilterView": json!({"filterId": 0}),
"deleteNamedRange": json!({"namedRangeId": ""}),
"deleteProtectedRange": json!({"protectedRangeId": 0}),
"deleteRange": json!({
"range": json!({}),
"shiftDimension": ""
}),
"deleteSheet": json!({"sheetId": 0}),
"duplicateFilterView": json!({"filterId": 0}),
"duplicateSheet": json!({
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
}),
"findReplace": json!({
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": json!({}),
"replacement": "",
"searchByRegex": false,
"sheetId": 0
}),
"insertDimension": json!({
"inheritFromBefore": false,
"range": json!({})
}),
"insertRange": json!({
"range": json!({}),
"shiftDimension": ""
}),
"mergeCells": json!({
"mergeType": "",
"range": json!({})
}),
"moveDimension": json!({
"destinationIndex": 0,
"source": json!({})
}),
"pasteData": json!({
"coordinate": json!({}),
"data": "",
"delimiter": "",
"html": false,
"type": ""
}),
"randomizeRange": json!({"range": json!({})}),
"refreshDataSource": json!({
"dataSourceId": "",
"force": false,
"isAll": false,
"references": json!({"references": (
json!({
"chartId": 0,
"dataSourceFormulaCell": json!({}),
"dataSourcePivotTableAnchorCell": json!({}),
"dataSourceTableAnchorCell": json!({}),
"sheetId": ""
})
)})
}),
"repeatCell": json!({
"cell": json!({}),
"fields": "",
"range": json!({})
}),
"setBasicFilter": json!({"filter": json!({
"criteria": json!({}),
"filterSpecs": (json!({})),
"range": json!({}),
"sortSpecs": (json!({}))
})}),
"setDataValidation": json!({
"range": json!({}),
"rule": json!({})
}),
"sortRange": json!({
"range": json!({}),
"sortSpecs": (json!({}))
}),
"textToColumns": json!({
"delimiter": "",
"delimiterType": "",
"source": json!({})
}),
"trimWhitespace": json!({"range": json!({})}),
"unmergeCells": json!({"range": json!({})}),
"updateBanding": json!({
"bandedRange": json!({}),
"fields": ""
}),
"updateBorders": json!({
"bottom": json!({}),
"innerHorizontal": json!({}),
"innerVertical": json!({}),
"left": json!({}),
"range": json!({}),
"right": json!({}),
"top": json!({})
}),
"updateCells": json!({
"fields": "",
"range": json!({}),
"rows": (json!({})),
"start": json!({})
}),
"updateChartSpec": json!({
"chartId": 0,
"spec": json!({})
}),
"updateConditionalFormatRule": json!({
"index": 0,
"newIndex": 0,
"rule": json!({}),
"sheetId": 0
}),
"updateDataSource": json!({
"dataSource": json!({}),
"fields": ""
}),
"updateDeveloperMetadata": json!({
"dataFilters": (json!({})),
"developerMetadata": json!({}),
"fields": ""
}),
"updateDimensionGroup": json!({
"dimensionGroup": json!({
"collapsed": false,
"depth": 0,
"range": json!({})
}),
"fields": ""
}),
"updateDimensionProperties": json!({
"dataSourceSheetRange": json!({}),
"fields": "",
"properties": json!({
"dataSourceColumnReference": json!({}),
"developerMetadata": (json!({})),
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}),
"range": json!({})
}),
"updateEmbeddedObjectBorder": json!({
"border": json!({}),
"fields": "",
"objectId": 0
}),
"updateEmbeddedObjectPosition": json!({
"fields": "",
"newPosition": json!({}),
"objectId": 0
}),
"updateFilterView": json!({
"fields": "",
"filter": json!({})
}),
"updateNamedRange": json!({
"fields": "",
"namedRange": json!({})
}),
"updateProtectedRange": json!({
"fields": "",
"protectedRange": json!({})
}),
"updateSheetProperties": json!({
"fields": "",
"properties": json!({})
}),
"updateSlicerSpec": json!({
"fields": "",
"slicerId": 0,
"spec": json!({})
}),
"updateSpreadsheetProperties": json!({
"fields": "",
"properties": json!({
"autoRecalc": "",
"defaultFormat": json!({}),
"iterativeCalculationSettings": json!({
"convergenceThreshold": "",
"maxIterations": 0
}),
"locale": "",
"spreadsheetTheme": json!({
"primaryFontFamily": "",
"themeColors": (
json!({
"color": json!({}),
"colorType": ""
})
)
}),
"timeZone": "",
"title": ""
})
})
})
),
"responseIncludeGridData": false,
"responseRanges": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate \
--header 'content-type: application/json' \
--data '{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}'
echo '{
"includeSpreadsheetInResponse": false,
"requests": [
{
"addBanding": {
"bandedRange": {
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"firstBandColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
},
"rowProperties": {}
}
},
"addChart": {
"chart": {
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {
"name": ""
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
},
"addConditionalFormatRule": {
"index": 0,
"rule": {
"booleanRule": {
"condition": {},
"format": {
"backgroundColor": {},
"backgroundColorStyle": {},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
},
"addDataSource": {
"dataSource": {
"calculatedColumns": [
{
"formula": "",
"reference": {}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
]
}
}
},
"addDimensionGroup": {
"range": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}
},
"addFilterView": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
},
"addNamedRange": {
"namedRange": {
"name": "",
"namedRangeId": "",
"range": {}
}
},
"addProtectedRange": {
"protectedRange": {
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
},
"addSheet": {
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
}
},
"addSlicer": {
"slicer": {
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
},
"appendCells": {
"fields": "",
"rows": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"sheetId": 0
},
"appendDimension": {
"dimension": "",
"length": 0,
"sheetId": 0
},
"autoFill": {
"range": {},
"sourceAndDestination": {
"dimension": "",
"fillLength": 0,
"source": {}
},
"useAlternateSeries": false
},
"autoResizeDimensions": {
"dataSourceSheetDimensions": {
"columnReferences": [
{}
],
"sheetId": 0
},
"dimensions": {}
},
"clearBasicFilter": {
"sheetId": 0
},
"copyPaste": {
"destination": {},
"pasteOrientation": "",
"pasteType": "",
"source": {}
},
"createDeveloperMetadata": {
"developerMetadata": {
"location": {
"dimensionRange": {},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
},
"cutPaste": {
"destination": {},
"pasteType": "",
"source": {}
},
"deleteBanding": {
"bandedRangeId": 0
},
"deleteConditionalFormatRule": {
"index": 0,
"sheetId": 0
},
"deleteDataSource": {
"dataSourceId": ""
},
"deleteDeveloperMetadata": {
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {},
"metadataValue": "",
"visibility": ""
},
"gridRange": {}
}
},
"deleteDimension": {
"range": {}
},
"deleteDimensionGroup": {
"range": {}
},
"deleteDuplicates": {
"comparisonColumns": [
{}
],
"range": {}
},
"deleteEmbeddedObject": {
"objectId": 0
},
"deleteFilterView": {
"filterId": 0
},
"deleteNamedRange": {
"namedRangeId": ""
},
"deleteProtectedRange": {
"protectedRangeId": 0
},
"deleteRange": {
"range": {},
"shiftDimension": ""
},
"deleteSheet": {
"sheetId": 0
},
"duplicateFilterView": {
"filterId": 0
},
"duplicateSheet": {
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
},
"findReplace": {
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": {},
"replacement": "",
"searchByRegex": false,
"sheetId": 0
},
"insertDimension": {
"inheritFromBefore": false,
"range": {}
},
"insertRange": {
"range": {},
"shiftDimension": ""
},
"mergeCells": {
"mergeType": "",
"range": {}
},
"moveDimension": {
"destinationIndex": 0,
"source": {}
},
"pasteData": {
"coordinate": {},
"data": "",
"delimiter": "",
"html": false,
"type": ""
},
"randomizeRange": {
"range": {}
},
"refreshDataSource": {
"dataSourceId": "",
"force": false,
"isAll": false,
"references": {
"references": [
{
"chartId": 0,
"dataSourceFormulaCell": {},
"dataSourcePivotTableAnchorCell": {},
"dataSourceTableAnchorCell": {},
"sheetId": ""
}
]
}
},
"repeatCell": {
"cell": {},
"fields": "",
"range": {}
},
"setBasicFilter": {
"filter": {
"criteria": {},
"filterSpecs": [
{}
],
"range": {},
"sortSpecs": [
{}
]
}
},
"setDataValidation": {
"range": {},
"rule": {}
},
"sortRange": {
"range": {},
"sortSpecs": [
{}
]
},
"textToColumns": {
"delimiter": "",
"delimiterType": "",
"source": {}
},
"trimWhitespace": {
"range": {}
},
"unmergeCells": {
"range": {}
},
"updateBanding": {
"bandedRange": {},
"fields": ""
},
"updateBorders": {
"bottom": {},
"innerHorizontal": {},
"innerVertical": {},
"left": {},
"range": {},
"right": {},
"top": {}
},
"updateCells": {
"fields": "",
"range": {},
"rows": [
{}
],
"start": {}
},
"updateChartSpec": {
"chartId": 0,
"spec": {}
},
"updateConditionalFormatRule": {
"index": 0,
"newIndex": 0,
"rule": {},
"sheetId": 0
},
"updateDataSource": {
"dataSource": {},
"fields": ""
},
"updateDeveloperMetadata": {
"dataFilters": [
{}
],
"developerMetadata": {},
"fields": ""
},
"updateDimensionGroup": {
"dimensionGroup": {
"collapsed": false,
"depth": 0,
"range": {}
},
"fields": ""
},
"updateDimensionProperties": {
"dataSourceSheetRange": {},
"fields": "",
"properties": {
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
},
"range": {}
},
"updateEmbeddedObjectBorder": {
"border": {},
"fields": "",
"objectId": 0
},
"updateEmbeddedObjectPosition": {
"fields": "",
"newPosition": {},
"objectId": 0
},
"updateFilterView": {
"fields": "",
"filter": {}
},
"updateNamedRange": {
"fields": "",
"namedRange": {}
},
"updateProtectedRange": {
"fields": "",
"protectedRange": {}
},
"updateSheetProperties": {
"fields": "",
"properties": {}
},
"updateSlicerSpec": {
"fields": "",
"slicerId": 0,
"spec": {}
},
"updateSpreadsheetProperties": {
"fields": "",
"properties": {
"autoRecalc": "",
"defaultFormat": {},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
}
}
}
],
"responseIncludeGridData": false,
"responseRanges": []
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "includeSpreadsheetInResponse": false,\n "requests": [\n {\n "addBanding": {\n "bandedRange": {\n "bandedRangeId": 0,\n "columnProperties": {\n "firstBandColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "firstBandColorStyle": {\n "rgbColor": {},\n "themeColor": ""\n },\n "footerColor": {},\n "footerColorStyle": {},\n "headerColor": {},\n "headerColorStyle": {},\n "secondBandColor": {},\n "secondBandColorStyle": {}\n },\n "range": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n },\n "rowProperties": {}\n }\n },\n "addChart": {\n "chart": {\n "border": {\n "color": {},\n "colorStyle": {}\n },\n "chartId": 0,\n "position": {\n "newSheet": false,\n "overlayPosition": {\n "anchorCell": {\n "columnIndex": 0,\n "rowIndex": 0,\n "sheetId": 0\n },\n "heightPixels": 0,\n "offsetXPixels": 0,\n "offsetYPixels": 0,\n "widthPixels": 0\n },\n "sheetId": 0\n },\n "spec": {\n "altText": "",\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "basicChart": {\n "axis": [\n {\n "format": {\n "bold": false,\n "fontFamily": "",\n "fontSize": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "italic": false,\n "link": {\n "uri": ""\n },\n "strikethrough": false,\n "underline": false\n },\n "position": "",\n "title": "",\n "titleTextPosition": {\n "horizontalAlignment": ""\n },\n "viewWindowOptions": {\n "viewWindowMax": "",\n "viewWindowMin": "",\n "viewWindowMode": ""\n }\n }\n ],\n "chartType": "",\n "compareMode": "",\n "domains": [\n {\n "domain": {\n "aggregateType": "",\n "columnReference": {\n "name": ""\n },\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "intervalSize": "",\n "maxValue": "",\n "minValue": ""\n }\n },\n "sourceRange": {\n "sources": [\n {}\n ]\n }\n },\n "reversed": false\n }\n ],\n "headerCount": 0,\n "interpolateNulls": false,\n "legendPosition": "",\n "lineSmoothing": false,\n "series": [\n {\n "color": {},\n "colorStyle": {},\n "dataLabel": {\n "customLabelData": {},\n "placement": "",\n "textFormat": {},\n "type": ""\n },\n "lineStyle": {\n "type": "",\n "width": 0\n },\n "pointStyle": {\n "shape": "",\n "size": ""\n },\n "series": {},\n "styleOverrides": [\n {\n "color": {},\n "colorStyle": {},\n "index": 0,\n "pointStyle": {}\n }\n ],\n "targetAxis": "",\n "type": ""\n }\n ],\n "stackedType": "",\n "threeDimensional": false,\n "totalDataLabel": {}\n },\n "bubbleChart": {\n "bubbleBorderColor": {},\n "bubbleBorderColorStyle": {},\n "bubbleLabels": {},\n "bubbleMaxRadiusSize": 0,\n "bubbleMinRadiusSize": 0,\n "bubbleOpacity": "",\n "bubbleSizes": {},\n "bubbleTextStyle": {},\n "domain": {},\n "groupIds": {},\n "legendPosition": "",\n "series": {}\n },\n "candlestickChart": {\n "data": [\n {\n "closeSeries": {\n "data": {}\n },\n "highSeries": {},\n "lowSeries": {},\n "openSeries": {}\n }\n ],\n "domain": {\n "data": {},\n "reversed": false\n }\n },\n "dataSourceChartProperties": {\n "dataExecutionStatus": {\n "errorCode": "",\n "errorMessage": "",\n "lastRefreshTime": "",\n "state": ""\n },\n "dataSourceId": ""\n },\n "filterSpecs": [\n {\n "columnIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {\n "type": "",\n "values": [\n {\n "relativeDate": "",\n "userEnteredValue": ""\n }\n ]\n },\n "hiddenValues": [],\n "visibleBackgroundColor": {},\n "visibleBackgroundColorStyle": {},\n "visibleForegroundColor": {},\n "visibleForegroundColorStyle": {}\n }\n }\n ],\n "fontName": "",\n "hiddenDimensionStrategy": "",\n "histogramChart": {\n "bucketSize": "",\n "legendPosition": "",\n "outlierPercentile": "",\n "series": [\n {\n "barColor": {},\n "barColorStyle": {},\n "data": {}\n }\n ],\n "showItemDividers": false\n },\n "maximized": false,\n "orgChart": {\n "labels": {},\n "nodeColor": {},\n "nodeColorStyle": {},\n "nodeSize": "",\n "parentLabels": {},\n "selectedNodeColor": {},\n "selectedNodeColorStyle": {},\n "tooltips": {}\n },\n "pieChart": {\n "domain": {},\n "legendPosition": "",\n "pieHole": "",\n "series": {},\n "threeDimensional": false\n },\n "scorecardChart": {\n "aggregateType": "",\n "baselineValueData": {},\n "baselineValueFormat": {\n "comparisonType": "",\n "description": "",\n "negativeColor": {},\n "negativeColorStyle": {},\n "position": {},\n "positiveColor": {},\n "positiveColorStyle": {},\n "textFormat": {}\n },\n "customFormatOptions": {\n "prefix": "",\n "suffix": ""\n },\n "keyValueData": {},\n "keyValueFormat": {\n "position": {},\n "textFormat": {}\n },\n "numberFormatSource": "",\n "scaleFactor": ""\n },\n "sortSpecs": [\n {\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "dataSourceColumnReference": {},\n "dimensionIndex": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "sortOrder": ""\n }\n ],\n "subtitle": "",\n "subtitleTextFormat": {},\n "subtitleTextPosition": {},\n "title": "",\n "titleTextFormat": {},\n "titleTextPosition": {},\n "treemapChart": {\n "colorData": {},\n "colorScale": {\n "maxValueColor": {},\n "maxValueColorStyle": {},\n "midValueColor": {},\n "midValueColorStyle": {},\n "minValueColor": {},\n "minValueColorStyle": {},\n "noDataColor": {},\n "noDataColorStyle": {}\n },\n "headerColor": {},\n "headerColorStyle": {},\n "hideTooltips": false,\n "hintedLevels": 0,\n "labels": {},\n "levels": 0,\n "maxValue": "",\n "minValue": "",\n "parentLabels": {},\n "sizeData": {},\n "textFormat": {}\n },\n "waterfallChart": {\n "connectorLineStyle": {},\n "domain": {\n "data": {},\n "reversed": false\n },\n "firstValueIsTotal": false,\n "hideConnectorLines": false,\n "series": [\n {\n "customSubtotals": [\n {\n "dataIsSubtotal": false,\n "label": "",\n "subtotalIndex": 0\n }\n ],\n "data": {},\n "dataLabel": {},\n "hideTrailingSubtotal": false,\n "negativeColumnsStyle": {\n "color": {},\n "colorStyle": {},\n "label": ""\n },\n "positiveColumnsStyle": {},\n "subtotalColumnsStyle": {}\n }\n ],\n "stackedType": "",\n "totalDataLabel": {}\n }\n }\n }\n },\n "addConditionalFormatRule": {\n "index": 0,\n "rule": {\n "booleanRule": {\n "condition": {},\n "format": {\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "borders": {\n "bottom": {\n "color": {},\n "colorStyle": {},\n "style": "",\n "width": 0\n },\n "left": {},\n "right": {},\n "top": {}\n },\n "horizontalAlignment": "",\n "hyperlinkDisplayType": "",\n "numberFormat": {\n "pattern": "",\n "type": ""\n },\n "padding": {\n "bottom": 0,\n "left": 0,\n "right": 0,\n "top": 0\n },\n "textDirection": "",\n "textFormat": {},\n "textRotation": {\n "angle": 0,\n "vertical": false\n },\n "verticalAlignment": "",\n "wrapStrategy": ""\n }\n },\n "gradientRule": {\n "maxpoint": {\n "color": {},\n "colorStyle": {},\n "type": "",\n "value": ""\n },\n "midpoint": {},\n "minpoint": {}\n },\n "ranges": [\n {}\n ]\n }\n },\n "addDataSource": {\n "dataSource": {\n "calculatedColumns": [\n {\n "formula": "",\n "reference": {}\n }\n ],\n "dataSourceId": "",\n "sheetId": 0,\n "spec": {\n "bigQuery": {\n "projectId": "",\n "querySpec": {\n "rawQuery": ""\n },\n "tableSpec": {\n "datasetId": "",\n "tableId": "",\n "tableProjectId": ""\n }\n },\n "parameters": [\n {\n "name": "",\n "namedRangeId": "",\n "range": {}\n }\n ]\n }\n }\n },\n "addDimensionGroup": {\n "range": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n }\n },\n "addFilterView": {\n "filter": {\n "criteria": {},\n "filterSpecs": [\n {}\n ],\n "filterViewId": 0,\n "namedRangeId": "",\n "range": {},\n "sortSpecs": [\n {}\n ],\n "title": ""\n }\n },\n "addNamedRange": {\n "namedRange": {\n "name": "",\n "namedRangeId": "",\n "range": {}\n }\n },\n "addProtectedRange": {\n "protectedRange": {\n "description": "",\n "editors": {\n "domainUsersCanEdit": false,\n "groups": [],\n "users": []\n },\n "namedRangeId": "",\n "protectedRangeId": 0,\n "range": {},\n "requestingUserCanEdit": false,\n "unprotectedRanges": [\n {}\n ],\n "warningOnly": false\n }\n },\n "addSheet": {\n "properties": {\n "dataSourceSheetProperties": {\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "gridProperties": {\n "columnCount": 0,\n "columnGroupControlAfter": false,\n "frozenColumnCount": 0,\n "frozenRowCount": 0,\n "hideGridlines": false,\n "rowCount": 0,\n "rowGroupControlAfter": false\n },\n "hidden": false,\n "index": 0,\n "rightToLeft": false,\n "sheetId": 0,\n "sheetType": "",\n "tabColor": {},\n "tabColorStyle": {},\n "title": ""\n }\n },\n "addSlicer": {\n "slicer": {\n "position": {},\n "slicerId": 0,\n "spec": {\n "applyToPivotTables": false,\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "columnIndex": 0,\n "dataRange": {},\n "filterCriteria": {},\n "horizontalAlignment": "",\n "textFormat": {},\n "title": ""\n }\n }\n },\n "appendCells": {\n "fields": "",\n "rows": [\n {\n "values": [\n {\n "dataSourceFormula": {\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "dataSourceTable": {\n "columnSelectionType": "",\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {}\n ],\n "rowLimit": 0,\n "sortSpecs": [\n {}\n ]\n },\n "dataValidation": {\n "condition": {},\n "inputMessage": "",\n "showCustomUi": false,\n "strict": false\n },\n "effectiveFormat": {},\n "effectiveValue": {\n "boolValue": false,\n "errorValue": {\n "message": "",\n "type": ""\n },\n "formulaValue": "",\n "numberValue": "",\n "stringValue": ""\n },\n "formattedValue": "",\n "hyperlink": "",\n "note": "",\n "pivotTable": {\n "columns": [\n {\n "dataSourceColumnReference": {},\n "groupLimit": {\n "applyOrder": 0,\n "countLimit": 0\n },\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "end": "",\n "interval": "",\n "start": ""\n },\n "manualRule": {\n "groups": [\n {\n "groupName": {},\n "items": [\n {}\n ]\n }\n ]\n }\n },\n "label": "",\n "repeatHeadings": false,\n "showTotals": false,\n "sortOrder": "",\n "sourceColumnOffset": 0,\n "valueBucket": {\n "buckets": [\n {}\n ],\n "valuesIndex": 0\n },\n "valueMetadata": [\n {\n "collapsed": false,\n "value": {}\n }\n ]\n }\n ],\n "criteria": {},\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {\n "columnOffsetIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {},\n "visibleByDefault": false,\n "visibleValues": []\n }\n }\n ],\n "rows": [\n {}\n ],\n "source": {},\n "valueLayout": "",\n "values": [\n {\n "calculatedDisplayType": "",\n "dataSourceColumnReference": {},\n "formula": "",\n "name": "",\n "sourceColumnOffset": 0,\n "summarizeFunction": ""\n }\n ]\n },\n "textFormatRuns": [\n {\n "format": {},\n "startIndex": 0\n }\n ],\n "userEnteredFormat": {},\n "userEnteredValue": {}\n }\n ]\n }\n ],\n "sheetId": 0\n },\n "appendDimension": {\n "dimension": "",\n "length": 0,\n "sheetId": 0\n },\n "autoFill": {\n "range": {},\n "sourceAndDestination": {\n "dimension": "",\n "fillLength": 0,\n "source": {}\n },\n "useAlternateSeries": false\n },\n "autoResizeDimensions": {\n "dataSourceSheetDimensions": {\n "columnReferences": [\n {}\n ],\n "sheetId": 0\n },\n "dimensions": {}\n },\n "clearBasicFilter": {\n "sheetId": 0\n },\n "copyPaste": {\n "destination": {},\n "pasteOrientation": "",\n "pasteType": "",\n "source": {}\n },\n "createDeveloperMetadata": {\n "developerMetadata": {\n "location": {\n "dimensionRange": {},\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataId": 0,\n "metadataKey": "",\n "metadataValue": "",\n "visibility": ""\n }\n },\n "cutPaste": {\n "destination": {},\n "pasteType": "",\n "source": {}\n },\n "deleteBanding": {\n "bandedRangeId": 0\n },\n "deleteConditionalFormatRule": {\n "index": 0,\n "sheetId": 0\n },\n "deleteDataSource": {\n "dataSourceId": ""\n },\n "deleteDeveloperMetadata": {\n "dataFilter": {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {},\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {}\n }\n },\n "deleteDimension": {\n "range": {}\n },\n "deleteDimensionGroup": {\n "range": {}\n },\n "deleteDuplicates": {\n "comparisonColumns": [\n {}\n ],\n "range": {}\n },\n "deleteEmbeddedObject": {\n "objectId": 0\n },\n "deleteFilterView": {\n "filterId": 0\n },\n "deleteNamedRange": {\n "namedRangeId": ""\n },\n "deleteProtectedRange": {\n "protectedRangeId": 0\n },\n "deleteRange": {\n "range": {},\n "shiftDimension": ""\n },\n "deleteSheet": {\n "sheetId": 0\n },\n "duplicateFilterView": {\n "filterId": 0\n },\n "duplicateSheet": {\n "insertSheetIndex": 0,\n "newSheetId": 0,\n "newSheetName": "",\n "sourceSheetId": 0\n },\n "findReplace": {\n "allSheets": false,\n "find": "",\n "includeFormulas": false,\n "matchCase": false,\n "matchEntireCell": false,\n "range": {},\n "replacement": "",\n "searchByRegex": false,\n "sheetId": 0\n },\n "insertDimension": {\n "inheritFromBefore": false,\n "range": {}\n },\n "insertRange": {\n "range": {},\n "shiftDimension": ""\n },\n "mergeCells": {\n "mergeType": "",\n "range": {}\n },\n "moveDimension": {\n "destinationIndex": 0,\n "source": {}\n },\n "pasteData": {\n "coordinate": {},\n "data": "",\n "delimiter": "",\n "html": false,\n "type": ""\n },\n "randomizeRange": {\n "range": {}\n },\n "refreshDataSource": {\n "dataSourceId": "",\n "force": false,\n "isAll": false,\n "references": {\n "references": [\n {\n "chartId": 0,\n "dataSourceFormulaCell": {},\n "dataSourcePivotTableAnchorCell": {},\n "dataSourceTableAnchorCell": {},\n "sheetId": ""\n }\n ]\n }\n },\n "repeatCell": {\n "cell": {},\n "fields": "",\n "range": {}\n },\n "setBasicFilter": {\n "filter": {\n "criteria": {},\n "filterSpecs": [\n {}\n ],\n "range": {},\n "sortSpecs": [\n {}\n ]\n }\n },\n "setDataValidation": {\n "range": {},\n "rule": {}\n },\n "sortRange": {\n "range": {},\n "sortSpecs": [\n {}\n ]\n },\n "textToColumns": {\n "delimiter": "",\n "delimiterType": "",\n "source": {}\n },\n "trimWhitespace": {\n "range": {}\n },\n "unmergeCells": {\n "range": {}\n },\n "updateBanding": {\n "bandedRange": {},\n "fields": ""\n },\n "updateBorders": {\n "bottom": {},\n "innerHorizontal": {},\n "innerVertical": {},\n "left": {},\n "range": {},\n "right": {},\n "top": {}\n },\n "updateCells": {\n "fields": "",\n "range": {},\n "rows": [\n {}\n ],\n "start": {}\n },\n "updateChartSpec": {\n "chartId": 0,\n "spec": {}\n },\n "updateConditionalFormatRule": {\n "index": 0,\n "newIndex": 0,\n "rule": {},\n "sheetId": 0\n },\n "updateDataSource": {\n "dataSource": {},\n "fields": ""\n },\n "updateDeveloperMetadata": {\n "dataFilters": [\n {}\n ],\n "developerMetadata": {},\n "fields": ""\n },\n "updateDimensionGroup": {\n "dimensionGroup": {\n "collapsed": false,\n "depth": 0,\n "range": {}\n },\n "fields": ""\n },\n "updateDimensionProperties": {\n "dataSourceSheetRange": {},\n "fields": "",\n "properties": {\n "dataSourceColumnReference": {},\n "developerMetadata": [\n {}\n ],\n "hiddenByFilter": false,\n "hiddenByUser": false,\n "pixelSize": 0\n },\n "range": {}\n },\n "updateEmbeddedObjectBorder": {\n "border": {},\n "fields": "",\n "objectId": 0\n },\n "updateEmbeddedObjectPosition": {\n "fields": "",\n "newPosition": {},\n "objectId": 0\n },\n "updateFilterView": {\n "fields": "",\n "filter": {}\n },\n "updateNamedRange": {\n "fields": "",\n "namedRange": {}\n },\n "updateProtectedRange": {\n "fields": "",\n "protectedRange": {}\n },\n "updateSheetProperties": {\n "fields": "",\n "properties": {}\n },\n "updateSlicerSpec": {\n "fields": "",\n "slicerId": 0,\n "spec": {}\n },\n "updateSpreadsheetProperties": {\n "fields": "",\n "properties": {\n "autoRecalc": "",\n "defaultFormat": {},\n "iterativeCalculationSettings": {\n "convergenceThreshold": "",\n "maxIterations": 0\n },\n "locale": "",\n "spreadsheetTheme": {\n "primaryFontFamily": "",\n "themeColors": [\n {\n "color": {},\n "colorType": ""\n }\n ]\n },\n "timeZone": "",\n "title": ""\n }\n }\n }\n ],\n "responseIncludeGridData": false,\n "responseRanges": []\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"includeSpreadsheetInResponse": false,
"requests": [
[
"addBanding": ["bandedRange": [
"bandedRangeId": 0,
"columnProperties": [
"firstBandColor": [
"alpha": "",
"blue": "",
"green": "",
"red": ""
],
"firstBandColorStyle": [
"rgbColor": [],
"themeColor": ""
],
"footerColor": [],
"footerColorStyle": [],
"headerColor": [],
"headerColorStyle": [],
"secondBandColor": [],
"secondBandColorStyle": []
],
"range": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
],
"rowProperties": []
]],
"addChart": ["chart": [
"border": [
"color": [],
"colorStyle": []
],
"chartId": 0,
"position": [
"newSheet": false,
"overlayPosition": [
"anchorCell": [
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
],
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
],
"sheetId": 0
],
"spec": [
"altText": "",
"backgroundColor": [],
"backgroundColorStyle": [],
"basicChart": [
"axis": [
[
"format": [
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": [],
"foregroundColorStyle": [],
"italic": false,
"link": ["uri": ""],
"strikethrough": false,
"underline": false
],
"position": "",
"title": "",
"titleTextPosition": ["horizontalAlignment": ""],
"viewWindowOptions": [
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
]
]
],
"chartType": "",
"compareMode": "",
"domains": [
[
"domain": [
"aggregateType": "",
"columnReference": ["name": ""],
"groupRule": [
"dateTimeRule": ["type": ""],
"histogramRule": [
"intervalSize": "",
"maxValue": "",
"minValue": ""
]
],
"sourceRange": ["sources": [[]]]
],
"reversed": false
]
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
[
"color": [],
"colorStyle": [],
"dataLabel": [
"customLabelData": [],
"placement": "",
"textFormat": [],
"type": ""
],
"lineStyle": [
"type": "",
"width": 0
],
"pointStyle": [
"shape": "",
"size": ""
],
"series": [],
"styleOverrides": [
[
"color": [],
"colorStyle": [],
"index": 0,
"pointStyle": []
]
],
"targetAxis": "",
"type": ""
]
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": []
],
"bubbleChart": [
"bubbleBorderColor": [],
"bubbleBorderColorStyle": [],
"bubbleLabels": [],
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": [],
"bubbleTextStyle": [],
"domain": [],
"groupIds": [],
"legendPosition": "",
"series": []
],
"candlestickChart": [
"data": [
[
"closeSeries": ["data": []],
"highSeries": [],
"lowSeries": [],
"openSeries": []
]
],
"domain": [
"data": [],
"reversed": false
]
],
"dataSourceChartProperties": [
"dataExecutionStatus": [
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
],
"dataSourceId": ""
],
"filterSpecs": [
[
"columnIndex": 0,
"dataSourceColumnReference": [],
"filterCriteria": [
"condition": [
"type": "",
"values": [
[
"relativeDate": "",
"userEnteredValue": ""
]
]
],
"hiddenValues": [],
"visibleBackgroundColor": [],
"visibleBackgroundColorStyle": [],
"visibleForegroundColor": [],
"visibleForegroundColorStyle": []
]
]
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": [
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
[
"barColor": [],
"barColorStyle": [],
"data": []
]
],
"showItemDividers": false
],
"maximized": false,
"orgChart": [
"labels": [],
"nodeColor": [],
"nodeColorStyle": [],
"nodeSize": "",
"parentLabels": [],
"selectedNodeColor": [],
"selectedNodeColorStyle": [],
"tooltips": []
],
"pieChart": [
"domain": [],
"legendPosition": "",
"pieHole": "",
"series": [],
"threeDimensional": false
],
"scorecardChart": [
"aggregateType": "",
"baselineValueData": [],
"baselineValueFormat": [
"comparisonType": "",
"description": "",
"negativeColor": [],
"negativeColorStyle": [],
"position": [],
"positiveColor": [],
"positiveColorStyle": [],
"textFormat": []
],
"customFormatOptions": [
"prefix": "",
"suffix": ""
],
"keyValueData": [],
"keyValueFormat": [
"position": [],
"textFormat": []
],
"numberFormatSource": "",
"scaleFactor": ""
],
"sortSpecs": [
[
"backgroundColor": [],
"backgroundColorStyle": [],
"dataSourceColumnReference": [],
"dimensionIndex": 0,
"foregroundColor": [],
"foregroundColorStyle": [],
"sortOrder": ""
]
],
"subtitle": "",
"subtitleTextFormat": [],
"subtitleTextPosition": [],
"title": "",
"titleTextFormat": [],
"titleTextPosition": [],
"treemapChart": [
"colorData": [],
"colorScale": [
"maxValueColor": [],
"maxValueColorStyle": [],
"midValueColor": [],
"midValueColorStyle": [],
"minValueColor": [],
"minValueColorStyle": [],
"noDataColor": [],
"noDataColorStyle": []
],
"headerColor": [],
"headerColorStyle": [],
"hideTooltips": false,
"hintedLevels": 0,
"labels": [],
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": [],
"sizeData": [],
"textFormat": []
],
"waterfallChart": [
"connectorLineStyle": [],
"domain": [
"data": [],
"reversed": false
],
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
[
"customSubtotals": [
[
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
]
],
"data": [],
"dataLabel": [],
"hideTrailingSubtotal": false,
"negativeColumnsStyle": [
"color": [],
"colorStyle": [],
"label": ""
],
"positiveColumnsStyle": [],
"subtotalColumnsStyle": []
]
],
"stackedType": "",
"totalDataLabel": []
]
]
]],
"addConditionalFormatRule": [
"index": 0,
"rule": [
"booleanRule": [
"condition": [],
"format": [
"backgroundColor": [],
"backgroundColorStyle": [],
"borders": [
"bottom": [
"color": [],
"colorStyle": [],
"style": "",
"width": 0
],
"left": [],
"right": [],
"top": []
],
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": [
"pattern": "",
"type": ""
],
"padding": [
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
],
"textDirection": "",
"textFormat": [],
"textRotation": [
"angle": 0,
"vertical": false
],
"verticalAlignment": "",
"wrapStrategy": ""
]
],
"gradientRule": [
"maxpoint": [
"color": [],
"colorStyle": [],
"type": "",
"value": ""
],
"midpoint": [],
"minpoint": []
],
"ranges": [[]]
]
],
"addDataSource": ["dataSource": [
"calculatedColumns": [
[
"formula": "",
"reference": []
]
],
"dataSourceId": "",
"sheetId": 0,
"spec": [
"bigQuery": [
"projectId": "",
"querySpec": ["rawQuery": ""],
"tableSpec": [
"datasetId": "",
"tableId": "",
"tableProjectId": ""
]
],
"parameters": [
[
"name": "",
"namedRangeId": "",
"range": []
]
]
]
]],
"addDimensionGroup": ["range": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
]],
"addFilterView": ["filter": [
"criteria": [],
"filterSpecs": [[]],
"filterViewId": 0,
"namedRangeId": "",
"range": [],
"sortSpecs": [[]],
"title": ""
]],
"addNamedRange": ["namedRange": [
"name": "",
"namedRangeId": "",
"range": []
]],
"addProtectedRange": ["protectedRange": [
"description": "",
"editors": [
"domainUsersCanEdit": false,
"groups": [],
"users": []
],
"namedRangeId": "",
"protectedRangeId": 0,
"range": [],
"requestingUserCanEdit": false,
"unprotectedRanges": [[]],
"warningOnly": false
]],
"addSheet": ["properties": [
"dataSourceSheetProperties": [
"columns": [[]],
"dataExecutionStatus": [],
"dataSourceId": ""
],
"gridProperties": [
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
],
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": [],
"tabColorStyle": [],
"title": ""
]],
"addSlicer": ["slicer": [
"position": [],
"slicerId": 0,
"spec": [
"applyToPivotTables": false,
"backgroundColor": [],
"backgroundColorStyle": [],
"columnIndex": 0,
"dataRange": [],
"filterCriteria": [],
"horizontalAlignment": "",
"textFormat": [],
"title": ""
]
]],
"appendCells": [
"fields": "",
"rows": [["values": [
[
"dataSourceFormula": [
"dataExecutionStatus": [],
"dataSourceId": ""
],
"dataSourceTable": [
"columnSelectionType": "",
"columns": [[]],
"dataExecutionStatus": [],
"dataSourceId": "",
"filterSpecs": [[]],
"rowLimit": 0,
"sortSpecs": [[]]
],
"dataValidation": [
"condition": [],
"inputMessage": "",
"showCustomUi": false,
"strict": false
],
"effectiveFormat": [],
"effectiveValue": [
"boolValue": false,
"errorValue": [
"message": "",
"type": ""
],
"formulaValue": "",
"numberValue": "",
"stringValue": ""
],
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": [
"columns": [
[
"dataSourceColumnReference": [],
"groupLimit": [
"applyOrder": 0,
"countLimit": 0
],
"groupRule": [
"dateTimeRule": ["type": ""],
"histogramRule": [
"end": "",
"interval": "",
"start": ""
],
"manualRule": ["groups": [
[
"groupName": [],
"items": [[]]
]
]]
],
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": [
"buckets": [[]],
"valuesIndex": 0
],
"valueMetadata": [
[
"collapsed": false,
"value": []
]
]
]
],
"criteria": [],
"dataExecutionStatus": [],
"dataSourceId": "",
"filterSpecs": [
[
"columnOffsetIndex": 0,
"dataSourceColumnReference": [],
"filterCriteria": [
"condition": [],
"visibleByDefault": false,
"visibleValues": []
]
]
],
"rows": [[]],
"source": [],
"valueLayout": "",
"values": [
[
"calculatedDisplayType": "",
"dataSourceColumnReference": [],
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
]
]
],
"textFormatRuns": [
[
"format": [],
"startIndex": 0
]
],
"userEnteredFormat": [],
"userEnteredValue": []
]
]]],
"sheetId": 0
],
"appendDimension": [
"dimension": "",
"length": 0,
"sheetId": 0
],
"autoFill": [
"range": [],
"sourceAndDestination": [
"dimension": "",
"fillLength": 0,
"source": []
],
"useAlternateSeries": false
],
"autoResizeDimensions": [
"dataSourceSheetDimensions": [
"columnReferences": [[]],
"sheetId": 0
],
"dimensions": []
],
"clearBasicFilter": ["sheetId": 0],
"copyPaste": [
"destination": [],
"pasteOrientation": "",
"pasteType": "",
"source": []
],
"createDeveloperMetadata": ["developerMetadata": [
"location": [
"dimensionRange": [],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
]],
"cutPaste": [
"destination": [],
"pasteType": "",
"source": []
],
"deleteBanding": ["bandedRangeId": 0],
"deleteConditionalFormatRule": [
"index": 0,
"sheetId": 0
],
"deleteDataSource": ["dataSourceId": ""],
"deleteDeveloperMetadata": ["dataFilter": [
"a1Range": "",
"developerMetadataLookup": [
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": [],
"metadataValue": "",
"visibility": ""
],
"gridRange": []
]],
"deleteDimension": ["range": []],
"deleteDimensionGroup": ["range": []],
"deleteDuplicates": [
"comparisonColumns": [[]],
"range": []
],
"deleteEmbeddedObject": ["objectId": 0],
"deleteFilterView": ["filterId": 0],
"deleteNamedRange": ["namedRangeId": ""],
"deleteProtectedRange": ["protectedRangeId": 0],
"deleteRange": [
"range": [],
"shiftDimension": ""
],
"deleteSheet": ["sheetId": 0],
"duplicateFilterView": ["filterId": 0],
"duplicateSheet": [
"insertSheetIndex": 0,
"newSheetId": 0,
"newSheetName": "",
"sourceSheetId": 0
],
"findReplace": [
"allSheets": false,
"find": "",
"includeFormulas": false,
"matchCase": false,
"matchEntireCell": false,
"range": [],
"replacement": "",
"searchByRegex": false,
"sheetId": 0
],
"insertDimension": [
"inheritFromBefore": false,
"range": []
],
"insertRange": [
"range": [],
"shiftDimension": ""
],
"mergeCells": [
"mergeType": "",
"range": []
],
"moveDimension": [
"destinationIndex": 0,
"source": []
],
"pasteData": [
"coordinate": [],
"data": "",
"delimiter": "",
"html": false,
"type": ""
],
"randomizeRange": ["range": []],
"refreshDataSource": [
"dataSourceId": "",
"force": false,
"isAll": false,
"references": ["references": [
[
"chartId": 0,
"dataSourceFormulaCell": [],
"dataSourcePivotTableAnchorCell": [],
"dataSourceTableAnchorCell": [],
"sheetId": ""
]
]]
],
"repeatCell": [
"cell": [],
"fields": "",
"range": []
],
"setBasicFilter": ["filter": [
"criteria": [],
"filterSpecs": [[]],
"range": [],
"sortSpecs": [[]]
]],
"setDataValidation": [
"range": [],
"rule": []
],
"sortRange": [
"range": [],
"sortSpecs": [[]]
],
"textToColumns": [
"delimiter": "",
"delimiterType": "",
"source": []
],
"trimWhitespace": ["range": []],
"unmergeCells": ["range": []],
"updateBanding": [
"bandedRange": [],
"fields": ""
],
"updateBorders": [
"bottom": [],
"innerHorizontal": [],
"innerVertical": [],
"left": [],
"range": [],
"right": [],
"top": []
],
"updateCells": [
"fields": "",
"range": [],
"rows": [[]],
"start": []
],
"updateChartSpec": [
"chartId": 0,
"spec": []
],
"updateConditionalFormatRule": [
"index": 0,
"newIndex": 0,
"rule": [],
"sheetId": 0
],
"updateDataSource": [
"dataSource": [],
"fields": ""
],
"updateDeveloperMetadata": [
"dataFilters": [[]],
"developerMetadata": [],
"fields": ""
],
"updateDimensionGroup": [
"dimensionGroup": [
"collapsed": false,
"depth": 0,
"range": []
],
"fields": ""
],
"updateDimensionProperties": [
"dataSourceSheetRange": [],
"fields": "",
"properties": [
"dataSourceColumnReference": [],
"developerMetadata": [[]],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
],
"range": []
],
"updateEmbeddedObjectBorder": [
"border": [],
"fields": "",
"objectId": 0
],
"updateEmbeddedObjectPosition": [
"fields": "",
"newPosition": [],
"objectId": 0
],
"updateFilterView": [
"fields": "",
"filter": []
],
"updateNamedRange": [
"fields": "",
"namedRange": []
],
"updateProtectedRange": [
"fields": "",
"protectedRange": []
],
"updateSheetProperties": [
"fields": "",
"properties": []
],
"updateSlicerSpec": [
"fields": "",
"slicerId": 0,
"spec": []
],
"updateSpreadsheetProperties": [
"fields": "",
"properties": [
"autoRecalc": "",
"defaultFormat": [],
"iterativeCalculationSettings": [
"convergenceThreshold": "",
"maxIterations": 0
],
"locale": "",
"spreadsheetTheme": [
"primaryFontFamily": "",
"themeColors": [
[
"color": [],
"colorType": ""
]
]
],
"timeZone": "",
"title": ""
]
]
]
],
"responseIncludeGridData": false,
"responseRanges": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:batchUpdate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.create
{{baseUrl}}/v4/spreadsheets
BODY json
{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets" {:content-type :json
:form-params {:dataSourceSchedules [{:dailySchedule {:startTime {:hours 0
:minutes 0
:nanos 0
:seconds 0}}
:enabled false
:monthlySchedule {:daysOfMonth []
:startTime {}}
:nextRun {:endTime ""
:startTime ""}
:refreshScope ""
:weeklySchedule {:daysOfWeek []
:startTime {}}}]
:dataSources [{:calculatedColumns [{:formula ""
:reference {:name ""}}]
:dataSourceId ""
:sheetId 0
:spec {:bigQuery {:projectId ""
:querySpec {:rawQuery ""}
:tableSpec {:datasetId ""
:tableId ""
:tableProjectId ""}}
:parameters [{:name ""
:namedRangeId ""
:range {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}}]}}]
:developerMetadata [{:location {:dimensionRange {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataId 0
:metadataKey ""
:metadataValue ""
:visibility ""}]
:namedRanges [{:name ""
:namedRangeId ""
:range {}}]
:properties {:autoRecalc ""
:defaultFormat {:backgroundColor {:alpha ""
:blue ""
:green ""
:red ""}
:backgroundColorStyle {:rgbColor {}
:themeColor ""}
:borders {:bottom {:color {}
:colorStyle {}
:style ""
:width 0}
:left {}
:right {}
:top {}}
:horizontalAlignment ""
:hyperlinkDisplayType ""
:numberFormat {:pattern ""
:type ""}
:padding {:bottom 0
:left 0
:right 0
:top 0}
:textDirection ""
:textFormat {:bold false
:fontFamily ""
:fontSize 0
:foregroundColor {}
:foregroundColorStyle {}
:italic false
:link {:uri ""}
:strikethrough false
:underline false}
:textRotation {:angle 0
:vertical false}
:verticalAlignment ""
:wrapStrategy ""}
:iterativeCalculationSettings {:convergenceThreshold ""
:maxIterations 0}
:locale ""
:spreadsheetTheme {:primaryFontFamily ""
:themeColors [{:color {}
:colorType ""}]}
:timeZone ""
:title ""}
:sheets [{:bandedRanges [{:bandedRangeId 0
:columnProperties {:firstBandColor {}
:firstBandColorStyle {}
:footerColor {}
:footerColorStyle {}
:headerColor {}
:headerColorStyle {}
:secondBandColor {}
:secondBandColorStyle {}}
:range {}
:rowProperties {}}]
:basicFilter {:criteria {}
:filterSpecs [{:columnIndex 0
:dataSourceColumnReference {}
:filterCriteria {:condition {:type ""
:values [{:relativeDate ""
:userEnteredValue ""}]}
:hiddenValues []
:visibleBackgroundColor {}
:visibleBackgroundColorStyle {}
:visibleForegroundColor {}
:visibleForegroundColorStyle {}}}]
:range {}
:sortSpecs [{:backgroundColor {}
:backgroundColorStyle {}
:dataSourceColumnReference {}
:dimensionIndex 0
:foregroundColor {}
:foregroundColorStyle {}
:sortOrder ""}]}
:charts [{:border {:color {}
:colorStyle {}}
:chartId 0
:position {:newSheet false
:overlayPosition {:anchorCell {:columnIndex 0
:rowIndex 0
:sheetId 0}
:heightPixels 0
:offsetXPixels 0
:offsetYPixels 0
:widthPixels 0}
:sheetId 0}
:spec {:altText ""
:backgroundColor {}
:backgroundColorStyle {}
:basicChart {:axis [{:format {}
:position ""
:title ""
:titleTextPosition {:horizontalAlignment ""}
:viewWindowOptions {:viewWindowMax ""
:viewWindowMin ""
:viewWindowMode ""}}]
:chartType ""
:compareMode ""
:domains [{:domain {:aggregateType ""
:columnReference {}
:groupRule {:dateTimeRule {:type ""}
:histogramRule {:intervalSize ""
:maxValue ""
:minValue ""}}
:sourceRange {:sources [{}]}}
:reversed false}]
:headerCount 0
:interpolateNulls false
:legendPosition ""
:lineSmoothing false
:series [{:color {}
:colorStyle {}
:dataLabel {:customLabelData {}
:placement ""
:textFormat {}
:type ""}
:lineStyle {:type ""
:width 0}
:pointStyle {:shape ""
:size ""}
:series {}
:styleOverrides [{:color {}
:colorStyle {}
:index 0
:pointStyle {}}]
:targetAxis ""
:type ""}]
:stackedType ""
:threeDimensional false
:totalDataLabel {}}
:bubbleChart {:bubbleBorderColor {}
:bubbleBorderColorStyle {}
:bubbleLabels {}
:bubbleMaxRadiusSize 0
:bubbleMinRadiusSize 0
:bubbleOpacity ""
:bubbleSizes {}
:bubbleTextStyle {}
:domain {}
:groupIds {}
:legendPosition ""
:series {}}
:candlestickChart {:data [{:closeSeries {:data {}}
:highSeries {}
:lowSeries {}
:openSeries {}}]
:domain {:data {}
:reversed false}}
:dataSourceChartProperties {:dataExecutionStatus {:errorCode ""
:errorMessage ""
:lastRefreshTime ""
:state ""}
:dataSourceId ""}
:filterSpecs [{}]
:fontName ""
:hiddenDimensionStrategy ""
:histogramChart {:bucketSize ""
:legendPosition ""
:outlierPercentile ""
:series [{:barColor {}
:barColorStyle {}
:data {}}]
:showItemDividers false}
:maximized false
:orgChart {:labels {}
:nodeColor {}
:nodeColorStyle {}
:nodeSize ""
:parentLabels {}
:selectedNodeColor {}
:selectedNodeColorStyle {}
:tooltips {}}
:pieChart {:domain {}
:legendPosition ""
:pieHole ""
:series {}
:threeDimensional false}
:scorecardChart {:aggregateType ""
:baselineValueData {}
:baselineValueFormat {:comparisonType ""
:description ""
:negativeColor {}
:negativeColorStyle {}
:position {}
:positiveColor {}
:positiveColorStyle {}
:textFormat {}}
:customFormatOptions {:prefix ""
:suffix ""}
:keyValueData {}
:keyValueFormat {:position {}
:textFormat {}}
:numberFormatSource ""
:scaleFactor ""}
:sortSpecs [{}]
:subtitle ""
:subtitleTextFormat {}
:subtitleTextPosition {}
:title ""
:titleTextFormat {}
:titleTextPosition {}
:treemapChart {:colorData {}
:colorScale {:maxValueColor {}
:maxValueColorStyle {}
:midValueColor {}
:midValueColorStyle {}
:minValueColor {}
:minValueColorStyle {}
:noDataColor {}
:noDataColorStyle {}}
:headerColor {}
:headerColorStyle {}
:hideTooltips false
:hintedLevels 0
:labels {}
:levels 0
:maxValue ""
:minValue ""
:parentLabels {}
:sizeData {}
:textFormat {}}
:waterfallChart {:connectorLineStyle {}
:domain {:data {}
:reversed false}
:firstValueIsTotal false
:hideConnectorLines false
:series [{:customSubtotals [{:dataIsSubtotal false
:label ""
:subtotalIndex 0}]
:data {}
:dataLabel {}
:hideTrailingSubtotal false
:negativeColumnsStyle {:color {}
:colorStyle {}
:label ""}
:positiveColumnsStyle {}
:subtotalColumnsStyle {}}]
:stackedType ""
:totalDataLabel {}}}}]
:columnGroups [{:collapsed false
:depth 0
:range {}}]
:conditionalFormats [{:booleanRule {:condition {}
:format {}}
:gradientRule {:maxpoint {:color {}
:colorStyle {}
:type ""
:value ""}
:midpoint {}
:minpoint {}}
:ranges [{}]}]
:data [{:columnMetadata [{:dataSourceColumnReference {}
:developerMetadata [{}]
:hiddenByFilter false
:hiddenByUser false
:pixelSize 0}]
:rowData [{:values [{:dataSourceFormula {:dataExecutionStatus {}
:dataSourceId ""}
:dataSourceTable {:columnSelectionType ""
:columns [{}]
:dataExecutionStatus {}
:dataSourceId ""
:filterSpecs [{}]
:rowLimit 0
:sortSpecs [{}]}
:dataValidation {:condition {}
:inputMessage ""
:showCustomUi false
:strict false}
:effectiveFormat {}
:effectiveValue {:boolValue false
:errorValue {:message ""
:type ""}
:formulaValue ""
:numberValue ""
:stringValue ""}
:formattedValue ""
:hyperlink ""
:note ""
:pivotTable {:columns [{:dataSourceColumnReference {}
:groupLimit {:applyOrder 0
:countLimit 0}
:groupRule {:dateTimeRule {:type ""}
:histogramRule {:end ""
:interval ""
:start ""}
:manualRule {:groups [{:groupName {}
:items [{}]}]}}
:label ""
:repeatHeadings false
:showTotals false
:sortOrder ""
:sourceColumnOffset 0
:valueBucket {:buckets [{}]
:valuesIndex 0}
:valueMetadata [{:collapsed false
:value {}}]}]
:criteria {}
:dataExecutionStatus {}
:dataSourceId ""
:filterSpecs [{:columnOffsetIndex 0
:dataSourceColumnReference {}
:filterCriteria {:condition {}
:visibleByDefault false
:visibleValues []}}]
:rows [{}]
:source {}
:valueLayout ""
:values [{:calculatedDisplayType ""
:dataSourceColumnReference {}
:formula ""
:name ""
:sourceColumnOffset 0
:summarizeFunction ""}]}
:textFormatRuns [{:format {}
:startIndex 0}]
:userEnteredFormat {}
:userEnteredValue {}}]}]
:rowMetadata [{}]
:startColumn 0
:startRow 0}]
:developerMetadata [{}]
:filterViews [{:criteria {}
:filterSpecs [{}]
:filterViewId 0
:namedRangeId ""
:range {}
:sortSpecs [{}]
:title ""}]
:merges [{}]
:properties {:dataSourceSheetProperties {:columns [{}]
:dataExecutionStatus {}
:dataSourceId ""}
:gridProperties {:columnCount 0
:columnGroupControlAfter false
:frozenColumnCount 0
:frozenRowCount 0
:hideGridlines false
:rowCount 0
:rowGroupControlAfter false}
:hidden false
:index 0
:rightToLeft false
:sheetId 0
:sheetType ""
:tabColor {}
:tabColorStyle {}
:title ""}
:protectedRanges [{:description ""
:editors {:domainUsersCanEdit false
:groups []
:users []}
:namedRangeId ""
:protectedRangeId 0
:range {}
:requestingUserCanEdit false
:unprotectedRanges [{}]
:warningOnly false}]
:rowGroups [{}]
:slicers [{:position {}
:slicerId 0
:spec {:applyToPivotTables false
:backgroundColor {}
:backgroundColorStyle {}
:columnIndex 0
:dataRange {}
:filterCriteria {}
:horizontalAlignment ""
:textFormat {}
:title ""}}]}]
:spreadsheetId ""
:spreadsheetUrl ""}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets"),
Content = new StringContent("{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets"
payload := strings.NewReader("{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20768
{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets")
.setHeader("content-type", "application/json")
.setBody("{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets")
.header("content-type", "application/json")
.body("{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
dataSourceSchedules: [
{
dailySchedule: {
startTime: {
hours: 0,
minutes: 0,
nanos: 0,
seconds: 0
}
},
enabled: false,
monthlySchedule: {
daysOfMonth: [],
startTime: {}
},
nextRun: {
endTime: '',
startTime: ''
},
refreshScope: '',
weeklySchedule: {
daysOfWeek: [],
startTime: {}
}
}
],
dataSources: [
{
calculatedColumns: [
{
formula: '',
reference: {
name: ''
}
}
],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {
rawQuery: ''
},
tableSpec: {
datasetId: '',
tableId: '',
tableProjectId: ''
}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
}
],
developerMetadata: [
{
location: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
],
namedRanges: [
{
name: '',
namedRangeId: '',
range: {}
}
],
properties: {
autoRecalc: '',
defaultFormat: {
backgroundColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
backgroundColorStyle: {
rgbColor: {},
themeColor: ''
},
borders: {
bottom: {
color: {},
colorStyle: {},
style: '',
width: 0
},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {
pattern: '',
type: ''
},
padding: {
bottom: 0,
left: 0,
right: 0,
top: 0
},
textDirection: '',
textFormat: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {
uri: ''
},
strikethrough: false,
underline: false
},
textRotation: {
angle: 0,
vertical: false
},
verticalAlignment: '',
wrapStrategy: ''
},
iterativeCalculationSettings: {
convergenceThreshold: '',
maxIterations: 0
},
locale: '',
spreadsheetTheme: {
primaryFontFamily: '',
themeColors: [
{
color: {},
colorType: ''
}
]
},
timeZone: '',
title: ''
},
sheets: [
{
bandedRanges: [
{
bandedRangeId: 0,
columnProperties: {
firstBandColor: {},
firstBandColorStyle: {},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {},
rowProperties: {}
}
],
basicFilter: {
criteria: {},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {
type: '',
values: [
{
relativeDate: '',
userEnteredValue: ''
}
]
},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
range: {},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
]
},
charts: [
{
border: {
color: {},
colorStyle: {}
},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {
columnIndex: 0,
rowIndex: 0,
sheetId: 0
},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {},
position: '',
title: '',
titleTextPosition: {
horizontalAlignment: ''
},
viewWindowOptions: {
viewWindowMax: '',
viewWindowMin: '',
viewWindowMode: ''
}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
intervalSize: '',
maxValue: '',
minValue: ''
}
},
sourceRange: {
sources: [
{}
]
}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {
customLabelData: {},
placement: '',
textFormat: {},
type: ''
},
lineStyle: {
type: '',
width: 0
},
pointStyle: {
shape: '',
size: ''
},
series: {},
styleOverrides: [
{
color: {},
colorStyle: {},
index: 0,
pointStyle: {}
}
],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [
{
closeSeries: {
data: {}
},
highSeries: {},
lowSeries: {},
openSeries: {}
}
],
domain: {
data: {},
reversed: false
}
},
dataSourceChartProperties: {
dataExecutionStatus: {
errorCode: '',
errorMessage: '',
lastRefreshTime: '',
state: ''
},
dataSourceId: ''
},
filterSpecs: [
{}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [
{
barColor: {},
barColorStyle: {},
data: {}
}
],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {
prefix: '',
suffix: ''
},
keyValueData: {},
keyValueFormat: {
position: {},
textFormat: {}
},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {
data: {},
reversed: false
},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [
{
dataIsSubtotal: false,
label: '',
subtotalIndex: 0
}
],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {
color: {},
colorStyle: {},
label: ''
},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
],
columnGroups: [
{
collapsed: false,
depth: 0,
range: {}
}
],
conditionalFormats: [
{
booleanRule: {
condition: {},
format: {}
},
gradientRule: {
maxpoint: {
color: {},
colorStyle: {},
type: '',
value: ''
},
midpoint: {},
minpoint: {}
},
ranges: [
{}
]
}
],
data: [
{
columnMetadata: [
{
dataSourceColumnReference: {},
developerMetadata: [
{}
],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
}
],
rowData: [
{
values: [
{
dataSourceFormula: {
dataExecutionStatus: {},
dataSourceId: ''
},
dataSourceTable: {
columnSelectionType: '',
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{}
],
rowLimit: 0,
sortSpecs: [
{}
]
},
dataValidation: {
condition: {},
inputMessage: '',
showCustomUi: false,
strict: false
},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {
message: '',
type: ''
},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {
applyOrder: 0,
countLimit: 0
},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
end: '',
interval: '',
start: ''
},
manualRule: {
groups: [
{
groupName: {},
items: [
{}
]
}
]
}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {
buckets: [
{}
],
valuesIndex: 0
},
valueMetadata: [
{
collapsed: false,
value: {}
}
]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {},
visibleByDefault: false,
visibleValues: []
}
}
],
rows: [
{}
],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [
{
format: {},
startIndex: 0
}
],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
rowMetadata: [
{}
],
startColumn: 0,
startRow: 0
}
],
developerMetadata: [
{}
],
filterViews: [
{
criteria: {},
filterSpecs: [
{}
],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [
{}
],
title: ''
}
],
merges: [
{}
],
properties: {
dataSourceSheetProperties: {
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: ''
},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
},
protectedRanges: [
{
description: '',
editors: {
domainUsersCanEdit: false,
groups: [],
users: []
},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [
{}
],
warningOnly: false
}
],
rowGroups: [
{}
],
slicers: [
{
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
]
}
],
spreadsheetId: '',
spreadsheetUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets',
headers: {'content-type': 'application/json'},
data: {
dataSourceSchedules: [
{
dailySchedule: {startTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0}},
enabled: false,
monthlySchedule: {daysOfMonth: [], startTime: {}},
nextRun: {endTime: '', startTime: ''},
refreshScope: '',
weeklySchedule: {daysOfWeek: [], startTime: {}}
}
],
dataSources: [
{
calculatedColumns: [{formula: '', reference: {name: ''}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
}
],
developerMetadata: [
{
location: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
],
namedRanges: [{name: '', namedRangeId: '', range: {}}],
properties: {
autoRecalc: '',
defaultFormat: {
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
backgroundColorStyle: {rgbColor: {}, themeColor: ''},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
},
sheets: [
{
bandedRanges: [
{
bandedRangeId: 0,
columnProperties: {
firstBandColor: {},
firstBandColorStyle: {},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {},
rowProperties: {}
}
],
basicFilter: {
criteria: {},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
range: {},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
]
},
charts: [
{
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [{}],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [{}],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
],
columnGroups: [{collapsed: false, depth: 0, range: {}}],
conditionalFormats: [
{
booleanRule: {condition: {}, format: {}},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
],
data: [
{
columnMetadata: [
{
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
}
],
rowData: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
rowMetadata: [{}],
startColumn: 0,
startRow: 0
}
],
developerMetadata: [{}],
filterViews: [
{
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
],
merges: [{}],
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
},
protectedRanges: [
{
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
],
rowGroups: [{}],
slicers: [
{
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
]
}
],
spreadsheetId: '',
spreadsheetUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataSourceSchedules":[{"dailySchedule":{"startTime":{"hours":0,"minutes":0,"nanos":0,"seconds":0}},"enabled":false,"monthlySchedule":{"daysOfMonth":[],"startTime":{}},"nextRun":{"endTime":"","startTime":""},"refreshScope":"","weeklySchedule":{"daysOfWeek":[],"startTime":{}}}],"dataSources":[{"calculatedColumns":[{"formula":"","reference":{"name":""}}],"dataSourceId":"","sheetId":0,"spec":{"bigQuery":{"projectId":"","querySpec":{"rawQuery":""},"tableSpec":{"datasetId":"","tableId":"","tableProjectId":""}},"parameters":[{"name":"","namedRangeId":"","range":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}]}}],"developerMetadata":[{"location":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataId":0,"metadataKey":"","metadataValue":"","visibility":""}],"namedRanges":[{"name":"","namedRangeId":"","range":{}}],"properties":{"autoRecalc":"","defaultFormat":{"backgroundColor":{"alpha":"","blue":"","green":"","red":""},"backgroundColorStyle":{"rgbColor":{},"themeColor":""},"borders":{"bottom":{"color":{},"colorStyle":{},"style":"","width":0},"left":{},"right":{},"top":{}},"horizontalAlignment":"","hyperlinkDisplayType":"","numberFormat":{"pattern":"","type":""},"padding":{"bottom":0,"left":0,"right":0,"top":0},"textDirection":"","textFormat":{"bold":false,"fontFamily":"","fontSize":0,"foregroundColor":{},"foregroundColorStyle":{},"italic":false,"link":{"uri":""},"strikethrough":false,"underline":false},"textRotation":{"angle":0,"vertical":false},"verticalAlignment":"","wrapStrategy":""},"iterativeCalculationSettings":{"convergenceThreshold":"","maxIterations":0},"locale":"","spreadsheetTheme":{"primaryFontFamily":"","themeColors":[{"color":{},"colorType":""}]},"timeZone":"","title":""},"sheets":[{"bandedRanges":[{"bandedRangeId":0,"columnProperties":{"firstBandColor":{},"firstBandColorStyle":{},"footerColor":{},"footerColorStyle":{},"headerColor":{},"headerColorStyle":{},"secondBandColor":{},"secondBandColorStyle":{}},"range":{},"rowProperties":{}}],"basicFilter":{"criteria":{},"filterSpecs":[{"columnIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{"type":"","values":[{"relativeDate":"","userEnteredValue":""}]},"hiddenValues":[],"visibleBackgroundColor":{},"visibleBackgroundColorStyle":{},"visibleForegroundColor":{},"visibleForegroundColorStyle":{}}}],"range":{},"sortSpecs":[{"backgroundColor":{},"backgroundColorStyle":{},"dataSourceColumnReference":{},"dimensionIndex":0,"foregroundColor":{},"foregroundColorStyle":{},"sortOrder":""}]},"charts":[{"border":{"color":{},"colorStyle":{}},"chartId":0,"position":{"newSheet":false,"overlayPosition":{"anchorCell":{"columnIndex":0,"rowIndex":0,"sheetId":0},"heightPixels":0,"offsetXPixels":0,"offsetYPixels":0,"widthPixels":0},"sheetId":0},"spec":{"altText":"","backgroundColor":{},"backgroundColorStyle":{},"basicChart":{"axis":[{"format":{},"position":"","title":"","titleTextPosition":{"horizontalAlignment":""},"viewWindowOptions":{"viewWindowMax":"","viewWindowMin":"","viewWindowMode":""}}],"chartType":"","compareMode":"","domains":[{"domain":{"aggregateType":"","columnReference":{},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"intervalSize":"","maxValue":"","minValue":""}},"sourceRange":{"sources":[{}]}},"reversed":false}],"headerCount":0,"interpolateNulls":false,"legendPosition":"","lineSmoothing":false,"series":[{"color":{},"colorStyle":{},"dataLabel":{"customLabelData":{},"placement":"","textFormat":{},"type":""},"lineStyle":{"type":"","width":0},"pointStyle":{"shape":"","size":""},"series":{},"styleOverrides":[{"color":{},"colorStyle":{},"index":0,"pointStyle":{}}],"targetAxis":"","type":""}],"stackedType":"","threeDimensional":false,"totalDataLabel":{}},"bubbleChart":{"bubbleBorderColor":{},"bubbleBorderColorStyle":{},"bubbleLabels":{},"bubbleMaxRadiusSize":0,"bubbleMinRadiusSize":0,"bubbleOpacity":"","bubbleSizes":{},"bubbleTextStyle":{},"domain":{},"groupIds":{},"legendPosition":"","series":{}},"candlestickChart":{"data":[{"closeSeries":{"data":{}},"highSeries":{},"lowSeries":{},"openSeries":{}}],"domain":{"data":{},"reversed":false}},"dataSourceChartProperties":{"dataExecutionStatus":{"errorCode":"","errorMessage":"","lastRefreshTime":"","state":""},"dataSourceId":""},"filterSpecs":[{}],"fontName":"","hiddenDimensionStrategy":"","histogramChart":{"bucketSize":"","legendPosition":"","outlierPercentile":"","series":[{"barColor":{},"barColorStyle":{},"data":{}}],"showItemDividers":false},"maximized":false,"orgChart":{"labels":{},"nodeColor":{},"nodeColorStyle":{},"nodeSize":"","parentLabels":{},"selectedNodeColor":{},"selectedNodeColorStyle":{},"tooltips":{}},"pieChart":{"domain":{},"legendPosition":"","pieHole":"","series":{},"threeDimensional":false},"scorecardChart":{"aggregateType":"","baselineValueData":{},"baselineValueFormat":{"comparisonType":"","description":"","negativeColor":{},"negativeColorStyle":{},"position":{},"positiveColor":{},"positiveColorStyle":{},"textFormat":{}},"customFormatOptions":{"prefix":"","suffix":""},"keyValueData":{},"keyValueFormat":{"position":{},"textFormat":{}},"numberFormatSource":"","scaleFactor":""},"sortSpecs":[{}],"subtitle":"","subtitleTextFormat":{},"subtitleTextPosition":{},"title":"","titleTextFormat":{},"titleTextPosition":{},"treemapChart":{"colorData":{},"colorScale":{"maxValueColor":{},"maxValueColorStyle":{},"midValueColor":{},"midValueColorStyle":{},"minValueColor":{},"minValueColorStyle":{},"noDataColor":{},"noDataColorStyle":{}},"headerColor":{},"headerColorStyle":{},"hideTooltips":false,"hintedLevels":0,"labels":{},"levels":0,"maxValue":"","minValue":"","parentLabels":{},"sizeData":{},"textFormat":{}},"waterfallChart":{"connectorLineStyle":{},"domain":{"data":{},"reversed":false},"firstValueIsTotal":false,"hideConnectorLines":false,"series":[{"customSubtotals":[{"dataIsSubtotal":false,"label":"","subtotalIndex":0}],"data":{},"dataLabel":{},"hideTrailingSubtotal":false,"negativeColumnsStyle":{"color":{},"colorStyle":{},"label":""},"positiveColumnsStyle":{},"subtotalColumnsStyle":{}}],"stackedType":"","totalDataLabel":{}}}}],"columnGroups":[{"collapsed":false,"depth":0,"range":{}}],"conditionalFormats":[{"booleanRule":{"condition":{},"format":{}},"gradientRule":{"maxpoint":{"color":{},"colorStyle":{},"type":"","value":""},"midpoint":{},"minpoint":{}},"ranges":[{}]}],"data":[{"columnMetadata":[{"dataSourceColumnReference":{},"developerMetadata":[{}],"hiddenByFilter":false,"hiddenByUser":false,"pixelSize":0}],"rowData":[{"values":[{"dataSourceFormula":{"dataExecutionStatus":{},"dataSourceId":""},"dataSourceTable":{"columnSelectionType":"","columns":[{}],"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{}],"rowLimit":0,"sortSpecs":[{}]},"dataValidation":{"condition":{},"inputMessage":"","showCustomUi":false,"strict":false},"effectiveFormat":{},"effectiveValue":{"boolValue":false,"errorValue":{"message":"","type":""},"formulaValue":"","numberValue":"","stringValue":""},"formattedValue":"","hyperlink":"","note":"","pivotTable":{"columns":[{"dataSourceColumnReference":{},"groupLimit":{"applyOrder":0,"countLimit":0},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"end":"","interval":"","start":""},"manualRule":{"groups":[{"groupName":{},"items":[{}]}]}},"label":"","repeatHeadings":false,"showTotals":false,"sortOrder":"","sourceColumnOffset":0,"valueBucket":{"buckets":[{}],"valuesIndex":0},"valueMetadata":[{"collapsed":false,"value":{}}]}],"criteria":{},"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{"columnOffsetIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{},"visibleByDefault":false,"visibleValues":[]}}],"rows":[{}],"source":{},"valueLayout":"","values":[{"calculatedDisplayType":"","dataSourceColumnReference":{},"formula":"","name":"","sourceColumnOffset":0,"summarizeFunction":""}]},"textFormatRuns":[{"format":{},"startIndex":0}],"userEnteredFormat":{},"userEnteredValue":{}}]}],"rowMetadata":[{}],"startColumn":0,"startRow":0}],"developerMetadata":[{}],"filterViews":[{"criteria":{},"filterSpecs":[{}],"filterViewId":0,"namedRangeId":"","range":{},"sortSpecs":[{}],"title":""}],"merges":[{}],"properties":{"dataSourceSheetProperties":{"columns":[{}],"dataExecutionStatus":{},"dataSourceId":""},"gridProperties":{"columnCount":0,"columnGroupControlAfter":false,"frozenColumnCount":0,"frozenRowCount":0,"hideGridlines":false,"rowCount":0,"rowGroupControlAfter":false},"hidden":false,"index":0,"rightToLeft":false,"sheetId":0,"sheetType":"","tabColor":{},"tabColorStyle":{},"title":""},"protectedRanges":[{"description":"","editors":{"domainUsersCanEdit":false,"groups":[],"users":[]},"namedRangeId":"","protectedRangeId":0,"range":{},"requestingUserCanEdit":false,"unprotectedRanges":[{}],"warningOnly":false}],"rowGroups":[{}],"slicers":[{"position":{},"slicerId":0,"spec":{"applyToPivotTables":false,"backgroundColor":{},"backgroundColorStyle":{},"columnIndex":0,"dataRange":{},"filterCriteria":{},"horizontalAlignment":"","textFormat":{},"title":""}}]}],"spreadsheetId":"","spreadsheetUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dataSourceSchedules": [\n {\n "dailySchedule": {\n "startTime": {\n "hours": 0,\n "minutes": 0,\n "nanos": 0,\n "seconds": 0\n }\n },\n "enabled": false,\n "monthlySchedule": {\n "daysOfMonth": [],\n "startTime": {}\n },\n "nextRun": {\n "endTime": "",\n "startTime": ""\n },\n "refreshScope": "",\n "weeklySchedule": {\n "daysOfWeek": [],\n "startTime": {}\n }\n }\n ],\n "dataSources": [\n {\n "calculatedColumns": [\n {\n "formula": "",\n "reference": {\n "name": ""\n }\n }\n ],\n "dataSourceId": "",\n "sheetId": 0,\n "spec": {\n "bigQuery": {\n "projectId": "",\n "querySpec": {\n "rawQuery": ""\n },\n "tableSpec": {\n "datasetId": "",\n "tableId": "",\n "tableProjectId": ""\n }\n },\n "parameters": [\n {\n "name": "",\n "namedRangeId": "",\n "range": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ]\n }\n }\n ],\n "developerMetadata": [\n {\n "location": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataId": 0,\n "metadataKey": "",\n "metadataValue": "",\n "visibility": ""\n }\n ],\n "namedRanges": [\n {\n "name": "",\n "namedRangeId": "",\n "range": {}\n }\n ],\n "properties": {\n "autoRecalc": "",\n "defaultFormat": {\n "backgroundColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "backgroundColorStyle": {\n "rgbColor": {},\n "themeColor": ""\n },\n "borders": {\n "bottom": {\n "color": {},\n "colorStyle": {},\n "style": "",\n "width": 0\n },\n "left": {},\n "right": {},\n "top": {}\n },\n "horizontalAlignment": "",\n "hyperlinkDisplayType": "",\n "numberFormat": {\n "pattern": "",\n "type": ""\n },\n "padding": {\n "bottom": 0,\n "left": 0,\n "right": 0,\n "top": 0\n },\n "textDirection": "",\n "textFormat": {\n "bold": false,\n "fontFamily": "",\n "fontSize": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "italic": false,\n "link": {\n "uri": ""\n },\n "strikethrough": false,\n "underline": false\n },\n "textRotation": {\n "angle": 0,\n "vertical": false\n },\n "verticalAlignment": "",\n "wrapStrategy": ""\n },\n "iterativeCalculationSettings": {\n "convergenceThreshold": "",\n "maxIterations": 0\n },\n "locale": "",\n "spreadsheetTheme": {\n "primaryFontFamily": "",\n "themeColors": [\n {\n "color": {},\n "colorType": ""\n }\n ]\n },\n "timeZone": "",\n "title": ""\n },\n "sheets": [\n {\n "bandedRanges": [\n {\n "bandedRangeId": 0,\n "columnProperties": {\n "firstBandColor": {},\n "firstBandColorStyle": {},\n "footerColor": {},\n "footerColorStyle": {},\n "headerColor": {},\n "headerColorStyle": {},\n "secondBandColor": {},\n "secondBandColorStyle": {}\n },\n "range": {},\n "rowProperties": {}\n }\n ],\n "basicFilter": {\n "criteria": {},\n "filterSpecs": [\n {\n "columnIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {\n "type": "",\n "values": [\n {\n "relativeDate": "",\n "userEnteredValue": ""\n }\n ]\n },\n "hiddenValues": [],\n "visibleBackgroundColor": {},\n "visibleBackgroundColorStyle": {},\n "visibleForegroundColor": {},\n "visibleForegroundColorStyle": {}\n }\n }\n ],\n "range": {},\n "sortSpecs": [\n {\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "dataSourceColumnReference": {},\n "dimensionIndex": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "sortOrder": ""\n }\n ]\n },\n "charts": [\n {\n "border": {\n "color": {},\n "colorStyle": {}\n },\n "chartId": 0,\n "position": {\n "newSheet": false,\n "overlayPosition": {\n "anchorCell": {\n "columnIndex": 0,\n "rowIndex": 0,\n "sheetId": 0\n },\n "heightPixels": 0,\n "offsetXPixels": 0,\n "offsetYPixels": 0,\n "widthPixels": 0\n },\n "sheetId": 0\n },\n "spec": {\n "altText": "",\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "basicChart": {\n "axis": [\n {\n "format": {},\n "position": "",\n "title": "",\n "titleTextPosition": {\n "horizontalAlignment": ""\n },\n "viewWindowOptions": {\n "viewWindowMax": "",\n "viewWindowMin": "",\n "viewWindowMode": ""\n }\n }\n ],\n "chartType": "",\n "compareMode": "",\n "domains": [\n {\n "domain": {\n "aggregateType": "",\n "columnReference": {},\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "intervalSize": "",\n "maxValue": "",\n "minValue": ""\n }\n },\n "sourceRange": {\n "sources": [\n {}\n ]\n }\n },\n "reversed": false\n }\n ],\n "headerCount": 0,\n "interpolateNulls": false,\n "legendPosition": "",\n "lineSmoothing": false,\n "series": [\n {\n "color": {},\n "colorStyle": {},\n "dataLabel": {\n "customLabelData": {},\n "placement": "",\n "textFormat": {},\n "type": ""\n },\n "lineStyle": {\n "type": "",\n "width": 0\n },\n "pointStyle": {\n "shape": "",\n "size": ""\n },\n "series": {},\n "styleOverrides": [\n {\n "color": {},\n "colorStyle": {},\n "index": 0,\n "pointStyle": {}\n }\n ],\n "targetAxis": "",\n "type": ""\n }\n ],\n "stackedType": "",\n "threeDimensional": false,\n "totalDataLabel": {}\n },\n "bubbleChart": {\n "bubbleBorderColor": {},\n "bubbleBorderColorStyle": {},\n "bubbleLabels": {},\n "bubbleMaxRadiusSize": 0,\n "bubbleMinRadiusSize": 0,\n "bubbleOpacity": "",\n "bubbleSizes": {},\n "bubbleTextStyle": {},\n "domain": {},\n "groupIds": {},\n "legendPosition": "",\n "series": {}\n },\n "candlestickChart": {\n "data": [\n {\n "closeSeries": {\n "data": {}\n },\n "highSeries": {},\n "lowSeries": {},\n "openSeries": {}\n }\n ],\n "domain": {\n "data": {},\n "reversed": false\n }\n },\n "dataSourceChartProperties": {\n "dataExecutionStatus": {\n "errorCode": "",\n "errorMessage": "",\n "lastRefreshTime": "",\n "state": ""\n },\n "dataSourceId": ""\n },\n "filterSpecs": [\n {}\n ],\n "fontName": "",\n "hiddenDimensionStrategy": "",\n "histogramChart": {\n "bucketSize": "",\n "legendPosition": "",\n "outlierPercentile": "",\n "series": [\n {\n "barColor": {},\n "barColorStyle": {},\n "data": {}\n }\n ],\n "showItemDividers": false\n },\n "maximized": false,\n "orgChart": {\n "labels": {},\n "nodeColor": {},\n "nodeColorStyle": {},\n "nodeSize": "",\n "parentLabels": {},\n "selectedNodeColor": {},\n "selectedNodeColorStyle": {},\n "tooltips": {}\n },\n "pieChart": {\n "domain": {},\n "legendPosition": "",\n "pieHole": "",\n "series": {},\n "threeDimensional": false\n },\n "scorecardChart": {\n "aggregateType": "",\n "baselineValueData": {},\n "baselineValueFormat": {\n "comparisonType": "",\n "description": "",\n "negativeColor": {},\n "negativeColorStyle": {},\n "position": {},\n "positiveColor": {},\n "positiveColorStyle": {},\n "textFormat": {}\n },\n "customFormatOptions": {\n "prefix": "",\n "suffix": ""\n },\n "keyValueData": {},\n "keyValueFormat": {\n "position": {},\n "textFormat": {}\n },\n "numberFormatSource": "",\n "scaleFactor": ""\n },\n "sortSpecs": [\n {}\n ],\n "subtitle": "",\n "subtitleTextFormat": {},\n "subtitleTextPosition": {},\n "title": "",\n "titleTextFormat": {},\n "titleTextPosition": {},\n "treemapChart": {\n "colorData": {},\n "colorScale": {\n "maxValueColor": {},\n "maxValueColorStyle": {},\n "midValueColor": {},\n "midValueColorStyle": {},\n "minValueColor": {},\n "minValueColorStyle": {},\n "noDataColor": {},\n "noDataColorStyle": {}\n },\n "headerColor": {},\n "headerColorStyle": {},\n "hideTooltips": false,\n "hintedLevels": 0,\n "labels": {},\n "levels": 0,\n "maxValue": "",\n "minValue": "",\n "parentLabels": {},\n "sizeData": {},\n "textFormat": {}\n },\n "waterfallChart": {\n "connectorLineStyle": {},\n "domain": {\n "data": {},\n "reversed": false\n },\n "firstValueIsTotal": false,\n "hideConnectorLines": false,\n "series": [\n {\n "customSubtotals": [\n {\n "dataIsSubtotal": false,\n "label": "",\n "subtotalIndex": 0\n }\n ],\n "data": {},\n "dataLabel": {},\n "hideTrailingSubtotal": false,\n "negativeColumnsStyle": {\n "color": {},\n "colorStyle": {},\n "label": ""\n },\n "positiveColumnsStyle": {},\n "subtotalColumnsStyle": {}\n }\n ],\n "stackedType": "",\n "totalDataLabel": {}\n }\n }\n }\n ],\n "columnGroups": [\n {\n "collapsed": false,\n "depth": 0,\n "range": {}\n }\n ],\n "conditionalFormats": [\n {\n "booleanRule": {\n "condition": {},\n "format": {}\n },\n "gradientRule": {\n "maxpoint": {\n "color": {},\n "colorStyle": {},\n "type": "",\n "value": ""\n },\n "midpoint": {},\n "minpoint": {}\n },\n "ranges": [\n {}\n ]\n }\n ],\n "data": [\n {\n "columnMetadata": [\n {\n "dataSourceColumnReference": {},\n "developerMetadata": [\n {}\n ],\n "hiddenByFilter": false,\n "hiddenByUser": false,\n "pixelSize": 0\n }\n ],\n "rowData": [\n {\n "values": [\n {\n "dataSourceFormula": {\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "dataSourceTable": {\n "columnSelectionType": "",\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {}\n ],\n "rowLimit": 0,\n "sortSpecs": [\n {}\n ]\n },\n "dataValidation": {\n "condition": {},\n "inputMessage": "",\n "showCustomUi": false,\n "strict": false\n },\n "effectiveFormat": {},\n "effectiveValue": {\n "boolValue": false,\n "errorValue": {\n "message": "",\n "type": ""\n },\n "formulaValue": "",\n "numberValue": "",\n "stringValue": ""\n },\n "formattedValue": "",\n "hyperlink": "",\n "note": "",\n "pivotTable": {\n "columns": [\n {\n "dataSourceColumnReference": {},\n "groupLimit": {\n "applyOrder": 0,\n "countLimit": 0\n },\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "end": "",\n "interval": "",\n "start": ""\n },\n "manualRule": {\n "groups": [\n {\n "groupName": {},\n "items": [\n {}\n ]\n }\n ]\n }\n },\n "label": "",\n "repeatHeadings": false,\n "showTotals": false,\n "sortOrder": "",\n "sourceColumnOffset": 0,\n "valueBucket": {\n "buckets": [\n {}\n ],\n "valuesIndex": 0\n },\n "valueMetadata": [\n {\n "collapsed": false,\n "value": {}\n }\n ]\n }\n ],\n "criteria": {},\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {\n "columnOffsetIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {},\n "visibleByDefault": false,\n "visibleValues": []\n }\n }\n ],\n "rows": [\n {}\n ],\n "source": {},\n "valueLayout": "",\n "values": [\n {\n "calculatedDisplayType": "",\n "dataSourceColumnReference": {},\n "formula": "",\n "name": "",\n "sourceColumnOffset": 0,\n "summarizeFunction": ""\n }\n ]\n },\n "textFormatRuns": [\n {\n "format": {},\n "startIndex": 0\n }\n ],\n "userEnteredFormat": {},\n "userEnteredValue": {}\n }\n ]\n }\n ],\n "rowMetadata": [\n {}\n ],\n "startColumn": 0,\n "startRow": 0\n }\n ],\n "developerMetadata": [\n {}\n ],\n "filterViews": [\n {\n "criteria": {},\n "filterSpecs": [\n {}\n ],\n "filterViewId": 0,\n "namedRangeId": "",\n "range": {},\n "sortSpecs": [\n {}\n ],\n "title": ""\n }\n ],\n "merges": [\n {}\n ],\n "properties": {\n "dataSourceSheetProperties": {\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "gridProperties": {\n "columnCount": 0,\n "columnGroupControlAfter": false,\n "frozenColumnCount": 0,\n "frozenRowCount": 0,\n "hideGridlines": false,\n "rowCount": 0,\n "rowGroupControlAfter": false\n },\n "hidden": false,\n "index": 0,\n "rightToLeft": false,\n "sheetId": 0,\n "sheetType": "",\n "tabColor": {},\n "tabColorStyle": {},\n "title": ""\n },\n "protectedRanges": [\n {\n "description": "",\n "editors": {\n "domainUsersCanEdit": false,\n "groups": [],\n "users": []\n },\n "namedRangeId": "",\n "protectedRangeId": 0,\n "range": {},\n "requestingUserCanEdit": false,\n "unprotectedRanges": [\n {}\n ],\n "warningOnly": false\n }\n ],\n "rowGroups": [\n {}\n ],\n "slicers": [\n {\n "position": {},\n "slicerId": 0,\n "spec": {\n "applyToPivotTables": false,\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "columnIndex": 0,\n "dataRange": {},\n "filterCriteria": {},\n "horizontalAlignment": "",\n "textFormat": {},\n "title": ""\n }\n }\n ]\n }\n ],\n "spreadsheetId": "",\n "spreadsheetUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dataSourceSchedules: [
{
dailySchedule: {startTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0}},
enabled: false,
monthlySchedule: {daysOfMonth: [], startTime: {}},
nextRun: {endTime: '', startTime: ''},
refreshScope: '',
weeklySchedule: {daysOfWeek: [], startTime: {}}
}
],
dataSources: [
{
calculatedColumns: [{formula: '', reference: {name: ''}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
}
],
developerMetadata: [
{
location: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
],
namedRanges: [{name: '', namedRangeId: '', range: {}}],
properties: {
autoRecalc: '',
defaultFormat: {
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
backgroundColorStyle: {rgbColor: {}, themeColor: ''},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
},
sheets: [
{
bandedRanges: [
{
bandedRangeId: 0,
columnProperties: {
firstBandColor: {},
firstBandColorStyle: {},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {},
rowProperties: {}
}
],
basicFilter: {
criteria: {},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
range: {},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
]
},
charts: [
{
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [{}],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [{}],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
],
columnGroups: [{collapsed: false, depth: 0, range: {}}],
conditionalFormats: [
{
booleanRule: {condition: {}, format: {}},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
],
data: [
{
columnMetadata: [
{
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
}
],
rowData: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
rowMetadata: [{}],
startColumn: 0,
startRow: 0
}
],
developerMetadata: [{}],
filterViews: [
{
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
],
merges: [{}],
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
},
protectedRanges: [
{
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
],
rowGroups: [{}],
slicers: [
{
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
]
}
],
spreadsheetId: '',
spreadsheetUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets',
headers: {'content-type': 'application/json'},
body: {
dataSourceSchedules: [
{
dailySchedule: {startTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0}},
enabled: false,
monthlySchedule: {daysOfMonth: [], startTime: {}},
nextRun: {endTime: '', startTime: ''},
refreshScope: '',
weeklySchedule: {daysOfWeek: [], startTime: {}}
}
],
dataSources: [
{
calculatedColumns: [{formula: '', reference: {name: ''}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
}
],
developerMetadata: [
{
location: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
],
namedRanges: [{name: '', namedRangeId: '', range: {}}],
properties: {
autoRecalc: '',
defaultFormat: {
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
backgroundColorStyle: {rgbColor: {}, themeColor: ''},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
},
sheets: [
{
bandedRanges: [
{
bandedRangeId: 0,
columnProperties: {
firstBandColor: {},
firstBandColorStyle: {},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {},
rowProperties: {}
}
],
basicFilter: {
criteria: {},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
range: {},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
]
},
charts: [
{
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [{}],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [{}],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
],
columnGroups: [{collapsed: false, depth: 0, range: {}}],
conditionalFormats: [
{
booleanRule: {condition: {}, format: {}},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
],
data: [
{
columnMetadata: [
{
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
}
],
rowData: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
rowMetadata: [{}],
startColumn: 0,
startRow: 0
}
],
developerMetadata: [{}],
filterViews: [
{
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
],
merges: [{}],
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
},
protectedRanges: [
{
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
],
rowGroups: [{}],
slicers: [
{
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
]
}
],
spreadsheetId: '',
spreadsheetUrl: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dataSourceSchedules: [
{
dailySchedule: {
startTime: {
hours: 0,
minutes: 0,
nanos: 0,
seconds: 0
}
},
enabled: false,
monthlySchedule: {
daysOfMonth: [],
startTime: {}
},
nextRun: {
endTime: '',
startTime: ''
},
refreshScope: '',
weeklySchedule: {
daysOfWeek: [],
startTime: {}
}
}
],
dataSources: [
{
calculatedColumns: [
{
formula: '',
reference: {
name: ''
}
}
],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {
rawQuery: ''
},
tableSpec: {
datasetId: '',
tableId: '',
tableProjectId: ''
}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
}
],
developerMetadata: [
{
location: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
],
namedRanges: [
{
name: '',
namedRangeId: '',
range: {}
}
],
properties: {
autoRecalc: '',
defaultFormat: {
backgroundColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
backgroundColorStyle: {
rgbColor: {},
themeColor: ''
},
borders: {
bottom: {
color: {},
colorStyle: {},
style: '',
width: 0
},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {
pattern: '',
type: ''
},
padding: {
bottom: 0,
left: 0,
right: 0,
top: 0
},
textDirection: '',
textFormat: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {
uri: ''
},
strikethrough: false,
underline: false
},
textRotation: {
angle: 0,
vertical: false
},
verticalAlignment: '',
wrapStrategy: ''
},
iterativeCalculationSettings: {
convergenceThreshold: '',
maxIterations: 0
},
locale: '',
spreadsheetTheme: {
primaryFontFamily: '',
themeColors: [
{
color: {},
colorType: ''
}
]
},
timeZone: '',
title: ''
},
sheets: [
{
bandedRanges: [
{
bandedRangeId: 0,
columnProperties: {
firstBandColor: {},
firstBandColorStyle: {},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {},
rowProperties: {}
}
],
basicFilter: {
criteria: {},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {
type: '',
values: [
{
relativeDate: '',
userEnteredValue: ''
}
]
},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
range: {},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
]
},
charts: [
{
border: {
color: {},
colorStyle: {}
},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {
columnIndex: 0,
rowIndex: 0,
sheetId: 0
},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {},
position: '',
title: '',
titleTextPosition: {
horizontalAlignment: ''
},
viewWindowOptions: {
viewWindowMax: '',
viewWindowMin: '',
viewWindowMode: ''
}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
intervalSize: '',
maxValue: '',
minValue: ''
}
},
sourceRange: {
sources: [
{}
]
}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {
customLabelData: {},
placement: '',
textFormat: {},
type: ''
},
lineStyle: {
type: '',
width: 0
},
pointStyle: {
shape: '',
size: ''
},
series: {},
styleOverrides: [
{
color: {},
colorStyle: {},
index: 0,
pointStyle: {}
}
],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [
{
closeSeries: {
data: {}
},
highSeries: {},
lowSeries: {},
openSeries: {}
}
],
domain: {
data: {},
reversed: false
}
},
dataSourceChartProperties: {
dataExecutionStatus: {
errorCode: '',
errorMessage: '',
lastRefreshTime: '',
state: ''
},
dataSourceId: ''
},
filterSpecs: [
{}
],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [
{
barColor: {},
barColorStyle: {},
data: {}
}
],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {
prefix: '',
suffix: ''
},
keyValueData: {},
keyValueFormat: {
position: {},
textFormat: {}
},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [
{}
],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {
data: {},
reversed: false
},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [
{
dataIsSubtotal: false,
label: '',
subtotalIndex: 0
}
],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {
color: {},
colorStyle: {},
label: ''
},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
],
columnGroups: [
{
collapsed: false,
depth: 0,
range: {}
}
],
conditionalFormats: [
{
booleanRule: {
condition: {},
format: {}
},
gradientRule: {
maxpoint: {
color: {},
colorStyle: {},
type: '',
value: ''
},
midpoint: {},
minpoint: {}
},
ranges: [
{}
]
}
],
data: [
{
columnMetadata: [
{
dataSourceColumnReference: {},
developerMetadata: [
{}
],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
}
],
rowData: [
{
values: [
{
dataSourceFormula: {
dataExecutionStatus: {},
dataSourceId: ''
},
dataSourceTable: {
columnSelectionType: '',
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{}
],
rowLimit: 0,
sortSpecs: [
{}
]
},
dataValidation: {
condition: {},
inputMessage: '',
showCustomUi: false,
strict: false
},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {
message: '',
type: ''
},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {
applyOrder: 0,
countLimit: 0
},
groupRule: {
dateTimeRule: {
type: ''
},
histogramRule: {
end: '',
interval: '',
start: ''
},
manualRule: {
groups: [
{
groupName: {},
items: [
{}
]
}
]
}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {
buckets: [
{}
],
valuesIndex: 0
},
valueMetadata: [
{
collapsed: false,
value: {}
}
]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {},
visibleByDefault: false,
visibleValues: []
}
}
],
rows: [
{}
],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [
{
format: {},
startIndex: 0
}
],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
rowMetadata: [
{}
],
startColumn: 0,
startRow: 0
}
],
developerMetadata: [
{}
],
filterViews: [
{
criteria: {},
filterSpecs: [
{}
],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [
{}
],
title: ''
}
],
merges: [
{}
],
properties: {
dataSourceSheetProperties: {
columns: [
{}
],
dataExecutionStatus: {},
dataSourceId: ''
},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
},
protectedRanges: [
{
description: '',
editors: {
domainUsersCanEdit: false,
groups: [],
users: []
},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [
{}
],
warningOnly: false
}
],
rowGroups: [
{}
],
slicers: [
{
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
]
}
],
spreadsheetId: '',
spreadsheetUrl: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets',
headers: {'content-type': 'application/json'},
data: {
dataSourceSchedules: [
{
dailySchedule: {startTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0}},
enabled: false,
monthlySchedule: {daysOfMonth: [], startTime: {}},
nextRun: {endTime: '', startTime: ''},
refreshScope: '',
weeklySchedule: {daysOfWeek: [], startTime: {}}
}
],
dataSources: [
{
calculatedColumns: [{formula: '', reference: {name: ''}}],
dataSourceId: '',
sheetId: 0,
spec: {
bigQuery: {
projectId: '',
querySpec: {rawQuery: ''},
tableSpec: {datasetId: '', tableId: '', tableProjectId: ''}
},
parameters: [
{
name: '',
namedRangeId: '',
range: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
}
],
developerMetadata: [
{
location: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataId: 0,
metadataKey: '',
metadataValue: '',
visibility: ''
}
],
namedRanges: [{name: '', namedRangeId: '', range: {}}],
properties: {
autoRecalc: '',
defaultFormat: {
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
backgroundColorStyle: {rgbColor: {}, themeColor: ''},
borders: {
bottom: {color: {}, colorStyle: {}, style: '', width: 0},
left: {},
right: {},
top: {}
},
horizontalAlignment: '',
hyperlinkDisplayType: '',
numberFormat: {pattern: '', type: ''},
padding: {bottom: 0, left: 0, right: 0, top: 0},
textDirection: '',
textFormat: {
bold: false,
fontFamily: '',
fontSize: 0,
foregroundColor: {},
foregroundColorStyle: {},
italic: false,
link: {uri: ''},
strikethrough: false,
underline: false
},
textRotation: {angle: 0, vertical: false},
verticalAlignment: '',
wrapStrategy: ''
},
iterativeCalculationSettings: {convergenceThreshold: '', maxIterations: 0},
locale: '',
spreadsheetTheme: {primaryFontFamily: '', themeColors: [{color: {}, colorType: ''}]},
timeZone: '',
title: ''
},
sheets: [
{
bandedRanges: [
{
bandedRangeId: 0,
columnProperties: {
firstBandColor: {},
firstBandColorStyle: {},
footerColor: {},
footerColorStyle: {},
headerColor: {},
headerColorStyle: {},
secondBandColor: {},
secondBandColorStyle: {}
},
range: {},
rowProperties: {}
}
],
basicFilter: {
criteria: {},
filterSpecs: [
{
columnIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {
condition: {type: '', values: [{relativeDate: '', userEnteredValue: ''}]},
hiddenValues: [],
visibleBackgroundColor: {},
visibleBackgroundColorStyle: {},
visibleForegroundColor: {},
visibleForegroundColorStyle: {}
}
}
],
range: {},
sortSpecs: [
{
backgroundColor: {},
backgroundColorStyle: {},
dataSourceColumnReference: {},
dimensionIndex: 0,
foregroundColor: {},
foregroundColorStyle: {},
sortOrder: ''
}
]
},
charts: [
{
border: {color: {}, colorStyle: {}},
chartId: 0,
position: {
newSheet: false,
overlayPosition: {
anchorCell: {columnIndex: 0, rowIndex: 0, sheetId: 0},
heightPixels: 0,
offsetXPixels: 0,
offsetYPixels: 0,
widthPixels: 0
},
sheetId: 0
},
spec: {
altText: '',
backgroundColor: {},
backgroundColorStyle: {},
basicChart: {
axis: [
{
format: {},
position: '',
title: '',
titleTextPosition: {horizontalAlignment: ''},
viewWindowOptions: {viewWindowMax: '', viewWindowMin: '', viewWindowMode: ''}
}
],
chartType: '',
compareMode: '',
domains: [
{
domain: {
aggregateType: '',
columnReference: {},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {intervalSize: '', maxValue: '', minValue: ''}
},
sourceRange: {sources: [{}]}
},
reversed: false
}
],
headerCount: 0,
interpolateNulls: false,
legendPosition: '',
lineSmoothing: false,
series: [
{
color: {},
colorStyle: {},
dataLabel: {customLabelData: {}, placement: '', textFormat: {}, type: ''},
lineStyle: {type: '', width: 0},
pointStyle: {shape: '', size: ''},
series: {},
styleOverrides: [{color: {}, colorStyle: {}, index: 0, pointStyle: {}}],
targetAxis: '',
type: ''
}
],
stackedType: '',
threeDimensional: false,
totalDataLabel: {}
},
bubbleChart: {
bubbleBorderColor: {},
bubbleBorderColorStyle: {},
bubbleLabels: {},
bubbleMaxRadiusSize: 0,
bubbleMinRadiusSize: 0,
bubbleOpacity: '',
bubbleSizes: {},
bubbleTextStyle: {},
domain: {},
groupIds: {},
legendPosition: '',
series: {}
},
candlestickChart: {
data: [{closeSeries: {data: {}}, highSeries: {}, lowSeries: {}, openSeries: {}}],
domain: {data: {}, reversed: false}
},
dataSourceChartProperties: {
dataExecutionStatus: {errorCode: '', errorMessage: '', lastRefreshTime: '', state: ''},
dataSourceId: ''
},
filterSpecs: [{}],
fontName: '',
hiddenDimensionStrategy: '',
histogramChart: {
bucketSize: '',
legendPosition: '',
outlierPercentile: '',
series: [{barColor: {}, barColorStyle: {}, data: {}}],
showItemDividers: false
},
maximized: false,
orgChart: {
labels: {},
nodeColor: {},
nodeColorStyle: {},
nodeSize: '',
parentLabels: {},
selectedNodeColor: {},
selectedNodeColorStyle: {},
tooltips: {}
},
pieChart: {
domain: {},
legendPosition: '',
pieHole: '',
series: {},
threeDimensional: false
},
scorecardChart: {
aggregateType: '',
baselineValueData: {},
baselineValueFormat: {
comparisonType: '',
description: '',
negativeColor: {},
negativeColorStyle: {},
position: {},
positiveColor: {},
positiveColorStyle: {},
textFormat: {}
},
customFormatOptions: {prefix: '', suffix: ''},
keyValueData: {},
keyValueFormat: {position: {}, textFormat: {}},
numberFormatSource: '',
scaleFactor: ''
},
sortSpecs: [{}],
subtitle: '',
subtitleTextFormat: {},
subtitleTextPosition: {},
title: '',
titleTextFormat: {},
titleTextPosition: {},
treemapChart: {
colorData: {},
colorScale: {
maxValueColor: {},
maxValueColorStyle: {},
midValueColor: {},
midValueColorStyle: {},
minValueColor: {},
minValueColorStyle: {},
noDataColor: {},
noDataColorStyle: {}
},
headerColor: {},
headerColorStyle: {},
hideTooltips: false,
hintedLevels: 0,
labels: {},
levels: 0,
maxValue: '',
minValue: '',
parentLabels: {},
sizeData: {},
textFormat: {}
},
waterfallChart: {
connectorLineStyle: {},
domain: {data: {}, reversed: false},
firstValueIsTotal: false,
hideConnectorLines: false,
series: [
{
customSubtotals: [{dataIsSubtotal: false, label: '', subtotalIndex: 0}],
data: {},
dataLabel: {},
hideTrailingSubtotal: false,
negativeColumnsStyle: {color: {}, colorStyle: {}, label: ''},
positiveColumnsStyle: {},
subtotalColumnsStyle: {}
}
],
stackedType: '',
totalDataLabel: {}
}
}
}
],
columnGroups: [{collapsed: false, depth: 0, range: {}}],
conditionalFormats: [
{
booleanRule: {condition: {}, format: {}},
gradientRule: {
maxpoint: {color: {}, colorStyle: {}, type: '', value: ''},
midpoint: {},
minpoint: {}
},
ranges: [{}]
}
],
data: [
{
columnMetadata: [
{
dataSourceColumnReference: {},
developerMetadata: [{}],
hiddenByFilter: false,
hiddenByUser: false,
pixelSize: 0
}
],
rowData: [
{
values: [
{
dataSourceFormula: {dataExecutionStatus: {}, dataSourceId: ''},
dataSourceTable: {
columnSelectionType: '',
columns: [{}],
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [{}],
rowLimit: 0,
sortSpecs: [{}]
},
dataValidation: {condition: {}, inputMessage: '', showCustomUi: false, strict: false},
effectiveFormat: {},
effectiveValue: {
boolValue: false,
errorValue: {message: '', type: ''},
formulaValue: '',
numberValue: '',
stringValue: ''
},
formattedValue: '',
hyperlink: '',
note: '',
pivotTable: {
columns: [
{
dataSourceColumnReference: {},
groupLimit: {applyOrder: 0, countLimit: 0},
groupRule: {
dateTimeRule: {type: ''},
histogramRule: {end: '', interval: '', start: ''},
manualRule: {groups: [{groupName: {}, items: [{}]}]}
},
label: '',
repeatHeadings: false,
showTotals: false,
sortOrder: '',
sourceColumnOffset: 0,
valueBucket: {buckets: [{}], valuesIndex: 0},
valueMetadata: [{collapsed: false, value: {}}]
}
],
criteria: {},
dataExecutionStatus: {},
dataSourceId: '',
filterSpecs: [
{
columnOffsetIndex: 0,
dataSourceColumnReference: {},
filterCriteria: {condition: {}, visibleByDefault: false, visibleValues: []}
}
],
rows: [{}],
source: {},
valueLayout: '',
values: [
{
calculatedDisplayType: '',
dataSourceColumnReference: {},
formula: '',
name: '',
sourceColumnOffset: 0,
summarizeFunction: ''
}
]
},
textFormatRuns: [{format: {}, startIndex: 0}],
userEnteredFormat: {},
userEnteredValue: {}
}
]
}
],
rowMetadata: [{}],
startColumn: 0,
startRow: 0
}
],
developerMetadata: [{}],
filterViews: [
{
criteria: {},
filterSpecs: [{}],
filterViewId: 0,
namedRangeId: '',
range: {},
sortSpecs: [{}],
title: ''
}
],
merges: [{}],
properties: {
dataSourceSheetProperties: {columns: [{}], dataExecutionStatus: {}, dataSourceId: ''},
gridProperties: {
columnCount: 0,
columnGroupControlAfter: false,
frozenColumnCount: 0,
frozenRowCount: 0,
hideGridlines: false,
rowCount: 0,
rowGroupControlAfter: false
},
hidden: false,
index: 0,
rightToLeft: false,
sheetId: 0,
sheetType: '',
tabColor: {},
tabColorStyle: {},
title: ''
},
protectedRanges: [
{
description: '',
editors: {domainUsersCanEdit: false, groups: [], users: []},
namedRangeId: '',
protectedRangeId: 0,
range: {},
requestingUserCanEdit: false,
unprotectedRanges: [{}],
warningOnly: false
}
],
rowGroups: [{}],
slicers: [
{
position: {},
slicerId: 0,
spec: {
applyToPivotTables: false,
backgroundColor: {},
backgroundColorStyle: {},
columnIndex: 0,
dataRange: {},
filterCriteria: {},
horizontalAlignment: '',
textFormat: {},
title: ''
}
}
]
}
],
spreadsheetId: '',
spreadsheetUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataSourceSchedules":[{"dailySchedule":{"startTime":{"hours":0,"minutes":0,"nanos":0,"seconds":0}},"enabled":false,"monthlySchedule":{"daysOfMonth":[],"startTime":{}},"nextRun":{"endTime":"","startTime":""},"refreshScope":"","weeklySchedule":{"daysOfWeek":[],"startTime":{}}}],"dataSources":[{"calculatedColumns":[{"formula":"","reference":{"name":""}}],"dataSourceId":"","sheetId":0,"spec":{"bigQuery":{"projectId":"","querySpec":{"rawQuery":""},"tableSpec":{"datasetId":"","tableId":"","tableProjectId":""}},"parameters":[{"name":"","namedRangeId":"","range":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}]}}],"developerMetadata":[{"location":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataId":0,"metadataKey":"","metadataValue":"","visibility":""}],"namedRanges":[{"name":"","namedRangeId":"","range":{}}],"properties":{"autoRecalc":"","defaultFormat":{"backgroundColor":{"alpha":"","blue":"","green":"","red":""},"backgroundColorStyle":{"rgbColor":{},"themeColor":""},"borders":{"bottom":{"color":{},"colorStyle":{},"style":"","width":0},"left":{},"right":{},"top":{}},"horizontalAlignment":"","hyperlinkDisplayType":"","numberFormat":{"pattern":"","type":""},"padding":{"bottom":0,"left":0,"right":0,"top":0},"textDirection":"","textFormat":{"bold":false,"fontFamily":"","fontSize":0,"foregroundColor":{},"foregroundColorStyle":{},"italic":false,"link":{"uri":""},"strikethrough":false,"underline":false},"textRotation":{"angle":0,"vertical":false},"verticalAlignment":"","wrapStrategy":""},"iterativeCalculationSettings":{"convergenceThreshold":"","maxIterations":0},"locale":"","spreadsheetTheme":{"primaryFontFamily":"","themeColors":[{"color":{},"colorType":""}]},"timeZone":"","title":""},"sheets":[{"bandedRanges":[{"bandedRangeId":0,"columnProperties":{"firstBandColor":{},"firstBandColorStyle":{},"footerColor":{},"footerColorStyle":{},"headerColor":{},"headerColorStyle":{},"secondBandColor":{},"secondBandColorStyle":{}},"range":{},"rowProperties":{}}],"basicFilter":{"criteria":{},"filterSpecs":[{"columnIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{"type":"","values":[{"relativeDate":"","userEnteredValue":""}]},"hiddenValues":[],"visibleBackgroundColor":{},"visibleBackgroundColorStyle":{},"visibleForegroundColor":{},"visibleForegroundColorStyle":{}}}],"range":{},"sortSpecs":[{"backgroundColor":{},"backgroundColorStyle":{},"dataSourceColumnReference":{},"dimensionIndex":0,"foregroundColor":{},"foregroundColorStyle":{},"sortOrder":""}]},"charts":[{"border":{"color":{},"colorStyle":{}},"chartId":0,"position":{"newSheet":false,"overlayPosition":{"anchorCell":{"columnIndex":0,"rowIndex":0,"sheetId":0},"heightPixels":0,"offsetXPixels":0,"offsetYPixels":0,"widthPixels":0},"sheetId":0},"spec":{"altText":"","backgroundColor":{},"backgroundColorStyle":{},"basicChart":{"axis":[{"format":{},"position":"","title":"","titleTextPosition":{"horizontalAlignment":""},"viewWindowOptions":{"viewWindowMax":"","viewWindowMin":"","viewWindowMode":""}}],"chartType":"","compareMode":"","domains":[{"domain":{"aggregateType":"","columnReference":{},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"intervalSize":"","maxValue":"","minValue":""}},"sourceRange":{"sources":[{}]}},"reversed":false}],"headerCount":0,"interpolateNulls":false,"legendPosition":"","lineSmoothing":false,"series":[{"color":{},"colorStyle":{},"dataLabel":{"customLabelData":{},"placement":"","textFormat":{},"type":""},"lineStyle":{"type":"","width":0},"pointStyle":{"shape":"","size":""},"series":{},"styleOverrides":[{"color":{},"colorStyle":{},"index":0,"pointStyle":{}}],"targetAxis":"","type":""}],"stackedType":"","threeDimensional":false,"totalDataLabel":{}},"bubbleChart":{"bubbleBorderColor":{},"bubbleBorderColorStyle":{},"bubbleLabels":{},"bubbleMaxRadiusSize":0,"bubbleMinRadiusSize":0,"bubbleOpacity":"","bubbleSizes":{},"bubbleTextStyle":{},"domain":{},"groupIds":{},"legendPosition":"","series":{}},"candlestickChart":{"data":[{"closeSeries":{"data":{}},"highSeries":{},"lowSeries":{},"openSeries":{}}],"domain":{"data":{},"reversed":false}},"dataSourceChartProperties":{"dataExecutionStatus":{"errorCode":"","errorMessage":"","lastRefreshTime":"","state":""},"dataSourceId":""},"filterSpecs":[{}],"fontName":"","hiddenDimensionStrategy":"","histogramChart":{"bucketSize":"","legendPosition":"","outlierPercentile":"","series":[{"barColor":{},"barColorStyle":{},"data":{}}],"showItemDividers":false},"maximized":false,"orgChart":{"labels":{},"nodeColor":{},"nodeColorStyle":{},"nodeSize":"","parentLabels":{},"selectedNodeColor":{},"selectedNodeColorStyle":{},"tooltips":{}},"pieChart":{"domain":{},"legendPosition":"","pieHole":"","series":{},"threeDimensional":false},"scorecardChart":{"aggregateType":"","baselineValueData":{},"baselineValueFormat":{"comparisonType":"","description":"","negativeColor":{},"negativeColorStyle":{},"position":{},"positiveColor":{},"positiveColorStyle":{},"textFormat":{}},"customFormatOptions":{"prefix":"","suffix":""},"keyValueData":{},"keyValueFormat":{"position":{},"textFormat":{}},"numberFormatSource":"","scaleFactor":""},"sortSpecs":[{}],"subtitle":"","subtitleTextFormat":{},"subtitleTextPosition":{},"title":"","titleTextFormat":{},"titleTextPosition":{},"treemapChart":{"colorData":{},"colorScale":{"maxValueColor":{},"maxValueColorStyle":{},"midValueColor":{},"midValueColorStyle":{},"minValueColor":{},"minValueColorStyle":{},"noDataColor":{},"noDataColorStyle":{}},"headerColor":{},"headerColorStyle":{},"hideTooltips":false,"hintedLevels":0,"labels":{},"levels":0,"maxValue":"","minValue":"","parentLabels":{},"sizeData":{},"textFormat":{}},"waterfallChart":{"connectorLineStyle":{},"domain":{"data":{},"reversed":false},"firstValueIsTotal":false,"hideConnectorLines":false,"series":[{"customSubtotals":[{"dataIsSubtotal":false,"label":"","subtotalIndex":0}],"data":{},"dataLabel":{},"hideTrailingSubtotal":false,"negativeColumnsStyle":{"color":{},"colorStyle":{},"label":""},"positiveColumnsStyle":{},"subtotalColumnsStyle":{}}],"stackedType":"","totalDataLabel":{}}}}],"columnGroups":[{"collapsed":false,"depth":0,"range":{}}],"conditionalFormats":[{"booleanRule":{"condition":{},"format":{}},"gradientRule":{"maxpoint":{"color":{},"colorStyle":{},"type":"","value":""},"midpoint":{},"minpoint":{}},"ranges":[{}]}],"data":[{"columnMetadata":[{"dataSourceColumnReference":{},"developerMetadata":[{}],"hiddenByFilter":false,"hiddenByUser":false,"pixelSize":0}],"rowData":[{"values":[{"dataSourceFormula":{"dataExecutionStatus":{},"dataSourceId":""},"dataSourceTable":{"columnSelectionType":"","columns":[{}],"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{}],"rowLimit":0,"sortSpecs":[{}]},"dataValidation":{"condition":{},"inputMessage":"","showCustomUi":false,"strict":false},"effectiveFormat":{},"effectiveValue":{"boolValue":false,"errorValue":{"message":"","type":""},"formulaValue":"","numberValue":"","stringValue":""},"formattedValue":"","hyperlink":"","note":"","pivotTable":{"columns":[{"dataSourceColumnReference":{},"groupLimit":{"applyOrder":0,"countLimit":0},"groupRule":{"dateTimeRule":{"type":""},"histogramRule":{"end":"","interval":"","start":""},"manualRule":{"groups":[{"groupName":{},"items":[{}]}]}},"label":"","repeatHeadings":false,"showTotals":false,"sortOrder":"","sourceColumnOffset":0,"valueBucket":{"buckets":[{}],"valuesIndex":0},"valueMetadata":[{"collapsed":false,"value":{}}]}],"criteria":{},"dataExecutionStatus":{},"dataSourceId":"","filterSpecs":[{"columnOffsetIndex":0,"dataSourceColumnReference":{},"filterCriteria":{"condition":{},"visibleByDefault":false,"visibleValues":[]}}],"rows":[{}],"source":{},"valueLayout":"","values":[{"calculatedDisplayType":"","dataSourceColumnReference":{},"formula":"","name":"","sourceColumnOffset":0,"summarizeFunction":""}]},"textFormatRuns":[{"format":{},"startIndex":0}],"userEnteredFormat":{},"userEnteredValue":{}}]}],"rowMetadata":[{}],"startColumn":0,"startRow":0}],"developerMetadata":[{}],"filterViews":[{"criteria":{},"filterSpecs":[{}],"filterViewId":0,"namedRangeId":"","range":{},"sortSpecs":[{}],"title":""}],"merges":[{}],"properties":{"dataSourceSheetProperties":{"columns":[{}],"dataExecutionStatus":{},"dataSourceId":""},"gridProperties":{"columnCount":0,"columnGroupControlAfter":false,"frozenColumnCount":0,"frozenRowCount":0,"hideGridlines":false,"rowCount":0,"rowGroupControlAfter":false},"hidden":false,"index":0,"rightToLeft":false,"sheetId":0,"sheetType":"","tabColor":{},"tabColorStyle":{},"title":""},"protectedRanges":[{"description":"","editors":{"domainUsersCanEdit":false,"groups":[],"users":[]},"namedRangeId":"","protectedRangeId":0,"range":{},"requestingUserCanEdit":false,"unprotectedRanges":[{}],"warningOnly":false}],"rowGroups":[{}],"slicers":[{"position":{},"slicerId":0,"spec":{"applyToPivotTables":false,"backgroundColor":{},"backgroundColorStyle":{},"columnIndex":0,"dataRange":{},"filterCriteria":{},"horizontalAlignment":"","textFormat":{},"title":""}}]}],"spreadsheetId":"","spreadsheetUrl":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dataSourceSchedules": @[ @{ @"dailySchedule": @{ @"startTime": @{ @"hours": @0, @"minutes": @0, @"nanos": @0, @"seconds": @0 } }, @"enabled": @NO, @"monthlySchedule": @{ @"daysOfMonth": @[ ], @"startTime": @{ } }, @"nextRun": @{ @"endTime": @"", @"startTime": @"" }, @"refreshScope": @"", @"weeklySchedule": @{ @"daysOfWeek": @[ ], @"startTime": @{ } } } ],
@"dataSources": @[ @{ @"calculatedColumns": @[ @{ @"formula": @"", @"reference": @{ @"name": @"" } } ], @"dataSourceId": @"", @"sheetId": @0, @"spec": @{ @"bigQuery": @{ @"projectId": @"", @"querySpec": @{ @"rawQuery": @"" }, @"tableSpec": @{ @"datasetId": @"", @"tableId": @"", @"tableProjectId": @"" } }, @"parameters": @[ @{ @"name": @"", @"namedRangeId": @"", @"range": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 } } ] } } ],
@"developerMetadata": @[ @{ @"location": @{ @"dimensionRange": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataId": @0, @"metadataKey": @"", @"metadataValue": @"", @"visibility": @"" } ],
@"namedRanges": @[ @{ @"name": @"", @"namedRangeId": @"", @"range": @{ } } ],
@"properties": @{ @"autoRecalc": @"", @"defaultFormat": @{ @"backgroundColor": @{ @"alpha": @"", @"blue": @"", @"green": @"", @"red": @"" }, @"backgroundColorStyle": @{ @"rgbColor": @{ }, @"themeColor": @"" }, @"borders": @{ @"bottom": @{ @"color": @{ }, @"colorStyle": @{ }, @"style": @"", @"width": @0 }, @"left": @{ }, @"right": @{ }, @"top": @{ } }, @"horizontalAlignment": @"", @"hyperlinkDisplayType": @"", @"numberFormat": @{ @"pattern": @"", @"type": @"" }, @"padding": @{ @"bottom": @0, @"left": @0, @"right": @0, @"top": @0 }, @"textDirection": @"", @"textFormat": @{ @"bold": @NO, @"fontFamily": @"", @"fontSize": @0, @"foregroundColor": @{ }, @"foregroundColorStyle": @{ }, @"italic": @NO, @"link": @{ @"uri": @"" }, @"strikethrough": @NO, @"underline": @NO }, @"textRotation": @{ @"angle": @0, @"vertical": @NO }, @"verticalAlignment": @"", @"wrapStrategy": @"" }, @"iterativeCalculationSettings": @{ @"convergenceThreshold": @"", @"maxIterations": @0 }, @"locale": @"", @"spreadsheetTheme": @{ @"primaryFontFamily": @"", @"themeColors": @[ @{ @"color": @{ }, @"colorType": @"" } ] }, @"timeZone": @"", @"title": @"" },
@"sheets": @[ @{ @"bandedRanges": @[ @{ @"bandedRangeId": @0, @"columnProperties": @{ @"firstBandColor": @{ }, @"firstBandColorStyle": @{ }, @"footerColor": @{ }, @"footerColorStyle": @{ }, @"headerColor": @{ }, @"headerColorStyle": @{ }, @"secondBandColor": @{ }, @"secondBandColorStyle": @{ } }, @"range": @{ }, @"rowProperties": @{ } } ], @"basicFilter": @{ @"criteria": @{ }, @"filterSpecs": @[ @{ @"columnIndex": @0, @"dataSourceColumnReference": @{ }, @"filterCriteria": @{ @"condition": @{ @"type": @"", @"values": @[ @{ @"relativeDate": @"", @"userEnteredValue": @"" } ] }, @"hiddenValues": @[ ], @"visibleBackgroundColor": @{ }, @"visibleBackgroundColorStyle": @{ }, @"visibleForegroundColor": @{ }, @"visibleForegroundColorStyle": @{ } } } ], @"range": @{ }, @"sortSpecs": @[ @{ @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"dataSourceColumnReference": @{ }, @"dimensionIndex": @0, @"foregroundColor": @{ }, @"foregroundColorStyle": @{ }, @"sortOrder": @"" } ] }, @"charts": @[ @{ @"border": @{ @"color": @{ }, @"colorStyle": @{ } }, @"chartId": @0, @"position": @{ @"newSheet": @NO, @"overlayPosition": @{ @"anchorCell": @{ @"columnIndex": @0, @"rowIndex": @0, @"sheetId": @0 }, @"heightPixels": @0, @"offsetXPixels": @0, @"offsetYPixels": @0, @"widthPixels": @0 }, @"sheetId": @0 }, @"spec": @{ @"altText": @"", @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"basicChart": @{ @"axis": @[ @{ @"format": @{ }, @"position": @"", @"title": @"", @"titleTextPosition": @{ @"horizontalAlignment": @"" }, @"viewWindowOptions": @{ @"viewWindowMax": @"", @"viewWindowMin": @"", @"viewWindowMode": @"" } } ], @"chartType": @"", @"compareMode": @"", @"domains": @[ @{ @"domain": @{ @"aggregateType": @"", @"columnReference": @{ }, @"groupRule": @{ @"dateTimeRule": @{ @"type": @"" }, @"histogramRule": @{ @"intervalSize": @"", @"maxValue": @"", @"minValue": @"" } }, @"sourceRange": @{ @"sources": @[ @{ } ] } }, @"reversed": @NO } ], @"headerCount": @0, @"interpolateNulls": @NO, @"legendPosition": @"", @"lineSmoothing": @NO, @"series": @[ @{ @"color": @{ }, @"colorStyle": @{ }, @"dataLabel": @{ @"customLabelData": @{ }, @"placement": @"", @"textFormat": @{ }, @"type": @"" }, @"lineStyle": @{ @"type": @"", @"width": @0 }, @"pointStyle": @{ @"shape": @"", @"size": @"" }, @"series": @{ }, @"styleOverrides": @[ @{ @"color": @{ }, @"colorStyle": @{ }, @"index": @0, @"pointStyle": @{ } } ], @"targetAxis": @"", @"type": @"" } ], @"stackedType": @"", @"threeDimensional": @NO, @"totalDataLabel": @{ } }, @"bubbleChart": @{ @"bubbleBorderColor": @{ }, @"bubbleBorderColorStyle": @{ }, @"bubbleLabels": @{ }, @"bubbleMaxRadiusSize": @0, @"bubbleMinRadiusSize": @0, @"bubbleOpacity": @"", @"bubbleSizes": @{ }, @"bubbleTextStyle": @{ }, @"domain": @{ }, @"groupIds": @{ }, @"legendPosition": @"", @"series": @{ } }, @"candlestickChart": @{ @"data": @[ @{ @"closeSeries": @{ @"data": @{ } }, @"highSeries": @{ }, @"lowSeries": @{ }, @"openSeries": @{ } } ], @"domain": @{ @"data": @{ }, @"reversed": @NO } }, @"dataSourceChartProperties": @{ @"dataExecutionStatus": @{ @"errorCode": @"", @"errorMessage": @"", @"lastRefreshTime": @"", @"state": @"" }, @"dataSourceId": @"" }, @"filterSpecs": @[ @{ } ], @"fontName": @"", @"hiddenDimensionStrategy": @"", @"histogramChart": @{ @"bucketSize": @"", @"legendPosition": @"", @"outlierPercentile": @"", @"series": @[ @{ @"barColor": @{ }, @"barColorStyle": @{ }, @"data": @{ } } ], @"showItemDividers": @NO }, @"maximized": @NO, @"orgChart": @{ @"labels": @{ }, @"nodeColor": @{ }, @"nodeColorStyle": @{ }, @"nodeSize": @"", @"parentLabels": @{ }, @"selectedNodeColor": @{ }, @"selectedNodeColorStyle": @{ }, @"tooltips": @{ } }, @"pieChart": @{ @"domain": @{ }, @"legendPosition": @"", @"pieHole": @"", @"series": @{ }, @"threeDimensional": @NO }, @"scorecardChart": @{ @"aggregateType": @"", @"baselineValueData": @{ }, @"baselineValueFormat": @{ @"comparisonType": @"", @"description": @"", @"negativeColor": @{ }, @"negativeColorStyle": @{ }, @"position": @{ }, @"positiveColor": @{ }, @"positiveColorStyle": @{ }, @"textFormat": @{ } }, @"customFormatOptions": @{ @"prefix": @"", @"suffix": @"" }, @"keyValueData": @{ }, @"keyValueFormat": @{ @"position": @{ }, @"textFormat": @{ } }, @"numberFormatSource": @"", @"scaleFactor": @"" }, @"sortSpecs": @[ @{ } ], @"subtitle": @"", @"subtitleTextFormat": @{ }, @"subtitleTextPosition": @{ }, @"title": @"", @"titleTextFormat": @{ }, @"titleTextPosition": @{ }, @"treemapChart": @{ @"colorData": @{ }, @"colorScale": @{ @"maxValueColor": @{ }, @"maxValueColorStyle": @{ }, @"midValueColor": @{ }, @"midValueColorStyle": @{ }, @"minValueColor": @{ }, @"minValueColorStyle": @{ }, @"noDataColor": @{ }, @"noDataColorStyle": @{ } }, @"headerColor": @{ }, @"headerColorStyle": @{ }, @"hideTooltips": @NO, @"hintedLevels": @0, @"labels": @{ }, @"levels": @0, @"maxValue": @"", @"minValue": @"", @"parentLabels": @{ }, @"sizeData": @{ }, @"textFormat": @{ } }, @"waterfallChart": @{ @"connectorLineStyle": @{ }, @"domain": @{ @"data": @{ }, @"reversed": @NO }, @"firstValueIsTotal": @NO, @"hideConnectorLines": @NO, @"series": @[ @{ @"customSubtotals": @[ @{ @"dataIsSubtotal": @NO, @"label": @"", @"subtotalIndex": @0 } ], @"data": @{ }, @"dataLabel": @{ }, @"hideTrailingSubtotal": @NO, @"negativeColumnsStyle": @{ @"color": @{ }, @"colorStyle": @{ }, @"label": @"" }, @"positiveColumnsStyle": @{ }, @"subtotalColumnsStyle": @{ } } ], @"stackedType": @"", @"totalDataLabel": @{ } } } } ], @"columnGroups": @[ @{ @"collapsed": @NO, @"depth": @0, @"range": @{ } } ], @"conditionalFormats": @[ @{ @"booleanRule": @{ @"condition": @{ }, @"format": @{ } }, @"gradientRule": @{ @"maxpoint": @{ @"color": @{ }, @"colorStyle": @{ }, @"type": @"", @"value": @"" }, @"midpoint": @{ }, @"minpoint": @{ } }, @"ranges": @[ @{ } ] } ], @"data": @[ @{ @"columnMetadata": @[ @{ @"dataSourceColumnReference": @{ }, @"developerMetadata": @[ @{ } ], @"hiddenByFilter": @NO, @"hiddenByUser": @NO, @"pixelSize": @0 } ], @"rowData": @[ @{ @"values": @[ @{ @"dataSourceFormula": @{ @"dataExecutionStatus": @{ }, @"dataSourceId": @"" }, @"dataSourceTable": @{ @"columnSelectionType": @"", @"columns": @[ @{ } ], @"dataExecutionStatus": @{ }, @"dataSourceId": @"", @"filterSpecs": @[ @{ } ], @"rowLimit": @0, @"sortSpecs": @[ @{ } ] }, @"dataValidation": @{ @"condition": @{ }, @"inputMessage": @"", @"showCustomUi": @NO, @"strict": @NO }, @"effectiveFormat": @{ }, @"effectiveValue": @{ @"boolValue": @NO, @"errorValue": @{ @"message": @"", @"type": @"" }, @"formulaValue": @"", @"numberValue": @"", @"stringValue": @"" }, @"formattedValue": @"", @"hyperlink": @"", @"note": @"", @"pivotTable": @{ @"columns": @[ @{ @"dataSourceColumnReference": @{ }, @"groupLimit": @{ @"applyOrder": @0, @"countLimit": @0 }, @"groupRule": @{ @"dateTimeRule": @{ @"type": @"" }, @"histogramRule": @{ @"end": @"", @"interval": @"", @"start": @"" }, @"manualRule": @{ @"groups": @[ @{ @"groupName": @{ }, @"items": @[ @{ } ] } ] } }, @"label": @"", @"repeatHeadings": @NO, @"showTotals": @NO, @"sortOrder": @"", @"sourceColumnOffset": @0, @"valueBucket": @{ @"buckets": @[ @{ } ], @"valuesIndex": @0 }, @"valueMetadata": @[ @{ @"collapsed": @NO, @"value": @{ } } ] } ], @"criteria": @{ }, @"dataExecutionStatus": @{ }, @"dataSourceId": @"", @"filterSpecs": @[ @{ @"columnOffsetIndex": @0, @"dataSourceColumnReference": @{ }, @"filterCriteria": @{ @"condition": @{ }, @"visibleByDefault": @NO, @"visibleValues": @[ ] } } ], @"rows": @[ @{ } ], @"source": @{ }, @"valueLayout": @"", @"values": @[ @{ @"calculatedDisplayType": @"", @"dataSourceColumnReference": @{ }, @"formula": @"", @"name": @"", @"sourceColumnOffset": @0, @"summarizeFunction": @"" } ] }, @"textFormatRuns": @[ @{ @"format": @{ }, @"startIndex": @0 } ], @"userEnteredFormat": @{ }, @"userEnteredValue": @{ } } ] } ], @"rowMetadata": @[ @{ } ], @"startColumn": @0, @"startRow": @0 } ], @"developerMetadata": @[ @{ } ], @"filterViews": @[ @{ @"criteria": @{ }, @"filterSpecs": @[ @{ } ], @"filterViewId": @0, @"namedRangeId": @"", @"range": @{ }, @"sortSpecs": @[ @{ } ], @"title": @"" } ], @"merges": @[ @{ } ], @"properties": @{ @"dataSourceSheetProperties": @{ @"columns": @[ @{ } ], @"dataExecutionStatus": @{ }, @"dataSourceId": @"" }, @"gridProperties": @{ @"columnCount": @0, @"columnGroupControlAfter": @NO, @"frozenColumnCount": @0, @"frozenRowCount": @0, @"hideGridlines": @NO, @"rowCount": @0, @"rowGroupControlAfter": @NO }, @"hidden": @NO, @"index": @0, @"rightToLeft": @NO, @"sheetId": @0, @"sheetType": @"", @"tabColor": @{ }, @"tabColorStyle": @{ }, @"title": @"" }, @"protectedRanges": @[ @{ @"description": @"", @"editors": @{ @"domainUsersCanEdit": @NO, @"groups": @[ ], @"users": @[ ] }, @"namedRangeId": @"", @"protectedRangeId": @0, @"range": @{ }, @"requestingUserCanEdit": @NO, @"unprotectedRanges": @[ @{ } ], @"warningOnly": @NO } ], @"rowGroups": @[ @{ } ], @"slicers": @[ @{ @"position": @{ }, @"slicerId": @0, @"spec": @{ @"applyToPivotTables": @NO, @"backgroundColor": @{ }, @"backgroundColorStyle": @{ }, @"columnIndex": @0, @"dataRange": @{ }, @"filterCriteria": @{ }, @"horizontalAlignment": @"", @"textFormat": @{ }, @"title": @"" } } ] } ],
@"spreadsheetId": @"",
@"spreadsheetUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataSourceSchedules' => [
[
'dailySchedule' => [
'startTime' => [
'hours' => 0,
'minutes' => 0,
'nanos' => 0,
'seconds' => 0
]
],
'enabled' => null,
'monthlySchedule' => [
'daysOfMonth' => [
],
'startTime' => [
]
],
'nextRun' => [
'endTime' => '',
'startTime' => ''
],
'refreshScope' => '',
'weeklySchedule' => [
'daysOfWeek' => [
],
'startTime' => [
]
]
]
],
'dataSources' => [
[
'calculatedColumns' => [
[
'formula' => '',
'reference' => [
'name' => ''
]
]
],
'dataSourceId' => '',
'sheetId' => 0,
'spec' => [
'bigQuery' => [
'projectId' => '',
'querySpec' => [
'rawQuery' => ''
],
'tableSpec' => [
'datasetId' => '',
'tableId' => '',
'tableProjectId' => ''
]
],
'parameters' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]
]
],
'developerMetadata' => [
[
'location' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataId' => 0,
'metadataKey' => '',
'metadataValue' => '',
'visibility' => ''
]
],
'namedRanges' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
],
'properties' => [
'autoRecalc' => '',
'defaultFormat' => [
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'backgroundColorStyle' => [
'rgbColor' => [
],
'themeColor' => ''
],
'borders' => [
'bottom' => [
'color' => [
],
'colorStyle' => [
],
'style' => '',
'width' => 0
],
'left' => [
],
'right' => [
],
'top' => [
]
],
'horizontalAlignment' => '',
'hyperlinkDisplayType' => '',
'numberFormat' => [
'pattern' => '',
'type' => ''
],
'padding' => [
'bottom' => 0,
'left' => 0,
'right' => 0,
'top' => 0
],
'textDirection' => '',
'textFormat' => [
'bold' => null,
'fontFamily' => '',
'fontSize' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'italic' => null,
'link' => [
'uri' => ''
],
'strikethrough' => null,
'underline' => null
],
'textRotation' => [
'angle' => 0,
'vertical' => null
],
'verticalAlignment' => '',
'wrapStrategy' => ''
],
'iterativeCalculationSettings' => [
'convergenceThreshold' => '',
'maxIterations' => 0
],
'locale' => '',
'spreadsheetTheme' => [
'primaryFontFamily' => '',
'themeColors' => [
[
'color' => [
],
'colorType' => ''
]
]
],
'timeZone' => '',
'title' => ''
],
'sheets' => [
[
'bandedRanges' => [
[
'bandedRangeId' => 0,
'columnProperties' => [
'firstBandColor' => [
],
'firstBandColorStyle' => [
],
'footerColor' => [
],
'footerColorStyle' => [
],
'headerColor' => [
],
'headerColorStyle' => [
],
'secondBandColor' => [
],
'secondBandColorStyle' => [
]
],
'range' => [
],
'rowProperties' => [
]
]
],
'basicFilter' => [
'criteria' => [
],
'filterSpecs' => [
[
'columnIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
'type' => '',
'values' => [
[
'relativeDate' => '',
'userEnteredValue' => ''
]
]
],
'hiddenValues' => [
],
'visibleBackgroundColor' => [
],
'visibleBackgroundColorStyle' => [
],
'visibleForegroundColor' => [
],
'visibleForegroundColorStyle' => [
]
]
]
],
'range' => [
],
'sortSpecs' => [
[
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'dataSourceColumnReference' => [
],
'dimensionIndex' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'sortOrder' => ''
]
]
],
'charts' => [
[
'border' => [
'color' => [
],
'colorStyle' => [
]
],
'chartId' => 0,
'position' => [
'newSheet' => null,
'overlayPosition' => [
'anchorCell' => [
'columnIndex' => 0,
'rowIndex' => 0,
'sheetId' => 0
],
'heightPixels' => 0,
'offsetXPixels' => 0,
'offsetYPixels' => 0,
'widthPixels' => 0
],
'sheetId' => 0
],
'spec' => [
'altText' => '',
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'basicChart' => [
'axis' => [
[
'format' => [
],
'position' => '',
'title' => '',
'titleTextPosition' => [
'horizontalAlignment' => ''
],
'viewWindowOptions' => [
'viewWindowMax' => '',
'viewWindowMin' => '',
'viewWindowMode' => ''
]
]
],
'chartType' => '',
'compareMode' => '',
'domains' => [
[
'domain' => [
'aggregateType' => '',
'columnReference' => [
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'intervalSize' => '',
'maxValue' => '',
'minValue' => ''
]
],
'sourceRange' => [
'sources' => [
[
]
]
]
],
'reversed' => null
]
],
'headerCount' => 0,
'interpolateNulls' => null,
'legendPosition' => '',
'lineSmoothing' => null,
'series' => [
[
'color' => [
],
'colorStyle' => [
],
'dataLabel' => [
'customLabelData' => [
],
'placement' => '',
'textFormat' => [
],
'type' => ''
],
'lineStyle' => [
'type' => '',
'width' => 0
],
'pointStyle' => [
'shape' => '',
'size' => ''
],
'series' => [
],
'styleOverrides' => [
[
'color' => [
],
'colorStyle' => [
],
'index' => 0,
'pointStyle' => [
]
]
],
'targetAxis' => '',
'type' => ''
]
],
'stackedType' => '',
'threeDimensional' => null,
'totalDataLabel' => [
]
],
'bubbleChart' => [
'bubbleBorderColor' => [
],
'bubbleBorderColorStyle' => [
],
'bubbleLabels' => [
],
'bubbleMaxRadiusSize' => 0,
'bubbleMinRadiusSize' => 0,
'bubbleOpacity' => '',
'bubbleSizes' => [
],
'bubbleTextStyle' => [
],
'domain' => [
],
'groupIds' => [
],
'legendPosition' => '',
'series' => [
]
],
'candlestickChart' => [
'data' => [
[
'closeSeries' => [
'data' => [
]
],
'highSeries' => [
],
'lowSeries' => [
],
'openSeries' => [
]
]
],
'domain' => [
'data' => [
],
'reversed' => null
]
],
'dataSourceChartProperties' => [
'dataExecutionStatus' => [
'errorCode' => '',
'errorMessage' => '',
'lastRefreshTime' => '',
'state' => ''
],
'dataSourceId' => ''
],
'filterSpecs' => [
[
]
],
'fontName' => '',
'hiddenDimensionStrategy' => '',
'histogramChart' => [
'bucketSize' => '',
'legendPosition' => '',
'outlierPercentile' => '',
'series' => [
[
'barColor' => [
],
'barColorStyle' => [
],
'data' => [
]
]
],
'showItemDividers' => null
],
'maximized' => null,
'orgChart' => [
'labels' => [
],
'nodeColor' => [
],
'nodeColorStyle' => [
],
'nodeSize' => '',
'parentLabels' => [
],
'selectedNodeColor' => [
],
'selectedNodeColorStyle' => [
],
'tooltips' => [
]
],
'pieChart' => [
'domain' => [
],
'legendPosition' => '',
'pieHole' => '',
'series' => [
],
'threeDimensional' => null
],
'scorecardChart' => [
'aggregateType' => '',
'baselineValueData' => [
],
'baselineValueFormat' => [
'comparisonType' => '',
'description' => '',
'negativeColor' => [
],
'negativeColorStyle' => [
],
'position' => [
],
'positiveColor' => [
],
'positiveColorStyle' => [
],
'textFormat' => [
]
],
'customFormatOptions' => [
'prefix' => '',
'suffix' => ''
],
'keyValueData' => [
],
'keyValueFormat' => [
'position' => [
],
'textFormat' => [
]
],
'numberFormatSource' => '',
'scaleFactor' => ''
],
'sortSpecs' => [
[
]
],
'subtitle' => '',
'subtitleTextFormat' => [
],
'subtitleTextPosition' => [
],
'title' => '',
'titleTextFormat' => [
],
'titleTextPosition' => [
],
'treemapChart' => [
'colorData' => [
],
'colorScale' => [
'maxValueColor' => [
],
'maxValueColorStyle' => [
],
'midValueColor' => [
],
'midValueColorStyle' => [
],
'minValueColor' => [
],
'minValueColorStyle' => [
],
'noDataColor' => [
],
'noDataColorStyle' => [
]
],
'headerColor' => [
],
'headerColorStyle' => [
],
'hideTooltips' => null,
'hintedLevels' => 0,
'labels' => [
],
'levels' => 0,
'maxValue' => '',
'minValue' => '',
'parentLabels' => [
],
'sizeData' => [
],
'textFormat' => [
]
],
'waterfallChart' => [
'connectorLineStyle' => [
],
'domain' => [
'data' => [
],
'reversed' => null
],
'firstValueIsTotal' => null,
'hideConnectorLines' => null,
'series' => [
[
'customSubtotals' => [
[
'dataIsSubtotal' => null,
'label' => '',
'subtotalIndex' => 0
]
],
'data' => [
],
'dataLabel' => [
],
'hideTrailingSubtotal' => null,
'negativeColumnsStyle' => [
'color' => [
],
'colorStyle' => [
],
'label' => ''
],
'positiveColumnsStyle' => [
],
'subtotalColumnsStyle' => [
]
]
],
'stackedType' => '',
'totalDataLabel' => [
]
]
]
]
],
'columnGroups' => [
[
'collapsed' => null,
'depth' => 0,
'range' => [
]
]
],
'conditionalFormats' => [
[
'booleanRule' => [
'condition' => [
],
'format' => [
]
],
'gradientRule' => [
'maxpoint' => [
'color' => [
],
'colorStyle' => [
],
'type' => '',
'value' => ''
],
'midpoint' => [
],
'minpoint' => [
]
],
'ranges' => [
[
]
]
]
],
'data' => [
[
'columnMetadata' => [
[
'dataSourceColumnReference' => [
],
'developerMetadata' => [
[
]
],
'hiddenByFilter' => null,
'hiddenByUser' => null,
'pixelSize' => 0
]
],
'rowData' => [
[
'values' => [
[
'dataSourceFormula' => [
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'dataSourceTable' => [
'columnSelectionType' => '',
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
]
],
'rowLimit' => 0,
'sortSpecs' => [
[
]
]
],
'dataValidation' => [
'condition' => [
],
'inputMessage' => '',
'showCustomUi' => null,
'strict' => null
],
'effectiveFormat' => [
],
'effectiveValue' => [
'boolValue' => null,
'errorValue' => [
'message' => '',
'type' => ''
],
'formulaValue' => '',
'numberValue' => '',
'stringValue' => ''
],
'formattedValue' => '',
'hyperlink' => '',
'note' => '',
'pivotTable' => [
'columns' => [
[
'dataSourceColumnReference' => [
],
'groupLimit' => [
'applyOrder' => 0,
'countLimit' => 0
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'end' => '',
'interval' => '',
'start' => ''
],
'manualRule' => [
'groups' => [
[
'groupName' => [
],
'items' => [
[
]
]
]
]
]
],
'label' => '',
'repeatHeadings' => null,
'showTotals' => null,
'sortOrder' => '',
'sourceColumnOffset' => 0,
'valueBucket' => [
'buckets' => [
[
]
],
'valuesIndex' => 0
],
'valueMetadata' => [
[
'collapsed' => null,
'value' => [
]
]
]
]
],
'criteria' => [
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
'columnOffsetIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
],
'visibleByDefault' => null,
'visibleValues' => [
]
]
]
],
'rows' => [
[
]
],
'source' => [
],
'valueLayout' => '',
'values' => [
[
'calculatedDisplayType' => '',
'dataSourceColumnReference' => [
],
'formula' => '',
'name' => '',
'sourceColumnOffset' => 0,
'summarizeFunction' => ''
]
]
],
'textFormatRuns' => [
[
'format' => [
],
'startIndex' => 0
]
],
'userEnteredFormat' => [
],
'userEnteredValue' => [
]
]
]
]
],
'rowMetadata' => [
[
]
],
'startColumn' => 0,
'startRow' => 0
]
],
'developerMetadata' => [
[
]
],
'filterViews' => [
[
'criteria' => [
],
'filterSpecs' => [
[
]
],
'filterViewId' => 0,
'namedRangeId' => '',
'range' => [
],
'sortSpecs' => [
[
]
],
'title' => ''
]
],
'merges' => [
[
]
],
'properties' => [
'dataSourceSheetProperties' => [
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'gridProperties' => [
'columnCount' => 0,
'columnGroupControlAfter' => null,
'frozenColumnCount' => 0,
'frozenRowCount' => 0,
'hideGridlines' => null,
'rowCount' => 0,
'rowGroupControlAfter' => null
],
'hidden' => null,
'index' => 0,
'rightToLeft' => null,
'sheetId' => 0,
'sheetType' => '',
'tabColor' => [
],
'tabColorStyle' => [
],
'title' => ''
],
'protectedRanges' => [
[
'description' => '',
'editors' => [
'domainUsersCanEdit' => null,
'groups' => [
],
'users' => [
]
],
'namedRangeId' => '',
'protectedRangeId' => 0,
'range' => [
],
'requestingUserCanEdit' => null,
'unprotectedRanges' => [
[
]
],
'warningOnly' => null
]
],
'rowGroups' => [
[
]
],
'slicers' => [
[
'position' => [
],
'slicerId' => 0,
'spec' => [
'applyToPivotTables' => null,
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'columnIndex' => 0,
'dataRange' => [
],
'filterCriteria' => [
],
'horizontalAlignment' => '',
'textFormat' => [
],
'title' => ''
]
]
]
]
],
'spreadsheetId' => '',
'spreadsheetUrl' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets', [
'body' => '{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dataSourceSchedules' => [
[
'dailySchedule' => [
'startTime' => [
'hours' => 0,
'minutes' => 0,
'nanos' => 0,
'seconds' => 0
]
],
'enabled' => null,
'monthlySchedule' => [
'daysOfMonth' => [
],
'startTime' => [
]
],
'nextRun' => [
'endTime' => '',
'startTime' => ''
],
'refreshScope' => '',
'weeklySchedule' => [
'daysOfWeek' => [
],
'startTime' => [
]
]
]
],
'dataSources' => [
[
'calculatedColumns' => [
[
'formula' => '',
'reference' => [
'name' => ''
]
]
],
'dataSourceId' => '',
'sheetId' => 0,
'spec' => [
'bigQuery' => [
'projectId' => '',
'querySpec' => [
'rawQuery' => ''
],
'tableSpec' => [
'datasetId' => '',
'tableId' => '',
'tableProjectId' => ''
]
],
'parameters' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]
]
],
'developerMetadata' => [
[
'location' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataId' => 0,
'metadataKey' => '',
'metadataValue' => '',
'visibility' => ''
]
],
'namedRanges' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
],
'properties' => [
'autoRecalc' => '',
'defaultFormat' => [
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'backgroundColorStyle' => [
'rgbColor' => [
],
'themeColor' => ''
],
'borders' => [
'bottom' => [
'color' => [
],
'colorStyle' => [
],
'style' => '',
'width' => 0
],
'left' => [
],
'right' => [
],
'top' => [
]
],
'horizontalAlignment' => '',
'hyperlinkDisplayType' => '',
'numberFormat' => [
'pattern' => '',
'type' => ''
],
'padding' => [
'bottom' => 0,
'left' => 0,
'right' => 0,
'top' => 0
],
'textDirection' => '',
'textFormat' => [
'bold' => null,
'fontFamily' => '',
'fontSize' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'italic' => null,
'link' => [
'uri' => ''
],
'strikethrough' => null,
'underline' => null
],
'textRotation' => [
'angle' => 0,
'vertical' => null
],
'verticalAlignment' => '',
'wrapStrategy' => ''
],
'iterativeCalculationSettings' => [
'convergenceThreshold' => '',
'maxIterations' => 0
],
'locale' => '',
'spreadsheetTheme' => [
'primaryFontFamily' => '',
'themeColors' => [
[
'color' => [
],
'colorType' => ''
]
]
],
'timeZone' => '',
'title' => ''
],
'sheets' => [
[
'bandedRanges' => [
[
'bandedRangeId' => 0,
'columnProperties' => [
'firstBandColor' => [
],
'firstBandColorStyle' => [
],
'footerColor' => [
],
'footerColorStyle' => [
],
'headerColor' => [
],
'headerColorStyle' => [
],
'secondBandColor' => [
],
'secondBandColorStyle' => [
]
],
'range' => [
],
'rowProperties' => [
]
]
],
'basicFilter' => [
'criteria' => [
],
'filterSpecs' => [
[
'columnIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
'type' => '',
'values' => [
[
'relativeDate' => '',
'userEnteredValue' => ''
]
]
],
'hiddenValues' => [
],
'visibleBackgroundColor' => [
],
'visibleBackgroundColorStyle' => [
],
'visibleForegroundColor' => [
],
'visibleForegroundColorStyle' => [
]
]
]
],
'range' => [
],
'sortSpecs' => [
[
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'dataSourceColumnReference' => [
],
'dimensionIndex' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'sortOrder' => ''
]
]
],
'charts' => [
[
'border' => [
'color' => [
],
'colorStyle' => [
]
],
'chartId' => 0,
'position' => [
'newSheet' => null,
'overlayPosition' => [
'anchorCell' => [
'columnIndex' => 0,
'rowIndex' => 0,
'sheetId' => 0
],
'heightPixels' => 0,
'offsetXPixels' => 0,
'offsetYPixels' => 0,
'widthPixels' => 0
],
'sheetId' => 0
],
'spec' => [
'altText' => '',
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'basicChart' => [
'axis' => [
[
'format' => [
],
'position' => '',
'title' => '',
'titleTextPosition' => [
'horizontalAlignment' => ''
],
'viewWindowOptions' => [
'viewWindowMax' => '',
'viewWindowMin' => '',
'viewWindowMode' => ''
]
]
],
'chartType' => '',
'compareMode' => '',
'domains' => [
[
'domain' => [
'aggregateType' => '',
'columnReference' => [
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'intervalSize' => '',
'maxValue' => '',
'minValue' => ''
]
],
'sourceRange' => [
'sources' => [
[
]
]
]
],
'reversed' => null
]
],
'headerCount' => 0,
'interpolateNulls' => null,
'legendPosition' => '',
'lineSmoothing' => null,
'series' => [
[
'color' => [
],
'colorStyle' => [
],
'dataLabel' => [
'customLabelData' => [
],
'placement' => '',
'textFormat' => [
],
'type' => ''
],
'lineStyle' => [
'type' => '',
'width' => 0
],
'pointStyle' => [
'shape' => '',
'size' => ''
],
'series' => [
],
'styleOverrides' => [
[
'color' => [
],
'colorStyle' => [
],
'index' => 0,
'pointStyle' => [
]
]
],
'targetAxis' => '',
'type' => ''
]
],
'stackedType' => '',
'threeDimensional' => null,
'totalDataLabel' => [
]
],
'bubbleChart' => [
'bubbleBorderColor' => [
],
'bubbleBorderColorStyle' => [
],
'bubbleLabels' => [
],
'bubbleMaxRadiusSize' => 0,
'bubbleMinRadiusSize' => 0,
'bubbleOpacity' => '',
'bubbleSizes' => [
],
'bubbleTextStyle' => [
],
'domain' => [
],
'groupIds' => [
],
'legendPosition' => '',
'series' => [
]
],
'candlestickChart' => [
'data' => [
[
'closeSeries' => [
'data' => [
]
],
'highSeries' => [
],
'lowSeries' => [
],
'openSeries' => [
]
]
],
'domain' => [
'data' => [
],
'reversed' => null
]
],
'dataSourceChartProperties' => [
'dataExecutionStatus' => [
'errorCode' => '',
'errorMessage' => '',
'lastRefreshTime' => '',
'state' => ''
],
'dataSourceId' => ''
],
'filterSpecs' => [
[
]
],
'fontName' => '',
'hiddenDimensionStrategy' => '',
'histogramChart' => [
'bucketSize' => '',
'legendPosition' => '',
'outlierPercentile' => '',
'series' => [
[
'barColor' => [
],
'barColorStyle' => [
],
'data' => [
]
]
],
'showItemDividers' => null
],
'maximized' => null,
'orgChart' => [
'labels' => [
],
'nodeColor' => [
],
'nodeColorStyle' => [
],
'nodeSize' => '',
'parentLabels' => [
],
'selectedNodeColor' => [
],
'selectedNodeColorStyle' => [
],
'tooltips' => [
]
],
'pieChart' => [
'domain' => [
],
'legendPosition' => '',
'pieHole' => '',
'series' => [
],
'threeDimensional' => null
],
'scorecardChart' => [
'aggregateType' => '',
'baselineValueData' => [
],
'baselineValueFormat' => [
'comparisonType' => '',
'description' => '',
'negativeColor' => [
],
'negativeColorStyle' => [
],
'position' => [
],
'positiveColor' => [
],
'positiveColorStyle' => [
],
'textFormat' => [
]
],
'customFormatOptions' => [
'prefix' => '',
'suffix' => ''
],
'keyValueData' => [
],
'keyValueFormat' => [
'position' => [
],
'textFormat' => [
]
],
'numberFormatSource' => '',
'scaleFactor' => ''
],
'sortSpecs' => [
[
]
],
'subtitle' => '',
'subtitleTextFormat' => [
],
'subtitleTextPosition' => [
],
'title' => '',
'titleTextFormat' => [
],
'titleTextPosition' => [
],
'treemapChart' => [
'colorData' => [
],
'colorScale' => [
'maxValueColor' => [
],
'maxValueColorStyle' => [
],
'midValueColor' => [
],
'midValueColorStyle' => [
],
'minValueColor' => [
],
'minValueColorStyle' => [
],
'noDataColor' => [
],
'noDataColorStyle' => [
]
],
'headerColor' => [
],
'headerColorStyle' => [
],
'hideTooltips' => null,
'hintedLevels' => 0,
'labels' => [
],
'levels' => 0,
'maxValue' => '',
'minValue' => '',
'parentLabels' => [
],
'sizeData' => [
],
'textFormat' => [
]
],
'waterfallChart' => [
'connectorLineStyle' => [
],
'domain' => [
'data' => [
],
'reversed' => null
],
'firstValueIsTotal' => null,
'hideConnectorLines' => null,
'series' => [
[
'customSubtotals' => [
[
'dataIsSubtotal' => null,
'label' => '',
'subtotalIndex' => 0
]
],
'data' => [
],
'dataLabel' => [
],
'hideTrailingSubtotal' => null,
'negativeColumnsStyle' => [
'color' => [
],
'colorStyle' => [
],
'label' => ''
],
'positiveColumnsStyle' => [
],
'subtotalColumnsStyle' => [
]
]
],
'stackedType' => '',
'totalDataLabel' => [
]
]
]
]
],
'columnGroups' => [
[
'collapsed' => null,
'depth' => 0,
'range' => [
]
]
],
'conditionalFormats' => [
[
'booleanRule' => [
'condition' => [
],
'format' => [
]
],
'gradientRule' => [
'maxpoint' => [
'color' => [
],
'colorStyle' => [
],
'type' => '',
'value' => ''
],
'midpoint' => [
],
'minpoint' => [
]
],
'ranges' => [
[
]
]
]
],
'data' => [
[
'columnMetadata' => [
[
'dataSourceColumnReference' => [
],
'developerMetadata' => [
[
]
],
'hiddenByFilter' => null,
'hiddenByUser' => null,
'pixelSize' => 0
]
],
'rowData' => [
[
'values' => [
[
'dataSourceFormula' => [
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'dataSourceTable' => [
'columnSelectionType' => '',
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
]
],
'rowLimit' => 0,
'sortSpecs' => [
[
]
]
],
'dataValidation' => [
'condition' => [
],
'inputMessage' => '',
'showCustomUi' => null,
'strict' => null
],
'effectiveFormat' => [
],
'effectiveValue' => [
'boolValue' => null,
'errorValue' => [
'message' => '',
'type' => ''
],
'formulaValue' => '',
'numberValue' => '',
'stringValue' => ''
],
'formattedValue' => '',
'hyperlink' => '',
'note' => '',
'pivotTable' => [
'columns' => [
[
'dataSourceColumnReference' => [
],
'groupLimit' => [
'applyOrder' => 0,
'countLimit' => 0
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'end' => '',
'interval' => '',
'start' => ''
],
'manualRule' => [
'groups' => [
[
'groupName' => [
],
'items' => [
[
]
]
]
]
]
],
'label' => '',
'repeatHeadings' => null,
'showTotals' => null,
'sortOrder' => '',
'sourceColumnOffset' => 0,
'valueBucket' => [
'buckets' => [
[
]
],
'valuesIndex' => 0
],
'valueMetadata' => [
[
'collapsed' => null,
'value' => [
]
]
]
]
],
'criteria' => [
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
'columnOffsetIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
],
'visibleByDefault' => null,
'visibleValues' => [
]
]
]
],
'rows' => [
[
]
],
'source' => [
],
'valueLayout' => '',
'values' => [
[
'calculatedDisplayType' => '',
'dataSourceColumnReference' => [
],
'formula' => '',
'name' => '',
'sourceColumnOffset' => 0,
'summarizeFunction' => ''
]
]
],
'textFormatRuns' => [
[
'format' => [
],
'startIndex' => 0
]
],
'userEnteredFormat' => [
],
'userEnteredValue' => [
]
]
]
]
],
'rowMetadata' => [
[
]
],
'startColumn' => 0,
'startRow' => 0
]
],
'developerMetadata' => [
[
]
],
'filterViews' => [
[
'criteria' => [
],
'filterSpecs' => [
[
]
],
'filterViewId' => 0,
'namedRangeId' => '',
'range' => [
],
'sortSpecs' => [
[
]
],
'title' => ''
]
],
'merges' => [
[
]
],
'properties' => [
'dataSourceSheetProperties' => [
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'gridProperties' => [
'columnCount' => 0,
'columnGroupControlAfter' => null,
'frozenColumnCount' => 0,
'frozenRowCount' => 0,
'hideGridlines' => null,
'rowCount' => 0,
'rowGroupControlAfter' => null
],
'hidden' => null,
'index' => 0,
'rightToLeft' => null,
'sheetId' => 0,
'sheetType' => '',
'tabColor' => [
],
'tabColorStyle' => [
],
'title' => ''
],
'protectedRanges' => [
[
'description' => '',
'editors' => [
'domainUsersCanEdit' => null,
'groups' => [
],
'users' => [
]
],
'namedRangeId' => '',
'protectedRangeId' => 0,
'range' => [
],
'requestingUserCanEdit' => null,
'unprotectedRanges' => [
[
]
],
'warningOnly' => null
]
],
'rowGroups' => [
[
]
],
'slicers' => [
[
'position' => [
],
'slicerId' => 0,
'spec' => [
'applyToPivotTables' => null,
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'columnIndex' => 0,
'dataRange' => [
],
'filterCriteria' => [
],
'horizontalAlignment' => '',
'textFormat' => [
],
'title' => ''
]
]
]
]
],
'spreadsheetId' => '',
'spreadsheetUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dataSourceSchedules' => [
[
'dailySchedule' => [
'startTime' => [
'hours' => 0,
'minutes' => 0,
'nanos' => 0,
'seconds' => 0
]
],
'enabled' => null,
'monthlySchedule' => [
'daysOfMonth' => [
],
'startTime' => [
]
],
'nextRun' => [
'endTime' => '',
'startTime' => ''
],
'refreshScope' => '',
'weeklySchedule' => [
'daysOfWeek' => [
],
'startTime' => [
]
]
]
],
'dataSources' => [
[
'calculatedColumns' => [
[
'formula' => '',
'reference' => [
'name' => ''
]
]
],
'dataSourceId' => '',
'sheetId' => 0,
'spec' => [
'bigQuery' => [
'projectId' => '',
'querySpec' => [
'rawQuery' => ''
],
'tableSpec' => [
'datasetId' => '',
'tableId' => '',
'tableProjectId' => ''
]
],
'parameters' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]
]
],
'developerMetadata' => [
[
'location' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataId' => 0,
'metadataKey' => '',
'metadataValue' => '',
'visibility' => ''
]
],
'namedRanges' => [
[
'name' => '',
'namedRangeId' => '',
'range' => [
]
]
],
'properties' => [
'autoRecalc' => '',
'defaultFormat' => [
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'backgroundColorStyle' => [
'rgbColor' => [
],
'themeColor' => ''
],
'borders' => [
'bottom' => [
'color' => [
],
'colorStyle' => [
],
'style' => '',
'width' => 0
],
'left' => [
],
'right' => [
],
'top' => [
]
],
'horizontalAlignment' => '',
'hyperlinkDisplayType' => '',
'numberFormat' => [
'pattern' => '',
'type' => ''
],
'padding' => [
'bottom' => 0,
'left' => 0,
'right' => 0,
'top' => 0
],
'textDirection' => '',
'textFormat' => [
'bold' => null,
'fontFamily' => '',
'fontSize' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'italic' => null,
'link' => [
'uri' => ''
],
'strikethrough' => null,
'underline' => null
],
'textRotation' => [
'angle' => 0,
'vertical' => null
],
'verticalAlignment' => '',
'wrapStrategy' => ''
],
'iterativeCalculationSettings' => [
'convergenceThreshold' => '',
'maxIterations' => 0
],
'locale' => '',
'spreadsheetTheme' => [
'primaryFontFamily' => '',
'themeColors' => [
[
'color' => [
],
'colorType' => ''
]
]
],
'timeZone' => '',
'title' => ''
],
'sheets' => [
[
'bandedRanges' => [
[
'bandedRangeId' => 0,
'columnProperties' => [
'firstBandColor' => [
],
'firstBandColorStyle' => [
],
'footerColor' => [
],
'footerColorStyle' => [
],
'headerColor' => [
],
'headerColorStyle' => [
],
'secondBandColor' => [
],
'secondBandColorStyle' => [
]
],
'range' => [
],
'rowProperties' => [
]
]
],
'basicFilter' => [
'criteria' => [
],
'filterSpecs' => [
[
'columnIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
'type' => '',
'values' => [
[
'relativeDate' => '',
'userEnteredValue' => ''
]
]
],
'hiddenValues' => [
],
'visibleBackgroundColor' => [
],
'visibleBackgroundColorStyle' => [
],
'visibleForegroundColor' => [
],
'visibleForegroundColorStyle' => [
]
]
]
],
'range' => [
],
'sortSpecs' => [
[
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'dataSourceColumnReference' => [
],
'dimensionIndex' => 0,
'foregroundColor' => [
],
'foregroundColorStyle' => [
],
'sortOrder' => ''
]
]
],
'charts' => [
[
'border' => [
'color' => [
],
'colorStyle' => [
]
],
'chartId' => 0,
'position' => [
'newSheet' => null,
'overlayPosition' => [
'anchorCell' => [
'columnIndex' => 0,
'rowIndex' => 0,
'sheetId' => 0
],
'heightPixels' => 0,
'offsetXPixels' => 0,
'offsetYPixels' => 0,
'widthPixels' => 0
],
'sheetId' => 0
],
'spec' => [
'altText' => '',
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'basicChart' => [
'axis' => [
[
'format' => [
],
'position' => '',
'title' => '',
'titleTextPosition' => [
'horizontalAlignment' => ''
],
'viewWindowOptions' => [
'viewWindowMax' => '',
'viewWindowMin' => '',
'viewWindowMode' => ''
]
]
],
'chartType' => '',
'compareMode' => '',
'domains' => [
[
'domain' => [
'aggregateType' => '',
'columnReference' => [
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'intervalSize' => '',
'maxValue' => '',
'minValue' => ''
]
],
'sourceRange' => [
'sources' => [
[
]
]
]
],
'reversed' => null
]
],
'headerCount' => 0,
'interpolateNulls' => null,
'legendPosition' => '',
'lineSmoothing' => null,
'series' => [
[
'color' => [
],
'colorStyle' => [
],
'dataLabel' => [
'customLabelData' => [
],
'placement' => '',
'textFormat' => [
],
'type' => ''
],
'lineStyle' => [
'type' => '',
'width' => 0
],
'pointStyle' => [
'shape' => '',
'size' => ''
],
'series' => [
],
'styleOverrides' => [
[
'color' => [
],
'colorStyle' => [
],
'index' => 0,
'pointStyle' => [
]
]
],
'targetAxis' => '',
'type' => ''
]
],
'stackedType' => '',
'threeDimensional' => null,
'totalDataLabel' => [
]
],
'bubbleChart' => [
'bubbleBorderColor' => [
],
'bubbleBorderColorStyle' => [
],
'bubbleLabels' => [
],
'bubbleMaxRadiusSize' => 0,
'bubbleMinRadiusSize' => 0,
'bubbleOpacity' => '',
'bubbleSizes' => [
],
'bubbleTextStyle' => [
],
'domain' => [
],
'groupIds' => [
],
'legendPosition' => '',
'series' => [
]
],
'candlestickChart' => [
'data' => [
[
'closeSeries' => [
'data' => [
]
],
'highSeries' => [
],
'lowSeries' => [
],
'openSeries' => [
]
]
],
'domain' => [
'data' => [
],
'reversed' => null
]
],
'dataSourceChartProperties' => [
'dataExecutionStatus' => [
'errorCode' => '',
'errorMessage' => '',
'lastRefreshTime' => '',
'state' => ''
],
'dataSourceId' => ''
],
'filterSpecs' => [
[
]
],
'fontName' => '',
'hiddenDimensionStrategy' => '',
'histogramChart' => [
'bucketSize' => '',
'legendPosition' => '',
'outlierPercentile' => '',
'series' => [
[
'barColor' => [
],
'barColorStyle' => [
],
'data' => [
]
]
],
'showItemDividers' => null
],
'maximized' => null,
'orgChart' => [
'labels' => [
],
'nodeColor' => [
],
'nodeColorStyle' => [
],
'nodeSize' => '',
'parentLabels' => [
],
'selectedNodeColor' => [
],
'selectedNodeColorStyle' => [
],
'tooltips' => [
]
],
'pieChart' => [
'domain' => [
],
'legendPosition' => '',
'pieHole' => '',
'series' => [
],
'threeDimensional' => null
],
'scorecardChart' => [
'aggregateType' => '',
'baselineValueData' => [
],
'baselineValueFormat' => [
'comparisonType' => '',
'description' => '',
'negativeColor' => [
],
'negativeColorStyle' => [
],
'position' => [
],
'positiveColor' => [
],
'positiveColorStyle' => [
],
'textFormat' => [
]
],
'customFormatOptions' => [
'prefix' => '',
'suffix' => ''
],
'keyValueData' => [
],
'keyValueFormat' => [
'position' => [
],
'textFormat' => [
]
],
'numberFormatSource' => '',
'scaleFactor' => ''
],
'sortSpecs' => [
[
]
],
'subtitle' => '',
'subtitleTextFormat' => [
],
'subtitleTextPosition' => [
],
'title' => '',
'titleTextFormat' => [
],
'titleTextPosition' => [
],
'treemapChart' => [
'colorData' => [
],
'colorScale' => [
'maxValueColor' => [
],
'maxValueColorStyle' => [
],
'midValueColor' => [
],
'midValueColorStyle' => [
],
'minValueColor' => [
],
'minValueColorStyle' => [
],
'noDataColor' => [
],
'noDataColorStyle' => [
]
],
'headerColor' => [
],
'headerColorStyle' => [
],
'hideTooltips' => null,
'hintedLevels' => 0,
'labels' => [
],
'levels' => 0,
'maxValue' => '',
'minValue' => '',
'parentLabels' => [
],
'sizeData' => [
],
'textFormat' => [
]
],
'waterfallChart' => [
'connectorLineStyle' => [
],
'domain' => [
'data' => [
],
'reversed' => null
],
'firstValueIsTotal' => null,
'hideConnectorLines' => null,
'series' => [
[
'customSubtotals' => [
[
'dataIsSubtotal' => null,
'label' => '',
'subtotalIndex' => 0
]
],
'data' => [
],
'dataLabel' => [
],
'hideTrailingSubtotal' => null,
'negativeColumnsStyle' => [
'color' => [
],
'colorStyle' => [
],
'label' => ''
],
'positiveColumnsStyle' => [
],
'subtotalColumnsStyle' => [
]
]
],
'stackedType' => '',
'totalDataLabel' => [
]
]
]
]
],
'columnGroups' => [
[
'collapsed' => null,
'depth' => 0,
'range' => [
]
]
],
'conditionalFormats' => [
[
'booleanRule' => [
'condition' => [
],
'format' => [
]
],
'gradientRule' => [
'maxpoint' => [
'color' => [
],
'colorStyle' => [
],
'type' => '',
'value' => ''
],
'midpoint' => [
],
'minpoint' => [
]
],
'ranges' => [
[
]
]
]
],
'data' => [
[
'columnMetadata' => [
[
'dataSourceColumnReference' => [
],
'developerMetadata' => [
[
]
],
'hiddenByFilter' => null,
'hiddenByUser' => null,
'pixelSize' => 0
]
],
'rowData' => [
[
'values' => [
[
'dataSourceFormula' => [
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'dataSourceTable' => [
'columnSelectionType' => '',
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
]
],
'rowLimit' => 0,
'sortSpecs' => [
[
]
]
],
'dataValidation' => [
'condition' => [
],
'inputMessage' => '',
'showCustomUi' => null,
'strict' => null
],
'effectiveFormat' => [
],
'effectiveValue' => [
'boolValue' => null,
'errorValue' => [
'message' => '',
'type' => ''
],
'formulaValue' => '',
'numberValue' => '',
'stringValue' => ''
],
'formattedValue' => '',
'hyperlink' => '',
'note' => '',
'pivotTable' => [
'columns' => [
[
'dataSourceColumnReference' => [
],
'groupLimit' => [
'applyOrder' => 0,
'countLimit' => 0
],
'groupRule' => [
'dateTimeRule' => [
'type' => ''
],
'histogramRule' => [
'end' => '',
'interval' => '',
'start' => ''
],
'manualRule' => [
'groups' => [
[
'groupName' => [
],
'items' => [
[
]
]
]
]
]
],
'label' => '',
'repeatHeadings' => null,
'showTotals' => null,
'sortOrder' => '',
'sourceColumnOffset' => 0,
'valueBucket' => [
'buckets' => [
[
]
],
'valuesIndex' => 0
],
'valueMetadata' => [
[
'collapsed' => null,
'value' => [
]
]
]
]
],
'criteria' => [
],
'dataExecutionStatus' => [
],
'dataSourceId' => '',
'filterSpecs' => [
[
'columnOffsetIndex' => 0,
'dataSourceColumnReference' => [
],
'filterCriteria' => [
'condition' => [
],
'visibleByDefault' => null,
'visibleValues' => [
]
]
]
],
'rows' => [
[
]
],
'source' => [
],
'valueLayout' => '',
'values' => [
[
'calculatedDisplayType' => '',
'dataSourceColumnReference' => [
],
'formula' => '',
'name' => '',
'sourceColumnOffset' => 0,
'summarizeFunction' => ''
]
]
],
'textFormatRuns' => [
[
'format' => [
],
'startIndex' => 0
]
],
'userEnteredFormat' => [
],
'userEnteredValue' => [
]
]
]
]
],
'rowMetadata' => [
[
]
],
'startColumn' => 0,
'startRow' => 0
]
],
'developerMetadata' => [
[
]
],
'filterViews' => [
[
'criteria' => [
],
'filterSpecs' => [
[
]
],
'filterViewId' => 0,
'namedRangeId' => '',
'range' => [
],
'sortSpecs' => [
[
]
],
'title' => ''
]
],
'merges' => [
[
]
],
'properties' => [
'dataSourceSheetProperties' => [
'columns' => [
[
]
],
'dataExecutionStatus' => [
],
'dataSourceId' => ''
],
'gridProperties' => [
'columnCount' => 0,
'columnGroupControlAfter' => null,
'frozenColumnCount' => 0,
'frozenRowCount' => 0,
'hideGridlines' => null,
'rowCount' => 0,
'rowGroupControlAfter' => null
],
'hidden' => null,
'index' => 0,
'rightToLeft' => null,
'sheetId' => 0,
'sheetType' => '',
'tabColor' => [
],
'tabColorStyle' => [
],
'title' => ''
],
'protectedRanges' => [
[
'description' => '',
'editors' => [
'domainUsersCanEdit' => null,
'groups' => [
],
'users' => [
]
],
'namedRangeId' => '',
'protectedRangeId' => 0,
'range' => [
],
'requestingUserCanEdit' => null,
'unprotectedRanges' => [
[
]
],
'warningOnly' => null
]
],
'rowGroups' => [
[
]
],
'slicers' => [
[
'position' => [
],
'slicerId' => 0,
'spec' => [
'applyToPivotTables' => null,
'backgroundColor' => [
],
'backgroundColorStyle' => [
],
'columnIndex' => 0,
'dataRange' => [
],
'filterCriteria' => [
],
'horizontalAlignment' => '',
'textFormat' => [
],
'title' => ''
]
]
]
]
],
'spreadsheetId' => '',
'spreadsheetUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets"
payload = {
"dataSourceSchedules": [
{
"dailySchedule": { "startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
} },
"enabled": False,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": { "name": "" }
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": { "rawQuery": "" },
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": False,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": False,
"link": { "uri": "" },
"strikethrough": False,
"underline": False
},
"textRotation": {
"angle": 0,
"vertical": False
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": False,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": { "horizontalAlignment": "" },
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": { "type": "" },
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": { "sources": [{}] }
},
"reversed": False
}
],
"headerCount": 0,
"interpolateNulls": False,
"legendPosition": "",
"lineSmoothing": False,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": False,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": { "data": {} },
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": False
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [{}],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": False
},
"maximized": False,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": False
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [{}],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": False,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": False
},
"firstValueIsTotal": False,
"hideConnectorLines": False,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": False,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": False,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": False,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [{}]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [{}],
"hiddenByFilter": False,
"hiddenByUser": False,
"pixelSize": 0
}
],
"rowData": [{ "values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [{}],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [{}],
"rowLimit": 0,
"sortSpecs": [{}]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": False,
"strict": False
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": False,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": { "type": "" },
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": { "groups": [
{
"groupName": {},
"items": [{}]
}
] }
},
"label": "",
"repeatHeadings": False,
"showTotals": False,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [{}],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": False,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": False,
"visibleValues": []
}
}
],
"rows": [{}],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
] }],
"rowMetadata": [{}],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [{}],
"filterViews": [
{
"criteria": {},
"filterSpecs": [{}],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [{}],
"title": ""
}
],
"merges": [{}],
"properties": {
"dataSourceSheetProperties": {
"columns": [{}],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": False,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": False,
"rowCount": 0,
"rowGroupControlAfter": False
},
"hidden": False,
"index": 0,
"rightToLeft": False,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": False,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": False,
"unprotectedRanges": [{}],
"warningOnly": False
}
],
"rowGroups": [{}],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": False,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets"
payload <- "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets') do |req|
req.body = "{\n \"dataSourceSchedules\": [\n {\n \"dailySchedule\": {\n \"startTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n }\n },\n \"enabled\": false,\n \"monthlySchedule\": {\n \"daysOfMonth\": [],\n \"startTime\": {}\n },\n \"nextRun\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n },\n \"refreshScope\": \"\",\n \"weeklySchedule\": {\n \"daysOfWeek\": [],\n \"startTime\": {}\n }\n }\n ],\n \"dataSources\": [\n {\n \"calculatedColumns\": [\n {\n \"formula\": \"\",\n \"reference\": {\n \"name\": \"\"\n }\n }\n ],\n \"dataSourceId\": \"\",\n \"sheetId\": 0,\n \"spec\": {\n \"bigQuery\": {\n \"projectId\": \"\",\n \"querySpec\": {\n \"rawQuery\": \"\"\n },\n \"tableSpec\": {\n \"datasetId\": \"\",\n \"tableId\": \"\",\n \"tableProjectId\": \"\"\n }\n },\n \"parameters\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n }\n }\n ],\n \"developerMetadata\": [\n {\n \"location\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n }\n ],\n \"namedRanges\": [\n {\n \"name\": \"\",\n \"namedRangeId\": \"\",\n \"range\": {}\n }\n ],\n \"properties\": {\n \"autoRecalc\": \"\",\n \"defaultFormat\": {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"backgroundColorStyle\": {\n \"rgbColor\": {},\n \"themeColor\": \"\"\n },\n \"borders\": {\n \"bottom\": {\n \"color\": {},\n \"colorStyle\": {},\n \"style\": \"\",\n \"width\": 0\n },\n \"left\": {},\n \"right\": {},\n \"top\": {}\n },\n \"horizontalAlignment\": \"\",\n \"hyperlinkDisplayType\": \"\",\n \"numberFormat\": {\n \"pattern\": \"\",\n \"type\": \"\"\n },\n \"padding\": {\n \"bottom\": 0,\n \"left\": 0,\n \"right\": 0,\n \"top\": 0\n },\n \"textDirection\": \"\",\n \"textFormat\": {\n \"bold\": false,\n \"fontFamily\": \"\",\n \"fontSize\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"italic\": false,\n \"link\": {\n \"uri\": \"\"\n },\n \"strikethrough\": false,\n \"underline\": false\n },\n \"textRotation\": {\n \"angle\": 0,\n \"vertical\": false\n },\n \"verticalAlignment\": \"\",\n \"wrapStrategy\": \"\"\n },\n \"iterativeCalculationSettings\": {\n \"convergenceThreshold\": \"\",\n \"maxIterations\": 0\n },\n \"locale\": \"\",\n \"spreadsheetTheme\": {\n \"primaryFontFamily\": \"\",\n \"themeColors\": [\n {\n \"color\": {},\n \"colorType\": \"\"\n }\n ]\n },\n \"timeZone\": \"\",\n \"title\": \"\"\n },\n \"sheets\": [\n {\n \"bandedRanges\": [\n {\n \"bandedRangeId\": 0,\n \"columnProperties\": {\n \"firstBandColor\": {},\n \"firstBandColorStyle\": {},\n \"footerColor\": {},\n \"footerColorStyle\": {},\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"secondBandColor\": {},\n \"secondBandColorStyle\": {}\n },\n \"range\": {},\n \"rowProperties\": {}\n }\n ],\n \"basicFilter\": {\n \"criteria\": {},\n \"filterSpecs\": [\n {\n \"columnIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {\n \"type\": \"\",\n \"values\": [\n {\n \"relativeDate\": \"\",\n \"userEnteredValue\": \"\"\n }\n ]\n },\n \"hiddenValues\": [],\n \"visibleBackgroundColor\": {},\n \"visibleBackgroundColorStyle\": {},\n \"visibleForegroundColor\": {},\n \"visibleForegroundColorStyle\": {}\n }\n }\n ],\n \"range\": {},\n \"sortSpecs\": [\n {\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"dataSourceColumnReference\": {},\n \"dimensionIndex\": 0,\n \"foregroundColor\": {},\n \"foregroundColorStyle\": {},\n \"sortOrder\": \"\"\n }\n ]\n },\n \"charts\": [\n {\n \"border\": {\n \"color\": {},\n \"colorStyle\": {}\n },\n \"chartId\": 0,\n \"position\": {\n \"newSheet\": false,\n \"overlayPosition\": {\n \"anchorCell\": {\n \"columnIndex\": 0,\n \"rowIndex\": 0,\n \"sheetId\": 0\n },\n \"heightPixels\": 0,\n \"offsetXPixels\": 0,\n \"offsetYPixels\": 0,\n \"widthPixels\": 0\n },\n \"sheetId\": 0\n },\n \"spec\": {\n \"altText\": \"\",\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"basicChart\": {\n \"axis\": [\n {\n \"format\": {},\n \"position\": \"\",\n \"title\": \"\",\n \"titleTextPosition\": {\n \"horizontalAlignment\": \"\"\n },\n \"viewWindowOptions\": {\n \"viewWindowMax\": \"\",\n \"viewWindowMin\": \"\",\n \"viewWindowMode\": \"\"\n }\n }\n ],\n \"chartType\": \"\",\n \"compareMode\": \"\",\n \"domains\": [\n {\n \"domain\": {\n \"aggregateType\": \"\",\n \"columnReference\": {},\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"intervalSize\": \"\",\n \"maxValue\": \"\",\n \"minValue\": \"\"\n }\n },\n \"sourceRange\": {\n \"sources\": [\n {}\n ]\n }\n },\n \"reversed\": false\n }\n ],\n \"headerCount\": 0,\n \"interpolateNulls\": false,\n \"legendPosition\": \"\",\n \"lineSmoothing\": false,\n \"series\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"dataLabel\": {\n \"customLabelData\": {},\n \"placement\": \"\",\n \"textFormat\": {},\n \"type\": \"\"\n },\n \"lineStyle\": {\n \"type\": \"\",\n \"width\": 0\n },\n \"pointStyle\": {\n \"shape\": \"\",\n \"size\": \"\"\n },\n \"series\": {},\n \"styleOverrides\": [\n {\n \"color\": {},\n \"colorStyle\": {},\n \"index\": 0,\n \"pointStyle\": {}\n }\n ],\n \"targetAxis\": \"\",\n \"type\": \"\"\n }\n ],\n \"stackedType\": \"\",\n \"threeDimensional\": false,\n \"totalDataLabel\": {}\n },\n \"bubbleChart\": {\n \"bubbleBorderColor\": {},\n \"bubbleBorderColorStyle\": {},\n \"bubbleLabels\": {},\n \"bubbleMaxRadiusSize\": 0,\n \"bubbleMinRadiusSize\": 0,\n \"bubbleOpacity\": \"\",\n \"bubbleSizes\": {},\n \"bubbleTextStyle\": {},\n \"domain\": {},\n \"groupIds\": {},\n \"legendPosition\": \"\",\n \"series\": {}\n },\n \"candlestickChart\": {\n \"data\": [\n {\n \"closeSeries\": {\n \"data\": {}\n },\n \"highSeries\": {},\n \"lowSeries\": {},\n \"openSeries\": {}\n }\n ],\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n }\n },\n \"dataSourceChartProperties\": {\n \"dataExecutionStatus\": {\n \"errorCode\": \"\",\n \"errorMessage\": \"\",\n \"lastRefreshTime\": \"\",\n \"state\": \"\"\n },\n \"dataSourceId\": \"\"\n },\n \"filterSpecs\": [\n {}\n ],\n \"fontName\": \"\",\n \"hiddenDimensionStrategy\": \"\",\n \"histogramChart\": {\n \"bucketSize\": \"\",\n \"legendPosition\": \"\",\n \"outlierPercentile\": \"\",\n \"series\": [\n {\n \"barColor\": {},\n \"barColorStyle\": {},\n \"data\": {}\n }\n ],\n \"showItemDividers\": false\n },\n \"maximized\": false,\n \"orgChart\": {\n \"labels\": {},\n \"nodeColor\": {},\n \"nodeColorStyle\": {},\n \"nodeSize\": \"\",\n \"parentLabels\": {},\n \"selectedNodeColor\": {},\n \"selectedNodeColorStyle\": {},\n \"tooltips\": {}\n },\n \"pieChart\": {\n \"domain\": {},\n \"legendPosition\": \"\",\n \"pieHole\": \"\",\n \"series\": {},\n \"threeDimensional\": false\n },\n \"scorecardChart\": {\n \"aggregateType\": \"\",\n \"baselineValueData\": {},\n \"baselineValueFormat\": {\n \"comparisonType\": \"\",\n \"description\": \"\",\n \"negativeColor\": {},\n \"negativeColorStyle\": {},\n \"position\": {},\n \"positiveColor\": {},\n \"positiveColorStyle\": {},\n \"textFormat\": {}\n },\n \"customFormatOptions\": {\n \"prefix\": \"\",\n \"suffix\": \"\"\n },\n \"keyValueData\": {},\n \"keyValueFormat\": {\n \"position\": {},\n \"textFormat\": {}\n },\n \"numberFormatSource\": \"\",\n \"scaleFactor\": \"\"\n },\n \"sortSpecs\": [\n {}\n ],\n \"subtitle\": \"\",\n \"subtitleTextFormat\": {},\n \"subtitleTextPosition\": {},\n \"title\": \"\",\n \"titleTextFormat\": {},\n \"titleTextPosition\": {},\n \"treemapChart\": {\n \"colorData\": {},\n \"colorScale\": {\n \"maxValueColor\": {},\n \"maxValueColorStyle\": {},\n \"midValueColor\": {},\n \"midValueColorStyle\": {},\n \"minValueColor\": {},\n \"minValueColorStyle\": {},\n \"noDataColor\": {},\n \"noDataColorStyle\": {}\n },\n \"headerColor\": {},\n \"headerColorStyle\": {},\n \"hideTooltips\": false,\n \"hintedLevels\": 0,\n \"labels\": {},\n \"levels\": 0,\n \"maxValue\": \"\",\n \"minValue\": \"\",\n \"parentLabels\": {},\n \"sizeData\": {},\n \"textFormat\": {}\n },\n \"waterfallChart\": {\n \"connectorLineStyle\": {},\n \"domain\": {\n \"data\": {},\n \"reversed\": false\n },\n \"firstValueIsTotal\": false,\n \"hideConnectorLines\": false,\n \"series\": [\n {\n \"customSubtotals\": [\n {\n \"dataIsSubtotal\": false,\n \"label\": \"\",\n \"subtotalIndex\": 0\n }\n ],\n \"data\": {},\n \"dataLabel\": {},\n \"hideTrailingSubtotal\": false,\n \"negativeColumnsStyle\": {\n \"color\": {},\n \"colorStyle\": {},\n \"label\": \"\"\n },\n \"positiveColumnsStyle\": {},\n \"subtotalColumnsStyle\": {}\n }\n ],\n \"stackedType\": \"\",\n \"totalDataLabel\": {}\n }\n }\n }\n ],\n \"columnGroups\": [\n {\n \"collapsed\": false,\n \"depth\": 0,\n \"range\": {}\n }\n ],\n \"conditionalFormats\": [\n {\n \"booleanRule\": {\n \"condition\": {},\n \"format\": {}\n },\n \"gradientRule\": {\n \"maxpoint\": {\n \"color\": {},\n \"colorStyle\": {},\n \"type\": \"\",\n \"value\": \"\"\n },\n \"midpoint\": {},\n \"minpoint\": {}\n },\n \"ranges\": [\n {}\n ]\n }\n ],\n \"data\": [\n {\n \"columnMetadata\": [\n {\n \"dataSourceColumnReference\": {},\n \"developerMetadata\": [\n {}\n ],\n \"hiddenByFilter\": false,\n \"hiddenByUser\": false,\n \"pixelSize\": 0\n }\n ],\n \"rowData\": [\n {\n \"values\": [\n {\n \"dataSourceFormula\": {\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"dataSourceTable\": {\n \"columnSelectionType\": \"\",\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {}\n ],\n \"rowLimit\": 0,\n \"sortSpecs\": [\n {}\n ]\n },\n \"dataValidation\": {\n \"condition\": {},\n \"inputMessage\": \"\",\n \"showCustomUi\": false,\n \"strict\": false\n },\n \"effectiveFormat\": {},\n \"effectiveValue\": {\n \"boolValue\": false,\n \"errorValue\": {\n \"message\": \"\",\n \"type\": \"\"\n },\n \"formulaValue\": \"\",\n \"numberValue\": \"\",\n \"stringValue\": \"\"\n },\n \"formattedValue\": \"\",\n \"hyperlink\": \"\",\n \"note\": \"\",\n \"pivotTable\": {\n \"columns\": [\n {\n \"dataSourceColumnReference\": {},\n \"groupLimit\": {\n \"applyOrder\": 0,\n \"countLimit\": 0\n },\n \"groupRule\": {\n \"dateTimeRule\": {\n \"type\": \"\"\n },\n \"histogramRule\": {\n \"end\": \"\",\n \"interval\": \"\",\n \"start\": \"\"\n },\n \"manualRule\": {\n \"groups\": [\n {\n \"groupName\": {},\n \"items\": [\n {}\n ]\n }\n ]\n }\n },\n \"label\": \"\",\n \"repeatHeadings\": false,\n \"showTotals\": false,\n \"sortOrder\": \"\",\n \"sourceColumnOffset\": 0,\n \"valueBucket\": {\n \"buckets\": [\n {}\n ],\n \"valuesIndex\": 0\n },\n \"valueMetadata\": [\n {\n \"collapsed\": false,\n \"value\": {}\n }\n ]\n }\n ],\n \"criteria\": {},\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\",\n \"filterSpecs\": [\n {\n \"columnOffsetIndex\": 0,\n \"dataSourceColumnReference\": {},\n \"filterCriteria\": {\n \"condition\": {},\n \"visibleByDefault\": false,\n \"visibleValues\": []\n }\n }\n ],\n \"rows\": [\n {}\n ],\n \"source\": {},\n \"valueLayout\": \"\",\n \"values\": [\n {\n \"calculatedDisplayType\": \"\",\n \"dataSourceColumnReference\": {},\n \"formula\": \"\",\n \"name\": \"\",\n \"sourceColumnOffset\": 0,\n \"summarizeFunction\": \"\"\n }\n ]\n },\n \"textFormatRuns\": [\n {\n \"format\": {},\n \"startIndex\": 0\n }\n ],\n \"userEnteredFormat\": {},\n \"userEnteredValue\": {}\n }\n ]\n }\n ],\n \"rowMetadata\": [\n {}\n ],\n \"startColumn\": 0,\n \"startRow\": 0\n }\n ],\n \"developerMetadata\": [\n {}\n ],\n \"filterViews\": [\n {\n \"criteria\": {},\n \"filterSpecs\": [\n {}\n ],\n \"filterViewId\": 0,\n \"namedRangeId\": \"\",\n \"range\": {},\n \"sortSpecs\": [\n {}\n ],\n \"title\": \"\"\n }\n ],\n \"merges\": [\n {}\n ],\n \"properties\": {\n \"dataSourceSheetProperties\": {\n \"columns\": [\n {}\n ],\n \"dataExecutionStatus\": {},\n \"dataSourceId\": \"\"\n },\n \"gridProperties\": {\n \"columnCount\": 0,\n \"columnGroupControlAfter\": false,\n \"frozenColumnCount\": 0,\n \"frozenRowCount\": 0,\n \"hideGridlines\": false,\n \"rowCount\": 0,\n \"rowGroupControlAfter\": false\n },\n \"hidden\": false,\n \"index\": 0,\n \"rightToLeft\": false,\n \"sheetId\": 0,\n \"sheetType\": \"\",\n \"tabColor\": {},\n \"tabColorStyle\": {},\n \"title\": \"\"\n },\n \"protectedRanges\": [\n {\n \"description\": \"\",\n \"editors\": {\n \"domainUsersCanEdit\": false,\n \"groups\": [],\n \"users\": []\n },\n \"namedRangeId\": \"\",\n \"protectedRangeId\": 0,\n \"range\": {},\n \"requestingUserCanEdit\": false,\n \"unprotectedRanges\": [\n {}\n ],\n \"warningOnly\": false\n }\n ],\n \"rowGroups\": [\n {}\n ],\n \"slicers\": [\n {\n \"position\": {},\n \"slicerId\": 0,\n \"spec\": {\n \"applyToPivotTables\": false,\n \"backgroundColor\": {},\n \"backgroundColorStyle\": {},\n \"columnIndex\": 0,\n \"dataRange\": {},\n \"filterCriteria\": {},\n \"horizontalAlignment\": \"\",\n \"textFormat\": {},\n \"title\": \"\"\n }\n }\n ]\n }\n ],\n \"spreadsheetId\": \"\",\n \"spreadsheetUrl\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets";
let payload = json!({
"dataSourceSchedules": (
json!({
"dailySchedule": json!({"startTime": json!({
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
})}),
"enabled": false,
"monthlySchedule": json!({
"daysOfMonth": (),
"startTime": json!({})
}),
"nextRun": json!({
"endTime": "",
"startTime": ""
}),
"refreshScope": "",
"weeklySchedule": json!({
"daysOfWeek": (),
"startTime": json!({})
})
})
),
"dataSources": (
json!({
"calculatedColumns": (
json!({
"formula": "",
"reference": json!({"name": ""})
})
),
"dataSourceId": "",
"sheetId": 0,
"spec": json!({
"bigQuery": json!({
"projectId": "",
"querySpec": json!({"rawQuery": ""}),
"tableSpec": json!({
"datasetId": "",
"tableId": "",
"tableProjectId": ""
})
}),
"parameters": (
json!({
"name": "",
"namedRangeId": "",
"range": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
})
})
)
})
})
),
"developerMetadata": (
json!({
"location": json!({
"dimensionRange": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
})
),
"namedRanges": (
json!({
"name": "",
"namedRangeId": "",
"range": json!({})
})
),
"properties": json!({
"autoRecalc": "",
"defaultFormat": json!({
"backgroundColor": json!({
"alpha": "",
"blue": "",
"green": "",
"red": ""
}),
"backgroundColorStyle": json!({
"rgbColor": json!({}),
"themeColor": ""
}),
"borders": json!({
"bottom": json!({
"color": json!({}),
"colorStyle": json!({}),
"style": "",
"width": 0
}),
"left": json!({}),
"right": json!({}),
"top": json!({})
}),
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": json!({
"pattern": "",
"type": ""
}),
"padding": json!({
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
}),
"textDirection": "",
"textFormat": json!({
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": json!({}),
"foregroundColorStyle": json!({}),
"italic": false,
"link": json!({"uri": ""}),
"strikethrough": false,
"underline": false
}),
"textRotation": json!({
"angle": 0,
"vertical": false
}),
"verticalAlignment": "",
"wrapStrategy": ""
}),
"iterativeCalculationSettings": json!({
"convergenceThreshold": "",
"maxIterations": 0
}),
"locale": "",
"spreadsheetTheme": json!({
"primaryFontFamily": "",
"themeColors": (
json!({
"color": json!({}),
"colorType": ""
})
)
}),
"timeZone": "",
"title": ""
}),
"sheets": (
json!({
"bandedRanges": (
json!({
"bandedRangeId": 0,
"columnProperties": json!({
"firstBandColor": json!({}),
"firstBandColorStyle": json!({}),
"footerColor": json!({}),
"footerColorStyle": json!({}),
"headerColor": json!({}),
"headerColorStyle": json!({}),
"secondBandColor": json!({}),
"secondBandColorStyle": json!({})
}),
"range": json!({}),
"rowProperties": json!({})
})
),
"basicFilter": json!({
"criteria": json!({}),
"filterSpecs": (
json!({
"columnIndex": 0,
"dataSourceColumnReference": json!({}),
"filterCriteria": json!({
"condition": json!({
"type": "",
"values": (
json!({
"relativeDate": "",
"userEnteredValue": ""
})
)
}),
"hiddenValues": (),
"visibleBackgroundColor": json!({}),
"visibleBackgroundColorStyle": json!({}),
"visibleForegroundColor": json!({}),
"visibleForegroundColorStyle": json!({})
})
})
),
"range": json!({}),
"sortSpecs": (
json!({
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"dataSourceColumnReference": json!({}),
"dimensionIndex": 0,
"foregroundColor": json!({}),
"foregroundColorStyle": json!({}),
"sortOrder": ""
})
)
}),
"charts": (
json!({
"border": json!({
"color": json!({}),
"colorStyle": json!({})
}),
"chartId": 0,
"position": json!({
"newSheet": false,
"overlayPosition": json!({
"anchorCell": json!({
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
}),
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
}),
"sheetId": 0
}),
"spec": json!({
"altText": "",
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"basicChart": json!({
"axis": (
json!({
"format": json!({}),
"position": "",
"title": "",
"titleTextPosition": json!({"horizontalAlignment": ""}),
"viewWindowOptions": json!({
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
})
})
),
"chartType": "",
"compareMode": "",
"domains": (
json!({
"domain": json!({
"aggregateType": "",
"columnReference": json!({}),
"groupRule": json!({
"dateTimeRule": json!({"type": ""}),
"histogramRule": json!({
"intervalSize": "",
"maxValue": "",
"minValue": ""
})
}),
"sourceRange": json!({"sources": (json!({}))})
}),
"reversed": false
})
),
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": (
json!({
"color": json!({}),
"colorStyle": json!({}),
"dataLabel": json!({
"customLabelData": json!({}),
"placement": "",
"textFormat": json!({}),
"type": ""
}),
"lineStyle": json!({
"type": "",
"width": 0
}),
"pointStyle": json!({
"shape": "",
"size": ""
}),
"series": json!({}),
"styleOverrides": (
json!({
"color": json!({}),
"colorStyle": json!({}),
"index": 0,
"pointStyle": json!({})
})
),
"targetAxis": "",
"type": ""
})
),
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": json!({})
}),
"bubbleChart": json!({
"bubbleBorderColor": json!({}),
"bubbleBorderColorStyle": json!({}),
"bubbleLabels": json!({}),
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": json!({}),
"bubbleTextStyle": json!({}),
"domain": json!({}),
"groupIds": json!({}),
"legendPosition": "",
"series": json!({})
}),
"candlestickChart": json!({
"data": (
json!({
"closeSeries": json!({"data": json!({})}),
"highSeries": json!({}),
"lowSeries": json!({}),
"openSeries": json!({})
})
),
"domain": json!({
"data": json!({}),
"reversed": false
})
}),
"dataSourceChartProperties": json!({
"dataExecutionStatus": json!({
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
}),
"dataSourceId": ""
}),
"filterSpecs": (json!({})),
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": json!({
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": (
json!({
"barColor": json!({}),
"barColorStyle": json!({}),
"data": json!({})
})
),
"showItemDividers": false
}),
"maximized": false,
"orgChart": json!({
"labels": json!({}),
"nodeColor": json!({}),
"nodeColorStyle": json!({}),
"nodeSize": "",
"parentLabels": json!({}),
"selectedNodeColor": json!({}),
"selectedNodeColorStyle": json!({}),
"tooltips": json!({})
}),
"pieChart": json!({
"domain": json!({}),
"legendPosition": "",
"pieHole": "",
"series": json!({}),
"threeDimensional": false
}),
"scorecardChart": json!({
"aggregateType": "",
"baselineValueData": json!({}),
"baselineValueFormat": json!({
"comparisonType": "",
"description": "",
"negativeColor": json!({}),
"negativeColorStyle": json!({}),
"position": json!({}),
"positiveColor": json!({}),
"positiveColorStyle": json!({}),
"textFormat": json!({})
}),
"customFormatOptions": json!({
"prefix": "",
"suffix": ""
}),
"keyValueData": json!({}),
"keyValueFormat": json!({
"position": json!({}),
"textFormat": json!({})
}),
"numberFormatSource": "",
"scaleFactor": ""
}),
"sortSpecs": (json!({})),
"subtitle": "",
"subtitleTextFormat": json!({}),
"subtitleTextPosition": json!({}),
"title": "",
"titleTextFormat": json!({}),
"titleTextPosition": json!({}),
"treemapChart": json!({
"colorData": json!({}),
"colorScale": json!({
"maxValueColor": json!({}),
"maxValueColorStyle": json!({}),
"midValueColor": json!({}),
"midValueColorStyle": json!({}),
"minValueColor": json!({}),
"minValueColorStyle": json!({}),
"noDataColor": json!({}),
"noDataColorStyle": json!({})
}),
"headerColor": json!({}),
"headerColorStyle": json!({}),
"hideTooltips": false,
"hintedLevels": 0,
"labels": json!({}),
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": json!({}),
"sizeData": json!({}),
"textFormat": json!({})
}),
"waterfallChart": json!({
"connectorLineStyle": json!({}),
"domain": json!({
"data": json!({}),
"reversed": false
}),
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": (
json!({
"customSubtotals": (
json!({
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
})
),
"data": json!({}),
"dataLabel": json!({}),
"hideTrailingSubtotal": false,
"negativeColumnsStyle": json!({
"color": json!({}),
"colorStyle": json!({}),
"label": ""
}),
"positiveColumnsStyle": json!({}),
"subtotalColumnsStyle": json!({})
})
),
"stackedType": "",
"totalDataLabel": json!({})
})
})
})
),
"columnGroups": (
json!({
"collapsed": false,
"depth": 0,
"range": json!({})
})
),
"conditionalFormats": (
json!({
"booleanRule": json!({
"condition": json!({}),
"format": json!({})
}),
"gradientRule": json!({
"maxpoint": json!({
"color": json!({}),
"colorStyle": json!({}),
"type": "",
"value": ""
}),
"midpoint": json!({}),
"minpoint": json!({})
}),
"ranges": (json!({}))
})
),
"data": (
json!({
"columnMetadata": (
json!({
"dataSourceColumnReference": json!({}),
"developerMetadata": (json!({})),
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
})
),
"rowData": (json!({"values": (
json!({
"dataSourceFormula": json!({
"dataExecutionStatus": json!({}),
"dataSourceId": ""
}),
"dataSourceTable": json!({
"columnSelectionType": "",
"columns": (json!({})),
"dataExecutionStatus": json!({}),
"dataSourceId": "",
"filterSpecs": (json!({})),
"rowLimit": 0,
"sortSpecs": (json!({}))
}),
"dataValidation": json!({
"condition": json!({}),
"inputMessage": "",
"showCustomUi": false,
"strict": false
}),
"effectiveFormat": json!({}),
"effectiveValue": json!({
"boolValue": false,
"errorValue": json!({
"message": "",
"type": ""
}),
"formulaValue": "",
"numberValue": "",
"stringValue": ""
}),
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": json!({
"columns": (
json!({
"dataSourceColumnReference": json!({}),
"groupLimit": json!({
"applyOrder": 0,
"countLimit": 0
}),
"groupRule": json!({
"dateTimeRule": json!({"type": ""}),
"histogramRule": json!({
"end": "",
"interval": "",
"start": ""
}),
"manualRule": json!({"groups": (
json!({
"groupName": json!({}),
"items": (json!({}))
})
)})
}),
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": json!({
"buckets": (json!({})),
"valuesIndex": 0
}),
"valueMetadata": (
json!({
"collapsed": false,
"value": json!({})
})
)
})
),
"criteria": json!({}),
"dataExecutionStatus": json!({}),
"dataSourceId": "",
"filterSpecs": (
json!({
"columnOffsetIndex": 0,
"dataSourceColumnReference": json!({}),
"filterCriteria": json!({
"condition": json!({}),
"visibleByDefault": false,
"visibleValues": ()
})
})
),
"rows": (json!({})),
"source": json!({}),
"valueLayout": "",
"values": (
json!({
"calculatedDisplayType": "",
"dataSourceColumnReference": json!({}),
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
})
)
}),
"textFormatRuns": (
json!({
"format": json!({}),
"startIndex": 0
})
),
"userEnteredFormat": json!({}),
"userEnteredValue": json!({})
})
)})),
"rowMetadata": (json!({})),
"startColumn": 0,
"startRow": 0
})
),
"developerMetadata": (json!({})),
"filterViews": (
json!({
"criteria": json!({}),
"filterSpecs": (json!({})),
"filterViewId": 0,
"namedRangeId": "",
"range": json!({}),
"sortSpecs": (json!({})),
"title": ""
})
),
"merges": (json!({})),
"properties": json!({
"dataSourceSheetProperties": json!({
"columns": (json!({})),
"dataExecutionStatus": json!({}),
"dataSourceId": ""
}),
"gridProperties": json!({
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
}),
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": json!({}),
"tabColorStyle": json!({}),
"title": ""
}),
"protectedRanges": (
json!({
"description": "",
"editors": json!({
"domainUsersCanEdit": false,
"groups": (),
"users": ()
}),
"namedRangeId": "",
"protectedRangeId": 0,
"range": json!({}),
"requestingUserCanEdit": false,
"unprotectedRanges": (json!({})),
"warningOnly": false
})
),
"rowGroups": (json!({})),
"slicers": (
json!({
"position": json!({}),
"slicerId": 0,
"spec": json!({
"applyToPivotTables": false,
"backgroundColor": json!({}),
"backgroundColorStyle": json!({}),
"columnIndex": 0,
"dataRange": json!({}),
"filterCriteria": json!({}),
"horizontalAlignment": "",
"textFormat": json!({}),
"title": ""
})
})
)
})
),
"spreadsheetId": "",
"spreadsheetUrl": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets \
--header 'content-type: application/json' \
--data '{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}'
echo '{
"dataSourceSchedules": [
{
"dailySchedule": {
"startTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}
},
"enabled": false,
"monthlySchedule": {
"daysOfMonth": [],
"startTime": {}
},
"nextRun": {
"endTime": "",
"startTime": ""
},
"refreshScope": "",
"weeklySchedule": {
"daysOfWeek": [],
"startTime": {}
}
}
],
"dataSources": [
{
"calculatedColumns": [
{
"formula": "",
"reference": {
"name": ""
}
}
],
"dataSourceId": "",
"sheetId": 0,
"spec": {
"bigQuery": {
"projectId": "",
"querySpec": {
"rawQuery": ""
},
"tableSpec": {
"datasetId": "",
"tableId": "",
"tableProjectId": ""
}
},
"parameters": [
{
"name": "",
"namedRangeId": "",
"range": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
}
],
"developerMetadata": [
{
"location": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
}
],
"namedRanges": [
{
"name": "",
"namedRangeId": "",
"range": {}
}
],
"properties": {
"autoRecalc": "",
"defaultFormat": {
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"backgroundColorStyle": {
"rgbColor": {},
"themeColor": ""
},
"borders": {
"bottom": {
"color": {},
"colorStyle": {},
"style": "",
"width": 0
},
"left": {},
"right": {},
"top": {}
},
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": {
"pattern": "",
"type": ""
},
"padding": {
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
},
"textDirection": "",
"textFormat": {
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"italic": false,
"link": {
"uri": ""
},
"strikethrough": false,
"underline": false
},
"textRotation": {
"angle": 0,
"vertical": false
},
"verticalAlignment": "",
"wrapStrategy": ""
},
"iterativeCalculationSettings": {
"convergenceThreshold": "",
"maxIterations": 0
},
"locale": "",
"spreadsheetTheme": {
"primaryFontFamily": "",
"themeColors": [
{
"color": {},
"colorType": ""
}
]
},
"timeZone": "",
"title": ""
},
"sheets": [
{
"bandedRanges": [
{
"bandedRangeId": 0,
"columnProperties": {
"firstBandColor": {},
"firstBandColorStyle": {},
"footerColor": {},
"footerColorStyle": {},
"headerColor": {},
"headerColorStyle": {},
"secondBandColor": {},
"secondBandColorStyle": {}
},
"range": {},
"rowProperties": {}
}
],
"basicFilter": {
"criteria": {},
"filterSpecs": [
{
"columnIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {
"type": "",
"values": [
{
"relativeDate": "",
"userEnteredValue": ""
}
]
},
"hiddenValues": [],
"visibleBackgroundColor": {},
"visibleBackgroundColorStyle": {},
"visibleForegroundColor": {},
"visibleForegroundColorStyle": {}
}
}
],
"range": {},
"sortSpecs": [
{
"backgroundColor": {},
"backgroundColorStyle": {},
"dataSourceColumnReference": {},
"dimensionIndex": 0,
"foregroundColor": {},
"foregroundColorStyle": {},
"sortOrder": ""
}
]
},
"charts": [
{
"border": {
"color": {},
"colorStyle": {}
},
"chartId": 0,
"position": {
"newSheet": false,
"overlayPosition": {
"anchorCell": {
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
},
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
},
"sheetId": 0
},
"spec": {
"altText": "",
"backgroundColor": {},
"backgroundColorStyle": {},
"basicChart": {
"axis": [
{
"format": {},
"position": "",
"title": "",
"titleTextPosition": {
"horizontalAlignment": ""
},
"viewWindowOptions": {
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
}
}
],
"chartType": "",
"compareMode": "",
"domains": [
{
"domain": {
"aggregateType": "",
"columnReference": {},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"intervalSize": "",
"maxValue": "",
"minValue": ""
}
},
"sourceRange": {
"sources": [
{}
]
}
},
"reversed": false
}
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
{
"color": {},
"colorStyle": {},
"dataLabel": {
"customLabelData": {},
"placement": "",
"textFormat": {},
"type": ""
},
"lineStyle": {
"type": "",
"width": 0
},
"pointStyle": {
"shape": "",
"size": ""
},
"series": {},
"styleOverrides": [
{
"color": {},
"colorStyle": {},
"index": 0,
"pointStyle": {}
}
],
"targetAxis": "",
"type": ""
}
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": {}
},
"bubbleChart": {
"bubbleBorderColor": {},
"bubbleBorderColorStyle": {},
"bubbleLabels": {},
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": {},
"bubbleTextStyle": {},
"domain": {},
"groupIds": {},
"legendPosition": "",
"series": {}
},
"candlestickChart": {
"data": [
{
"closeSeries": {
"data": {}
},
"highSeries": {},
"lowSeries": {},
"openSeries": {}
}
],
"domain": {
"data": {},
"reversed": false
}
},
"dataSourceChartProperties": {
"dataExecutionStatus": {
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
},
"dataSourceId": ""
},
"filterSpecs": [
{}
],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": {
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
{
"barColor": {},
"barColorStyle": {},
"data": {}
}
],
"showItemDividers": false
},
"maximized": false,
"orgChart": {
"labels": {},
"nodeColor": {},
"nodeColorStyle": {},
"nodeSize": "",
"parentLabels": {},
"selectedNodeColor": {},
"selectedNodeColorStyle": {},
"tooltips": {}
},
"pieChart": {
"domain": {},
"legendPosition": "",
"pieHole": "",
"series": {},
"threeDimensional": false
},
"scorecardChart": {
"aggregateType": "",
"baselineValueData": {},
"baselineValueFormat": {
"comparisonType": "",
"description": "",
"negativeColor": {},
"negativeColorStyle": {},
"position": {},
"positiveColor": {},
"positiveColorStyle": {},
"textFormat": {}
},
"customFormatOptions": {
"prefix": "",
"suffix": ""
},
"keyValueData": {},
"keyValueFormat": {
"position": {},
"textFormat": {}
},
"numberFormatSource": "",
"scaleFactor": ""
},
"sortSpecs": [
{}
],
"subtitle": "",
"subtitleTextFormat": {},
"subtitleTextPosition": {},
"title": "",
"titleTextFormat": {},
"titleTextPosition": {},
"treemapChart": {
"colorData": {},
"colorScale": {
"maxValueColor": {},
"maxValueColorStyle": {},
"midValueColor": {},
"midValueColorStyle": {},
"minValueColor": {},
"minValueColorStyle": {},
"noDataColor": {},
"noDataColorStyle": {}
},
"headerColor": {},
"headerColorStyle": {},
"hideTooltips": false,
"hintedLevels": 0,
"labels": {},
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": {},
"sizeData": {},
"textFormat": {}
},
"waterfallChart": {
"connectorLineStyle": {},
"domain": {
"data": {},
"reversed": false
},
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
{
"customSubtotals": [
{
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
}
],
"data": {},
"dataLabel": {},
"hideTrailingSubtotal": false,
"negativeColumnsStyle": {
"color": {},
"colorStyle": {},
"label": ""
},
"positiveColumnsStyle": {},
"subtotalColumnsStyle": {}
}
],
"stackedType": "",
"totalDataLabel": {}
}
}
}
],
"columnGroups": [
{
"collapsed": false,
"depth": 0,
"range": {}
}
],
"conditionalFormats": [
{
"booleanRule": {
"condition": {},
"format": {}
},
"gradientRule": {
"maxpoint": {
"color": {},
"colorStyle": {},
"type": "",
"value": ""
},
"midpoint": {},
"minpoint": {}
},
"ranges": [
{}
]
}
],
"data": [
{
"columnMetadata": [
{
"dataSourceColumnReference": {},
"developerMetadata": [
{}
],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
}
],
"rowData": [
{
"values": [
{
"dataSourceFormula": {
"dataExecutionStatus": {},
"dataSourceId": ""
},
"dataSourceTable": {
"columnSelectionType": "",
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{}
],
"rowLimit": 0,
"sortSpecs": [
{}
]
},
"dataValidation": {
"condition": {},
"inputMessage": "",
"showCustomUi": false,
"strict": false
},
"effectiveFormat": {},
"effectiveValue": {
"boolValue": false,
"errorValue": {
"message": "",
"type": ""
},
"formulaValue": "",
"numberValue": "",
"stringValue": ""
},
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": {
"columns": [
{
"dataSourceColumnReference": {},
"groupLimit": {
"applyOrder": 0,
"countLimit": 0
},
"groupRule": {
"dateTimeRule": {
"type": ""
},
"histogramRule": {
"end": "",
"interval": "",
"start": ""
},
"manualRule": {
"groups": [
{
"groupName": {},
"items": [
{}
]
}
]
}
},
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": {
"buckets": [
{}
],
"valuesIndex": 0
},
"valueMetadata": [
{
"collapsed": false,
"value": {}
}
]
}
],
"criteria": {},
"dataExecutionStatus": {},
"dataSourceId": "",
"filterSpecs": [
{
"columnOffsetIndex": 0,
"dataSourceColumnReference": {},
"filterCriteria": {
"condition": {},
"visibleByDefault": false,
"visibleValues": []
}
}
],
"rows": [
{}
],
"source": {},
"valueLayout": "",
"values": [
{
"calculatedDisplayType": "",
"dataSourceColumnReference": {},
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
}
]
},
"textFormatRuns": [
{
"format": {},
"startIndex": 0
}
],
"userEnteredFormat": {},
"userEnteredValue": {}
}
]
}
],
"rowMetadata": [
{}
],
"startColumn": 0,
"startRow": 0
}
],
"developerMetadata": [
{}
],
"filterViews": [
{
"criteria": {},
"filterSpecs": [
{}
],
"filterViewId": 0,
"namedRangeId": "",
"range": {},
"sortSpecs": [
{}
],
"title": ""
}
],
"merges": [
{}
],
"properties": {
"dataSourceSheetProperties": {
"columns": [
{}
],
"dataExecutionStatus": {},
"dataSourceId": ""
},
"gridProperties": {
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
},
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": {},
"tabColorStyle": {},
"title": ""
},
"protectedRanges": [
{
"description": "",
"editors": {
"domainUsersCanEdit": false,
"groups": [],
"users": []
},
"namedRangeId": "",
"protectedRangeId": 0,
"range": {},
"requestingUserCanEdit": false,
"unprotectedRanges": [
{}
],
"warningOnly": false
}
],
"rowGroups": [
{}
],
"slicers": [
{
"position": {},
"slicerId": 0,
"spec": {
"applyToPivotTables": false,
"backgroundColor": {},
"backgroundColorStyle": {},
"columnIndex": 0,
"dataRange": {},
"filterCriteria": {},
"horizontalAlignment": "",
"textFormat": {},
"title": ""
}
}
]
}
],
"spreadsheetId": "",
"spreadsheetUrl": ""
}' | \
http POST {{baseUrl}}/v4/spreadsheets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dataSourceSchedules": [\n {\n "dailySchedule": {\n "startTime": {\n "hours": 0,\n "minutes": 0,\n "nanos": 0,\n "seconds": 0\n }\n },\n "enabled": false,\n "monthlySchedule": {\n "daysOfMonth": [],\n "startTime": {}\n },\n "nextRun": {\n "endTime": "",\n "startTime": ""\n },\n "refreshScope": "",\n "weeklySchedule": {\n "daysOfWeek": [],\n "startTime": {}\n }\n }\n ],\n "dataSources": [\n {\n "calculatedColumns": [\n {\n "formula": "",\n "reference": {\n "name": ""\n }\n }\n ],\n "dataSourceId": "",\n "sheetId": 0,\n "spec": {\n "bigQuery": {\n "projectId": "",\n "querySpec": {\n "rawQuery": ""\n },\n "tableSpec": {\n "datasetId": "",\n "tableId": "",\n "tableProjectId": ""\n }\n },\n "parameters": [\n {\n "name": "",\n "namedRangeId": "",\n "range": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ]\n }\n }\n ],\n "developerMetadata": [\n {\n "location": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataId": 0,\n "metadataKey": "",\n "metadataValue": "",\n "visibility": ""\n }\n ],\n "namedRanges": [\n {\n "name": "",\n "namedRangeId": "",\n "range": {}\n }\n ],\n "properties": {\n "autoRecalc": "",\n "defaultFormat": {\n "backgroundColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "backgroundColorStyle": {\n "rgbColor": {},\n "themeColor": ""\n },\n "borders": {\n "bottom": {\n "color": {},\n "colorStyle": {},\n "style": "",\n "width": 0\n },\n "left": {},\n "right": {},\n "top": {}\n },\n "horizontalAlignment": "",\n "hyperlinkDisplayType": "",\n "numberFormat": {\n "pattern": "",\n "type": ""\n },\n "padding": {\n "bottom": 0,\n "left": 0,\n "right": 0,\n "top": 0\n },\n "textDirection": "",\n "textFormat": {\n "bold": false,\n "fontFamily": "",\n "fontSize": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "italic": false,\n "link": {\n "uri": ""\n },\n "strikethrough": false,\n "underline": false\n },\n "textRotation": {\n "angle": 0,\n "vertical": false\n },\n "verticalAlignment": "",\n "wrapStrategy": ""\n },\n "iterativeCalculationSettings": {\n "convergenceThreshold": "",\n "maxIterations": 0\n },\n "locale": "",\n "spreadsheetTheme": {\n "primaryFontFamily": "",\n "themeColors": [\n {\n "color": {},\n "colorType": ""\n }\n ]\n },\n "timeZone": "",\n "title": ""\n },\n "sheets": [\n {\n "bandedRanges": [\n {\n "bandedRangeId": 0,\n "columnProperties": {\n "firstBandColor": {},\n "firstBandColorStyle": {},\n "footerColor": {},\n "footerColorStyle": {},\n "headerColor": {},\n "headerColorStyle": {},\n "secondBandColor": {},\n "secondBandColorStyle": {}\n },\n "range": {},\n "rowProperties": {}\n }\n ],\n "basicFilter": {\n "criteria": {},\n "filterSpecs": [\n {\n "columnIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {\n "type": "",\n "values": [\n {\n "relativeDate": "",\n "userEnteredValue": ""\n }\n ]\n },\n "hiddenValues": [],\n "visibleBackgroundColor": {},\n "visibleBackgroundColorStyle": {},\n "visibleForegroundColor": {},\n "visibleForegroundColorStyle": {}\n }\n }\n ],\n "range": {},\n "sortSpecs": [\n {\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "dataSourceColumnReference": {},\n "dimensionIndex": 0,\n "foregroundColor": {},\n "foregroundColorStyle": {},\n "sortOrder": ""\n }\n ]\n },\n "charts": [\n {\n "border": {\n "color": {},\n "colorStyle": {}\n },\n "chartId": 0,\n "position": {\n "newSheet": false,\n "overlayPosition": {\n "anchorCell": {\n "columnIndex": 0,\n "rowIndex": 0,\n "sheetId": 0\n },\n "heightPixels": 0,\n "offsetXPixels": 0,\n "offsetYPixels": 0,\n "widthPixels": 0\n },\n "sheetId": 0\n },\n "spec": {\n "altText": "",\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "basicChart": {\n "axis": [\n {\n "format": {},\n "position": "",\n "title": "",\n "titleTextPosition": {\n "horizontalAlignment": ""\n },\n "viewWindowOptions": {\n "viewWindowMax": "",\n "viewWindowMin": "",\n "viewWindowMode": ""\n }\n }\n ],\n "chartType": "",\n "compareMode": "",\n "domains": [\n {\n "domain": {\n "aggregateType": "",\n "columnReference": {},\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "intervalSize": "",\n "maxValue": "",\n "minValue": ""\n }\n },\n "sourceRange": {\n "sources": [\n {}\n ]\n }\n },\n "reversed": false\n }\n ],\n "headerCount": 0,\n "interpolateNulls": false,\n "legendPosition": "",\n "lineSmoothing": false,\n "series": [\n {\n "color": {},\n "colorStyle": {},\n "dataLabel": {\n "customLabelData": {},\n "placement": "",\n "textFormat": {},\n "type": ""\n },\n "lineStyle": {\n "type": "",\n "width": 0\n },\n "pointStyle": {\n "shape": "",\n "size": ""\n },\n "series": {},\n "styleOverrides": [\n {\n "color": {},\n "colorStyle": {},\n "index": 0,\n "pointStyle": {}\n }\n ],\n "targetAxis": "",\n "type": ""\n }\n ],\n "stackedType": "",\n "threeDimensional": false,\n "totalDataLabel": {}\n },\n "bubbleChart": {\n "bubbleBorderColor": {},\n "bubbleBorderColorStyle": {},\n "bubbleLabels": {},\n "bubbleMaxRadiusSize": 0,\n "bubbleMinRadiusSize": 0,\n "bubbleOpacity": "",\n "bubbleSizes": {},\n "bubbleTextStyle": {},\n "domain": {},\n "groupIds": {},\n "legendPosition": "",\n "series": {}\n },\n "candlestickChart": {\n "data": [\n {\n "closeSeries": {\n "data": {}\n },\n "highSeries": {},\n "lowSeries": {},\n "openSeries": {}\n }\n ],\n "domain": {\n "data": {},\n "reversed": false\n }\n },\n "dataSourceChartProperties": {\n "dataExecutionStatus": {\n "errorCode": "",\n "errorMessage": "",\n "lastRefreshTime": "",\n "state": ""\n },\n "dataSourceId": ""\n },\n "filterSpecs": [\n {}\n ],\n "fontName": "",\n "hiddenDimensionStrategy": "",\n "histogramChart": {\n "bucketSize": "",\n "legendPosition": "",\n "outlierPercentile": "",\n "series": [\n {\n "barColor": {},\n "barColorStyle": {},\n "data": {}\n }\n ],\n "showItemDividers": false\n },\n "maximized": false,\n "orgChart": {\n "labels": {},\n "nodeColor": {},\n "nodeColorStyle": {},\n "nodeSize": "",\n "parentLabels": {},\n "selectedNodeColor": {},\n "selectedNodeColorStyle": {},\n "tooltips": {}\n },\n "pieChart": {\n "domain": {},\n "legendPosition": "",\n "pieHole": "",\n "series": {},\n "threeDimensional": false\n },\n "scorecardChart": {\n "aggregateType": "",\n "baselineValueData": {},\n "baselineValueFormat": {\n "comparisonType": "",\n "description": "",\n "negativeColor": {},\n "negativeColorStyle": {},\n "position": {},\n "positiveColor": {},\n "positiveColorStyle": {},\n "textFormat": {}\n },\n "customFormatOptions": {\n "prefix": "",\n "suffix": ""\n },\n "keyValueData": {},\n "keyValueFormat": {\n "position": {},\n "textFormat": {}\n },\n "numberFormatSource": "",\n "scaleFactor": ""\n },\n "sortSpecs": [\n {}\n ],\n "subtitle": "",\n "subtitleTextFormat": {},\n "subtitleTextPosition": {},\n "title": "",\n "titleTextFormat": {},\n "titleTextPosition": {},\n "treemapChart": {\n "colorData": {},\n "colorScale": {\n "maxValueColor": {},\n "maxValueColorStyle": {},\n "midValueColor": {},\n "midValueColorStyle": {},\n "minValueColor": {},\n "minValueColorStyle": {},\n "noDataColor": {},\n "noDataColorStyle": {}\n },\n "headerColor": {},\n "headerColorStyle": {},\n "hideTooltips": false,\n "hintedLevels": 0,\n "labels": {},\n "levels": 0,\n "maxValue": "",\n "minValue": "",\n "parentLabels": {},\n "sizeData": {},\n "textFormat": {}\n },\n "waterfallChart": {\n "connectorLineStyle": {},\n "domain": {\n "data": {},\n "reversed": false\n },\n "firstValueIsTotal": false,\n "hideConnectorLines": false,\n "series": [\n {\n "customSubtotals": [\n {\n "dataIsSubtotal": false,\n "label": "",\n "subtotalIndex": 0\n }\n ],\n "data": {},\n "dataLabel": {},\n "hideTrailingSubtotal": false,\n "negativeColumnsStyle": {\n "color": {},\n "colorStyle": {},\n "label": ""\n },\n "positiveColumnsStyle": {},\n "subtotalColumnsStyle": {}\n }\n ],\n "stackedType": "",\n "totalDataLabel": {}\n }\n }\n }\n ],\n "columnGroups": [\n {\n "collapsed": false,\n "depth": 0,\n "range": {}\n }\n ],\n "conditionalFormats": [\n {\n "booleanRule": {\n "condition": {},\n "format": {}\n },\n "gradientRule": {\n "maxpoint": {\n "color": {},\n "colorStyle": {},\n "type": "",\n "value": ""\n },\n "midpoint": {},\n "minpoint": {}\n },\n "ranges": [\n {}\n ]\n }\n ],\n "data": [\n {\n "columnMetadata": [\n {\n "dataSourceColumnReference": {},\n "developerMetadata": [\n {}\n ],\n "hiddenByFilter": false,\n "hiddenByUser": false,\n "pixelSize": 0\n }\n ],\n "rowData": [\n {\n "values": [\n {\n "dataSourceFormula": {\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "dataSourceTable": {\n "columnSelectionType": "",\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {}\n ],\n "rowLimit": 0,\n "sortSpecs": [\n {}\n ]\n },\n "dataValidation": {\n "condition": {},\n "inputMessage": "",\n "showCustomUi": false,\n "strict": false\n },\n "effectiveFormat": {},\n "effectiveValue": {\n "boolValue": false,\n "errorValue": {\n "message": "",\n "type": ""\n },\n "formulaValue": "",\n "numberValue": "",\n "stringValue": ""\n },\n "formattedValue": "",\n "hyperlink": "",\n "note": "",\n "pivotTable": {\n "columns": [\n {\n "dataSourceColumnReference": {},\n "groupLimit": {\n "applyOrder": 0,\n "countLimit": 0\n },\n "groupRule": {\n "dateTimeRule": {\n "type": ""\n },\n "histogramRule": {\n "end": "",\n "interval": "",\n "start": ""\n },\n "manualRule": {\n "groups": [\n {\n "groupName": {},\n "items": [\n {}\n ]\n }\n ]\n }\n },\n "label": "",\n "repeatHeadings": false,\n "showTotals": false,\n "sortOrder": "",\n "sourceColumnOffset": 0,\n "valueBucket": {\n "buckets": [\n {}\n ],\n "valuesIndex": 0\n },\n "valueMetadata": [\n {\n "collapsed": false,\n "value": {}\n }\n ]\n }\n ],\n "criteria": {},\n "dataExecutionStatus": {},\n "dataSourceId": "",\n "filterSpecs": [\n {\n "columnOffsetIndex": 0,\n "dataSourceColumnReference": {},\n "filterCriteria": {\n "condition": {},\n "visibleByDefault": false,\n "visibleValues": []\n }\n }\n ],\n "rows": [\n {}\n ],\n "source": {},\n "valueLayout": "",\n "values": [\n {\n "calculatedDisplayType": "",\n "dataSourceColumnReference": {},\n "formula": "",\n "name": "",\n "sourceColumnOffset": 0,\n "summarizeFunction": ""\n }\n ]\n },\n "textFormatRuns": [\n {\n "format": {},\n "startIndex": 0\n }\n ],\n "userEnteredFormat": {},\n "userEnteredValue": {}\n }\n ]\n }\n ],\n "rowMetadata": [\n {}\n ],\n "startColumn": 0,\n "startRow": 0\n }\n ],\n "developerMetadata": [\n {}\n ],\n "filterViews": [\n {\n "criteria": {},\n "filterSpecs": [\n {}\n ],\n "filterViewId": 0,\n "namedRangeId": "",\n "range": {},\n "sortSpecs": [\n {}\n ],\n "title": ""\n }\n ],\n "merges": [\n {}\n ],\n "properties": {\n "dataSourceSheetProperties": {\n "columns": [\n {}\n ],\n "dataExecutionStatus": {},\n "dataSourceId": ""\n },\n "gridProperties": {\n "columnCount": 0,\n "columnGroupControlAfter": false,\n "frozenColumnCount": 0,\n "frozenRowCount": 0,\n "hideGridlines": false,\n "rowCount": 0,\n "rowGroupControlAfter": false\n },\n "hidden": false,\n "index": 0,\n "rightToLeft": false,\n "sheetId": 0,\n "sheetType": "",\n "tabColor": {},\n "tabColorStyle": {},\n "title": ""\n },\n "protectedRanges": [\n {\n "description": "",\n "editors": {\n "domainUsersCanEdit": false,\n "groups": [],\n "users": []\n },\n "namedRangeId": "",\n "protectedRangeId": 0,\n "range": {},\n "requestingUserCanEdit": false,\n "unprotectedRanges": [\n {}\n ],\n "warningOnly": false\n }\n ],\n "rowGroups": [\n {}\n ],\n "slicers": [\n {\n "position": {},\n "slicerId": 0,\n "spec": {\n "applyToPivotTables": false,\n "backgroundColor": {},\n "backgroundColorStyle": {},\n "columnIndex": 0,\n "dataRange": {},\n "filterCriteria": {},\n "horizontalAlignment": "",\n "textFormat": {},\n "title": ""\n }\n }\n ]\n }\n ],\n "spreadsheetId": "",\n "spreadsheetUrl": ""\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dataSourceSchedules": [
[
"dailySchedule": ["startTime": [
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
]],
"enabled": false,
"monthlySchedule": [
"daysOfMonth": [],
"startTime": []
],
"nextRun": [
"endTime": "",
"startTime": ""
],
"refreshScope": "",
"weeklySchedule": [
"daysOfWeek": [],
"startTime": []
]
]
],
"dataSources": [
[
"calculatedColumns": [
[
"formula": "",
"reference": ["name": ""]
]
],
"dataSourceId": "",
"sheetId": 0,
"spec": [
"bigQuery": [
"projectId": "",
"querySpec": ["rawQuery": ""],
"tableSpec": [
"datasetId": "",
"tableId": "",
"tableProjectId": ""
]
],
"parameters": [
[
"name": "",
"namedRangeId": "",
"range": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
]
]
]
]
]
],
"developerMetadata": [
[
"location": [
"dimensionRange": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataId": 0,
"metadataKey": "",
"metadataValue": "",
"visibility": ""
]
],
"namedRanges": [
[
"name": "",
"namedRangeId": "",
"range": []
]
],
"properties": [
"autoRecalc": "",
"defaultFormat": [
"backgroundColor": [
"alpha": "",
"blue": "",
"green": "",
"red": ""
],
"backgroundColorStyle": [
"rgbColor": [],
"themeColor": ""
],
"borders": [
"bottom": [
"color": [],
"colorStyle": [],
"style": "",
"width": 0
],
"left": [],
"right": [],
"top": []
],
"horizontalAlignment": "",
"hyperlinkDisplayType": "",
"numberFormat": [
"pattern": "",
"type": ""
],
"padding": [
"bottom": 0,
"left": 0,
"right": 0,
"top": 0
],
"textDirection": "",
"textFormat": [
"bold": false,
"fontFamily": "",
"fontSize": 0,
"foregroundColor": [],
"foregroundColorStyle": [],
"italic": false,
"link": ["uri": ""],
"strikethrough": false,
"underline": false
],
"textRotation": [
"angle": 0,
"vertical": false
],
"verticalAlignment": "",
"wrapStrategy": ""
],
"iterativeCalculationSettings": [
"convergenceThreshold": "",
"maxIterations": 0
],
"locale": "",
"spreadsheetTheme": [
"primaryFontFamily": "",
"themeColors": [
[
"color": [],
"colorType": ""
]
]
],
"timeZone": "",
"title": ""
],
"sheets": [
[
"bandedRanges": [
[
"bandedRangeId": 0,
"columnProperties": [
"firstBandColor": [],
"firstBandColorStyle": [],
"footerColor": [],
"footerColorStyle": [],
"headerColor": [],
"headerColorStyle": [],
"secondBandColor": [],
"secondBandColorStyle": []
],
"range": [],
"rowProperties": []
]
],
"basicFilter": [
"criteria": [],
"filterSpecs": [
[
"columnIndex": 0,
"dataSourceColumnReference": [],
"filterCriteria": [
"condition": [
"type": "",
"values": [
[
"relativeDate": "",
"userEnteredValue": ""
]
]
],
"hiddenValues": [],
"visibleBackgroundColor": [],
"visibleBackgroundColorStyle": [],
"visibleForegroundColor": [],
"visibleForegroundColorStyle": []
]
]
],
"range": [],
"sortSpecs": [
[
"backgroundColor": [],
"backgroundColorStyle": [],
"dataSourceColumnReference": [],
"dimensionIndex": 0,
"foregroundColor": [],
"foregroundColorStyle": [],
"sortOrder": ""
]
]
],
"charts": [
[
"border": [
"color": [],
"colorStyle": []
],
"chartId": 0,
"position": [
"newSheet": false,
"overlayPosition": [
"anchorCell": [
"columnIndex": 0,
"rowIndex": 0,
"sheetId": 0
],
"heightPixels": 0,
"offsetXPixels": 0,
"offsetYPixels": 0,
"widthPixels": 0
],
"sheetId": 0
],
"spec": [
"altText": "",
"backgroundColor": [],
"backgroundColorStyle": [],
"basicChart": [
"axis": [
[
"format": [],
"position": "",
"title": "",
"titleTextPosition": ["horizontalAlignment": ""],
"viewWindowOptions": [
"viewWindowMax": "",
"viewWindowMin": "",
"viewWindowMode": ""
]
]
],
"chartType": "",
"compareMode": "",
"domains": [
[
"domain": [
"aggregateType": "",
"columnReference": [],
"groupRule": [
"dateTimeRule": ["type": ""],
"histogramRule": [
"intervalSize": "",
"maxValue": "",
"minValue": ""
]
],
"sourceRange": ["sources": [[]]]
],
"reversed": false
]
],
"headerCount": 0,
"interpolateNulls": false,
"legendPosition": "",
"lineSmoothing": false,
"series": [
[
"color": [],
"colorStyle": [],
"dataLabel": [
"customLabelData": [],
"placement": "",
"textFormat": [],
"type": ""
],
"lineStyle": [
"type": "",
"width": 0
],
"pointStyle": [
"shape": "",
"size": ""
],
"series": [],
"styleOverrides": [
[
"color": [],
"colorStyle": [],
"index": 0,
"pointStyle": []
]
],
"targetAxis": "",
"type": ""
]
],
"stackedType": "",
"threeDimensional": false,
"totalDataLabel": []
],
"bubbleChart": [
"bubbleBorderColor": [],
"bubbleBorderColorStyle": [],
"bubbleLabels": [],
"bubbleMaxRadiusSize": 0,
"bubbleMinRadiusSize": 0,
"bubbleOpacity": "",
"bubbleSizes": [],
"bubbleTextStyle": [],
"domain": [],
"groupIds": [],
"legendPosition": "",
"series": []
],
"candlestickChart": [
"data": [
[
"closeSeries": ["data": []],
"highSeries": [],
"lowSeries": [],
"openSeries": []
]
],
"domain": [
"data": [],
"reversed": false
]
],
"dataSourceChartProperties": [
"dataExecutionStatus": [
"errorCode": "",
"errorMessage": "",
"lastRefreshTime": "",
"state": ""
],
"dataSourceId": ""
],
"filterSpecs": [[]],
"fontName": "",
"hiddenDimensionStrategy": "",
"histogramChart": [
"bucketSize": "",
"legendPosition": "",
"outlierPercentile": "",
"series": [
[
"barColor": [],
"barColorStyle": [],
"data": []
]
],
"showItemDividers": false
],
"maximized": false,
"orgChart": [
"labels": [],
"nodeColor": [],
"nodeColorStyle": [],
"nodeSize": "",
"parentLabels": [],
"selectedNodeColor": [],
"selectedNodeColorStyle": [],
"tooltips": []
],
"pieChart": [
"domain": [],
"legendPosition": "",
"pieHole": "",
"series": [],
"threeDimensional": false
],
"scorecardChart": [
"aggregateType": "",
"baselineValueData": [],
"baselineValueFormat": [
"comparisonType": "",
"description": "",
"negativeColor": [],
"negativeColorStyle": [],
"position": [],
"positiveColor": [],
"positiveColorStyle": [],
"textFormat": []
],
"customFormatOptions": [
"prefix": "",
"suffix": ""
],
"keyValueData": [],
"keyValueFormat": [
"position": [],
"textFormat": []
],
"numberFormatSource": "",
"scaleFactor": ""
],
"sortSpecs": [[]],
"subtitle": "",
"subtitleTextFormat": [],
"subtitleTextPosition": [],
"title": "",
"titleTextFormat": [],
"titleTextPosition": [],
"treemapChart": [
"colorData": [],
"colorScale": [
"maxValueColor": [],
"maxValueColorStyle": [],
"midValueColor": [],
"midValueColorStyle": [],
"minValueColor": [],
"minValueColorStyle": [],
"noDataColor": [],
"noDataColorStyle": []
],
"headerColor": [],
"headerColorStyle": [],
"hideTooltips": false,
"hintedLevels": 0,
"labels": [],
"levels": 0,
"maxValue": "",
"minValue": "",
"parentLabels": [],
"sizeData": [],
"textFormat": []
],
"waterfallChart": [
"connectorLineStyle": [],
"domain": [
"data": [],
"reversed": false
],
"firstValueIsTotal": false,
"hideConnectorLines": false,
"series": [
[
"customSubtotals": [
[
"dataIsSubtotal": false,
"label": "",
"subtotalIndex": 0
]
],
"data": [],
"dataLabel": [],
"hideTrailingSubtotal": false,
"negativeColumnsStyle": [
"color": [],
"colorStyle": [],
"label": ""
],
"positiveColumnsStyle": [],
"subtotalColumnsStyle": []
]
],
"stackedType": "",
"totalDataLabel": []
]
]
]
],
"columnGroups": [
[
"collapsed": false,
"depth": 0,
"range": []
]
],
"conditionalFormats": [
[
"booleanRule": [
"condition": [],
"format": []
],
"gradientRule": [
"maxpoint": [
"color": [],
"colorStyle": [],
"type": "",
"value": ""
],
"midpoint": [],
"minpoint": []
],
"ranges": [[]]
]
],
"data": [
[
"columnMetadata": [
[
"dataSourceColumnReference": [],
"developerMetadata": [[]],
"hiddenByFilter": false,
"hiddenByUser": false,
"pixelSize": 0
]
],
"rowData": [["values": [
[
"dataSourceFormula": [
"dataExecutionStatus": [],
"dataSourceId": ""
],
"dataSourceTable": [
"columnSelectionType": "",
"columns": [[]],
"dataExecutionStatus": [],
"dataSourceId": "",
"filterSpecs": [[]],
"rowLimit": 0,
"sortSpecs": [[]]
],
"dataValidation": [
"condition": [],
"inputMessage": "",
"showCustomUi": false,
"strict": false
],
"effectiveFormat": [],
"effectiveValue": [
"boolValue": false,
"errorValue": [
"message": "",
"type": ""
],
"formulaValue": "",
"numberValue": "",
"stringValue": ""
],
"formattedValue": "",
"hyperlink": "",
"note": "",
"pivotTable": [
"columns": [
[
"dataSourceColumnReference": [],
"groupLimit": [
"applyOrder": 0,
"countLimit": 0
],
"groupRule": [
"dateTimeRule": ["type": ""],
"histogramRule": [
"end": "",
"interval": "",
"start": ""
],
"manualRule": ["groups": [
[
"groupName": [],
"items": [[]]
]
]]
],
"label": "",
"repeatHeadings": false,
"showTotals": false,
"sortOrder": "",
"sourceColumnOffset": 0,
"valueBucket": [
"buckets": [[]],
"valuesIndex": 0
],
"valueMetadata": [
[
"collapsed": false,
"value": []
]
]
]
],
"criteria": [],
"dataExecutionStatus": [],
"dataSourceId": "",
"filterSpecs": [
[
"columnOffsetIndex": 0,
"dataSourceColumnReference": [],
"filterCriteria": [
"condition": [],
"visibleByDefault": false,
"visibleValues": []
]
]
],
"rows": [[]],
"source": [],
"valueLayout": "",
"values": [
[
"calculatedDisplayType": "",
"dataSourceColumnReference": [],
"formula": "",
"name": "",
"sourceColumnOffset": 0,
"summarizeFunction": ""
]
]
],
"textFormatRuns": [
[
"format": [],
"startIndex": 0
]
],
"userEnteredFormat": [],
"userEnteredValue": []
]
]]],
"rowMetadata": [[]],
"startColumn": 0,
"startRow": 0
]
],
"developerMetadata": [[]],
"filterViews": [
[
"criteria": [],
"filterSpecs": [[]],
"filterViewId": 0,
"namedRangeId": "",
"range": [],
"sortSpecs": [[]],
"title": ""
]
],
"merges": [[]],
"properties": [
"dataSourceSheetProperties": [
"columns": [[]],
"dataExecutionStatus": [],
"dataSourceId": ""
],
"gridProperties": [
"columnCount": 0,
"columnGroupControlAfter": false,
"frozenColumnCount": 0,
"frozenRowCount": 0,
"hideGridlines": false,
"rowCount": 0,
"rowGroupControlAfter": false
],
"hidden": false,
"index": 0,
"rightToLeft": false,
"sheetId": 0,
"sheetType": "",
"tabColor": [],
"tabColorStyle": [],
"title": ""
],
"protectedRanges": [
[
"description": "",
"editors": [
"domainUsersCanEdit": false,
"groups": [],
"users": []
],
"namedRangeId": "",
"protectedRangeId": 0,
"range": [],
"requestingUserCanEdit": false,
"unprotectedRanges": [[]],
"warningOnly": false
]
],
"rowGroups": [[]],
"slicers": [
[
"position": [],
"slicerId": 0,
"spec": [
"applyToPivotTables": false,
"backgroundColor": [],
"backgroundColorStyle": [],
"columnIndex": 0,
"dataRange": [],
"filterCriteria": [],
"horizontalAlignment": "",
"textFormat": [],
"title": ""
]
]
]
]
],
"spreadsheetId": "",
"spreadsheetUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
sheets.spreadsheets.developerMetadata.get
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId
QUERY PARAMS
spreadsheetId
metadataId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId
http GET {{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata/:metadataId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.developerMetadata.search
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search
QUERY PARAMS
spreadsheetId
BODY json
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search" {:content-type :json
:form-params {:dataFilters [{:a1Range ""
:developerMetadataLookup {:locationMatchingStrategy ""
:locationType ""
:metadataId 0
:metadataKey ""
:metadataLocation {:dimensionRange {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataValue ""
:visibility ""}
:gridRange {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}}]}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"),
Content = new StringContent("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"
payload := strings.NewReader("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata:search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 720
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search")
.setHeader("content-type", "application/json")
.setBody("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search")
.header("content-type", "application/json")
.body("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata:search',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search',
headers: {'content-type': 'application/json'},
body: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dataFilters": @[ @{ @"a1Range": @"", @"developerMetadataLookup": @{ @"locationMatchingStrategy": @"", @"locationType": @"", @"metadataId": @0, @"metadataKey": @"", @"metadataLocation": @{ @"dimensionRange": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataValue": @"", @"visibility": @"" }, @"gridRange": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search', [
'body' => '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata:search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"
payload = { "dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search"
payload <- "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/developerMetadata:search') do |req|
req.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search";
let payload = json!({"dataFilters": (
json!({
"a1Range": "",
"developerMetadataLookup": json!({
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": json!({
"dimensionRange": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataValue": "",
"visibility": ""
}),
"gridRange": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
})
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search \
--header 'content-type: application/json' \
--data '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}'
echo '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["dataFilters": [
[
"a1Range": "",
"developerMetadataLookup": [
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": [
"dimensionRange": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataValue": "",
"visibility": ""
],
"gridRange": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
]
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/developerMetadata:search")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
sheets.spreadsheets.get
{{baseUrl}}/v4/spreadsheets/:spreadsheetId
QUERY PARAMS
spreadsheetId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/spreadsheets/:spreadsheetId")
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v4/spreadsheets/:spreadsheetId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/spreadsheets/:spreadsheetId")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/spreadsheets/:spreadsheetId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v4/spreadsheets/:spreadsheetId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId
http GET {{baseUrl}}/v4/spreadsheets/:spreadsheetId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.getByDataFilter
{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter
QUERY PARAMS
spreadsheetId
BODY json
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter" {:content-type :json
:form-params {:dataFilters [{:a1Range ""
:developerMetadataLookup {:locationMatchingStrategy ""
:locationType ""
:metadataId 0
:metadataKey ""
:metadataLocation {:dimensionRange {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataValue ""
:visibility ""}
:gridRange {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}}]
:includeGridData false}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"),
Content = new StringContent("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"
payload := strings.NewReader("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId:getByDataFilter HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 748
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter")
.setHeader("content-type", "application/json")
.setBody("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter")
.header("content-type", "application/json")
.body("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}")
.asString();
const data = JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
includeGridData: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
includeGridData: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}],"includeGridData":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ],\n "includeGridData": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId:getByDataFilter',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
includeGridData: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter',
headers: {'content-type': 'application/json'},
body: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
includeGridData: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
includeGridData: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
includeGridData: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}],"includeGridData":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dataFilters": @[ @{ @"a1Range": @"", @"developerMetadataLookup": @{ @"locationMatchingStrategy": @"", @"locationType": @"", @"metadataId": @0, @"metadataKey": @"", @"metadataLocation": @{ @"dimensionRange": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataValue": @"", @"visibility": @"" }, @"gridRange": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 } } ],
@"includeGridData": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
],
'includeGridData' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter', [
'body' => '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
],
'includeGridData' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
],
'includeGridData' => null
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId:getByDataFilter", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"
payload = {
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter"
payload <- "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId:getByDataFilter') do |req|
req.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"includeGridData\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter";
let payload = json!({
"dataFilters": (
json!({
"a1Range": "",
"developerMetadataLookup": json!({
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": json!({
"dimensionRange": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataValue": "",
"visibility": ""
}),
"gridRange": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
})
})
),
"includeGridData": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter \
--header 'content-type: application/json' \
--data '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}'
echo '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"includeGridData": false
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ],\n "includeGridData": false\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dataFilters": [
[
"a1Range": "",
"developerMetadataLookup": [
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": [
"dimensionRange": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataValue": "",
"visibility": ""
],
"gridRange": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
]
]
],
"includeGridData": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId:getByDataFilter")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.sheets.copyTo
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo
QUERY PARAMS
spreadsheetId
sheetId
BODY json
{
"destinationSpreadsheetId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"destinationSpreadsheetId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo" {:content-type :json
:form-params {:destinationSpreadsheetId ""}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"destinationSpreadsheetId\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"),
Content = new StringContent("{\n \"destinationSpreadsheetId\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"destinationSpreadsheetId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"
payload := strings.NewReader("{\n \"destinationSpreadsheetId\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"destinationSpreadsheetId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo")
.setHeader("content-type", "application/json")
.setBody("{\n \"destinationSpreadsheetId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"destinationSpreadsheetId\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"destinationSpreadsheetId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo")
.header("content-type", "application/json")
.body("{\n \"destinationSpreadsheetId\": \"\"\n}")
.asString();
const data = JSON.stringify({
destinationSpreadsheetId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo',
headers: {'content-type': 'application/json'},
data: {destinationSpreadsheetId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationSpreadsheetId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "destinationSpreadsheetId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"destinationSpreadsheetId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({destinationSpreadsheetId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo',
headers: {'content-type': 'application/json'},
body: {destinationSpreadsheetId: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
destinationSpreadsheetId: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo',
headers: {'content-type': 'application/json'},
data: {destinationSpreadsheetId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"destinationSpreadsheetId":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"destinationSpreadsheetId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"destinationSpreadsheetId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'destinationSpreadsheetId' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo', [
'body' => '{
"destinationSpreadsheetId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'destinationSpreadsheetId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'destinationSpreadsheetId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationSpreadsheetId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"destinationSpreadsheetId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"destinationSpreadsheetId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"
payload = { "destinationSpreadsheetId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo"
payload <- "{\n \"destinationSpreadsheetId\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"destinationSpreadsheetId\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo') do |req|
req.body = "{\n \"destinationSpreadsheetId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo";
let payload = json!({"destinationSpreadsheetId": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo \
--header 'content-type: application/json' \
--data '{
"destinationSpreadsheetId": ""
}'
echo '{
"destinationSpreadsheetId": ""
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "destinationSpreadsheetId": ""\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["destinationSpreadsheetId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/sheets/:sheetId:copyTo")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.append
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append
QUERY PARAMS
spreadsheetId
range
BODY json
{
"majorDimension": "",
"range": "",
"values": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append" {:content-type :json
:form-params {:majorDimension ""
:range ""
:values []}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"),
Content = new StringContent("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"
payload := strings.NewReader("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:append HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"majorDimension": "",
"range": "",
"values": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append")
.setHeader("content-type", "application/json")
.setBody("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append")
.header("content-type", "application/json")
.body("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
.asString();
const data = JSON.stringify({
majorDimension: '',
range: '',
values: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append',
headers: {'content-type': 'application/json'},
data: {majorDimension: '', range: '', values: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"majorDimension":"","range":"","values":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "majorDimension": "",\n "range": "",\n "values": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:append',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({majorDimension: '', range: '', values: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append',
headers: {'content-type': 'application/json'},
body: {majorDimension: '', range: '', values: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
majorDimension: '',
range: '',
values: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append',
headers: {'content-type': 'application/json'},
data: {majorDimension: '', range: '', values: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"majorDimension":"","range":"","values":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"majorDimension": @"",
@"range": @"",
@"values": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'majorDimension' => '',
'range' => '',
'values' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append', [
'body' => '{
"majorDimension": "",
"range": "",
"values": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'majorDimension' => '',
'range' => '',
'values' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'majorDimension' => '',
'range' => '',
'values' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"majorDimension": "",
"range": "",
"values": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"majorDimension": "",
"range": "",
"values": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:append", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"
payload = {
"majorDimension": "",
"range": "",
"values": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append"
payload <- "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:append') do |req|
req.body = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append";
let payload = json!({
"majorDimension": "",
"range": "",
"values": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append \
--header 'content-type: application/json' \
--data '{
"majorDimension": "",
"range": "",
"values": []
}'
echo '{
"majorDimension": "",
"range": "",
"values": []
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "majorDimension": "",\n "range": "",\n "values": []\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"majorDimension": "",
"range": "",
"values": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:append")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.batchClear
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear
QUERY PARAMS
spreadsheetId
BODY json
{
"ranges": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"ranges\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear" {:content-type :json
:form-params {:ranges []}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ranges\": []\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"),
Content = new StringContent("{\n \"ranges\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ranges\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"
payload := strings.NewReader("{\n \"ranges\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClear HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 18
{
"ranges": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear")
.setHeader("content-type", "application/json")
.setBody("{\n \"ranges\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ranges\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"ranges\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear")
.header("content-type", "application/json")
.body("{\n \"ranges\": []\n}")
.asString();
const data = JSON.stringify({
ranges: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear',
headers: {'content-type': 'application/json'},
data: {ranges: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ranges":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ranges": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ranges\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClear',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({ranges: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear',
headers: {'content-type': 'application/json'},
body: {ranges: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ranges: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear',
headers: {'content-type': 'application/json'},
data: {ranges: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ranges":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"ranges": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ranges\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ranges' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear', [
'body' => '{
"ranges": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ranges' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ranges' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ranges": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ranges": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ranges\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClear", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"
payload = { "ranges": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear"
payload <- "{\n \"ranges\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"ranges\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClear') do |req|
req.body = "{\n \"ranges\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear";
let payload = json!({"ranges": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear \
--header 'content-type: application/json' \
--data '{
"ranges": []
}'
echo '{
"ranges": []
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ranges": []\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["ranges": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClear")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.batchClearByDataFilter
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter
QUERY PARAMS
spreadsheetId
BODY json
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter" {:content-type :json
:form-params {:dataFilters [{:a1Range ""
:developerMetadataLookup {:locationMatchingStrategy ""
:locationType ""
:metadataId 0
:metadataKey ""
:metadataLocation {:dimensionRange {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataValue ""
:visibility ""}
:gridRange {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}}]}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"),
Content = new StringContent("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"
payload := strings.NewReader("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 720
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter")
.setHeader("content-type", "application/json")
.setBody("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter")
.header("content-type", "application/json")
.body("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter',
headers: {'content-type': 'application/json'},
body: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dataFilters": @[ @{ @"a1Range": @"", @"developerMetadataLookup": @{ @"locationMatchingStrategy": @"", @"locationType": @"", @"metadataId": @0, @"metadataKey": @"", @"metadataLocation": @{ @"dimensionRange": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataValue": @"", @"visibility": @"" }, @"gridRange": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter', [
'body' => '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"
payload = { "dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter"
payload <- "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter') do |req|
req.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter";
let payload = json!({"dataFilters": (
json!({
"a1Range": "",
"developerMetadataLookup": json!({
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": json!({
"dimensionRange": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataValue": "",
"visibility": ""
}),
"gridRange": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
})
})
)});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter \
--header 'content-type: application/json' \
--data '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}'
echo '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
]
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["dataFilters": [
[
"a1Range": "",
"developerMetadataLookup": [
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": [
"dimensionRange": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataValue": "",
"visibility": ""
],
"gridRange": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
]
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchClearByDataFilter")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
sheets.spreadsheets.values.batchGet
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet
QUERY PARAMS
spreadsheetId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGet HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGet',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGet")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGet') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet
http GET {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGet")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.batchGetByDataFilter
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter
QUERY PARAMS
spreadsheetId
BODY json
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter" {:content-type :json
:form-params {:dataFilters [{:a1Range ""
:developerMetadataLookup {:locationMatchingStrategy ""
:locationType ""
:metadataId 0
:metadataKey ""
:metadataLocation {:dimensionRange {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataValue ""
:visibility ""}
:gridRange {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}}]
:dateTimeRenderOption ""
:majorDimension ""
:valueRenderOption ""}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"),
Content = new StringContent("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"
payload := strings.NewReader("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 801
{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter")
.setHeader("content-type", "application/json")
.setBody("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter")
.header("content-type", "application/json")
.body("{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}")
.asString();
const data = JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
dateTimeRenderOption: '',
majorDimension: '',
valueRenderOption: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
dateTimeRenderOption: '',
majorDimension: '',
valueRenderOption: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}],"dateTimeRenderOption":"","majorDimension":"","valueRenderOption":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ],\n "dateTimeRenderOption": "",\n "majorDimension": "",\n "valueRenderOption": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
dateTimeRenderOption: '',
majorDimension: '',
valueRenderOption: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter',
headers: {'content-type': 'application/json'},
body: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
dateTimeRenderOption: '',
majorDimension: '',
valueRenderOption: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
dateTimeRenderOption: '',
majorDimension: '',
valueRenderOption: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter',
headers: {'content-type': 'application/json'},
data: {
dataFilters: [
{
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
}
],
dateTimeRenderOption: '',
majorDimension: '',
valueRenderOption: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dataFilters":[{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}}],"dateTimeRenderOption":"","majorDimension":"","valueRenderOption":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"dataFilters": @[ @{ @"a1Range": @"", @"developerMetadataLookup": @{ @"locationMatchingStrategy": @"", @"locationType": @"", @"metadataId": @0, @"metadataKey": @"", @"metadataLocation": @{ @"dimensionRange": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataValue": @"", @"visibility": @"" }, @"gridRange": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 } } ],
@"dateTimeRenderOption": @"",
@"majorDimension": @"",
@"valueRenderOption": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
],
'dateTimeRenderOption' => '',
'majorDimension' => '',
'valueRenderOption' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter', [
'body' => '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
],
'dateTimeRenderOption' => '',
'majorDimension' => '',
'valueRenderOption' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dataFilters' => [
[
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
]
],
'dateTimeRenderOption' => '',
'majorDimension' => '',
'valueRenderOption' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"
payload = {
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter"
payload <- "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter') do |req|
req.body = "{\n \"dataFilters\": [\n {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n }\n ],\n \"dateTimeRenderOption\": \"\",\n \"majorDimension\": \"\",\n \"valueRenderOption\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter";
let payload = json!({
"dataFilters": (
json!({
"a1Range": "",
"developerMetadataLookup": json!({
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": json!({
"dimensionRange": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataValue": "",
"visibility": ""
}),
"gridRange": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
})
})
),
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter \
--header 'content-type: application/json' \
--data '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}'
echo '{
"dataFilters": [
{
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
}
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dataFilters": [\n {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n }\n ],\n "dateTimeRenderOption": "",\n "majorDimension": "",\n "valueRenderOption": ""\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dataFilters": [
[
"a1Range": "",
"developerMetadataLookup": [
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": [
"dimensionRange": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataValue": "",
"visibility": ""
],
"gridRange": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
]
]
],
"dateTimeRenderOption": "",
"majorDimension": "",
"valueRenderOption": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchGetByDataFilter")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.batchUpdate
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate
QUERY PARAMS
spreadsheetId
BODY json
{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate" {:content-type :json
:form-params {:data [{:majorDimension ""
:range ""
:values []}]
:includeValuesInResponse false
:responseDateTimeRenderOption ""
:responseValueRenderOption ""
:valueInputOption ""}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"),
Content = new StringContent("{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"
payload := strings.NewReader("{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdate HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 232
{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate")
.setHeader("content-type", "application/json")
.setBody("{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate")
.header("content-type", "application/json")
.body("{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
.asString();
const data = JSON.stringify({
data: [
{
majorDimension: '',
range: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate',
headers: {'content-type': 'application/json'},
data: {
data: [{majorDimension: '', range: '', values: []}],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"data":[{"majorDimension":"","range":"","values":[]}],"includeValuesInResponse":false,"responseDateTimeRenderOption":"","responseValueRenderOption":"","valueInputOption":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "data": [\n {\n "majorDimension": "",\n "range": "",\n "values": []\n }\n ],\n "includeValuesInResponse": false,\n "responseDateTimeRenderOption": "",\n "responseValueRenderOption": "",\n "valueInputOption": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdate',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
data: [{majorDimension: '', range: '', values: []}],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate',
headers: {'content-type': 'application/json'},
body: {
data: [{majorDimension: '', range: '', values: []}],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
data: [
{
majorDimension: '',
range: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate',
headers: {'content-type': 'application/json'},
data: {
data: [{majorDimension: '', range: '', values: []}],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"data":[{"majorDimension":"","range":"","values":[]}],"includeValuesInResponse":false,"responseDateTimeRenderOption":"","responseValueRenderOption":"","valueInputOption":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"data": @[ @{ @"majorDimension": @"", @"range": @"", @"values": @[ ] } ],
@"includeValuesInResponse": @NO,
@"responseDateTimeRenderOption": @"",
@"responseValueRenderOption": @"",
@"valueInputOption": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
[
'majorDimension' => '',
'range' => '',
'values' => [
]
]
],
'includeValuesInResponse' => null,
'responseDateTimeRenderOption' => '',
'responseValueRenderOption' => '',
'valueInputOption' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate', [
'body' => '{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'data' => [
[
'majorDimension' => '',
'range' => '',
'values' => [
]
]
],
'includeValuesInResponse' => null,
'responseDateTimeRenderOption' => '',
'responseValueRenderOption' => '',
'valueInputOption' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'data' => [
[
'majorDimension' => '',
'range' => '',
'values' => [
]
]
],
'includeValuesInResponse' => null,
'responseDateTimeRenderOption' => '',
'responseValueRenderOption' => '',
'valueInputOption' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"
payload = {
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": False,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate"
payload <- "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdate') do |req|
req.body = "{\n \"data\": [\n {\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate";
let payload = json!({
"data": (
json!({
"majorDimension": "",
"range": "",
"values": ()
})
),
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate \
--header 'content-type: application/json' \
--data '{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}'
echo '{
"data": [
{
"majorDimension": "",
"range": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "data": [\n {\n "majorDimension": "",\n "range": "",\n "values": []\n }\n ],\n "includeValuesInResponse": false,\n "responseDateTimeRenderOption": "",\n "responseValueRenderOption": "",\n "valueInputOption": ""\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"data": [
[
"majorDimension": "",
"range": "",
"values": []
]
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdate")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.batchUpdateByDataFilter
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter
QUERY PARAMS
spreadsheetId
BODY json
{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter" {:content-type :json
:form-params {:data [{:dataFilter {:a1Range ""
:developerMetadataLookup {:locationMatchingStrategy ""
:locationType ""
:metadataId 0
:metadataKey ""
:metadataLocation {:dimensionRange {:dimension ""
:endIndex 0
:sheetId 0
:startIndex 0}
:locationType ""
:sheetId 0
:spreadsheet false}
:metadataValue ""
:visibility ""}
:gridRange {:endColumnIndex 0
:endRowIndex 0
:sheetId 0
:startColumnIndex 0
:startRowIndex 0}}
:majorDimension ""
:values []}]
:includeValuesInResponse false
:responseDateTimeRenderOption ""
:responseValueRenderOption ""
:valueInputOption ""}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"),
Content = new StringContent("{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"
payload := strings.NewReader("{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 980
{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter")
.setHeader("content-type", "application/json")
.setBody("{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter")
.header("content-type", "application/json")
.body("{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
.asString();
const data = JSON.stringify({
data: [
{
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
},
majorDimension: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter',
headers: {'content-type': 'application/json'},
data: {
data: [
{
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
},
majorDimension: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"data":[{"dataFilter":{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}},"majorDimension":"","values":[]}],"includeValuesInResponse":false,"responseDateTimeRenderOption":"","responseValueRenderOption":"","valueInputOption":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "data": [\n {\n "dataFilter": {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n },\n "majorDimension": "",\n "values": []\n }\n ],\n "includeValuesInResponse": false,\n "responseDateTimeRenderOption": "",\n "responseValueRenderOption": "",\n "valueInputOption": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
data: [
{
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
},
majorDimension: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter',
headers: {'content-type': 'application/json'},
body: {
data: [
{
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
},
majorDimension: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
data: [
{
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {
dimension: '',
endIndex: 0,
sheetId: 0,
startIndex: 0
},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
},
majorDimension: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter',
headers: {'content-type': 'application/json'},
data: {
data: [
{
dataFilter: {
a1Range: '',
developerMetadataLookup: {
locationMatchingStrategy: '',
locationType: '',
metadataId: 0,
metadataKey: '',
metadataLocation: {
dimensionRange: {dimension: '', endIndex: 0, sheetId: 0, startIndex: 0},
locationType: '',
sheetId: 0,
spreadsheet: false
},
metadataValue: '',
visibility: ''
},
gridRange: {
endColumnIndex: 0,
endRowIndex: 0,
sheetId: 0,
startColumnIndex: 0,
startRowIndex: 0
}
},
majorDimension: '',
values: []
}
],
includeValuesInResponse: false,
responseDateTimeRenderOption: '',
responseValueRenderOption: '',
valueInputOption: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"data":[{"dataFilter":{"a1Range":"","developerMetadataLookup":{"locationMatchingStrategy":"","locationType":"","metadataId":0,"metadataKey":"","metadataLocation":{"dimensionRange":{"dimension":"","endIndex":0,"sheetId":0,"startIndex":0},"locationType":"","sheetId":0,"spreadsheet":false},"metadataValue":"","visibility":""},"gridRange":{"endColumnIndex":0,"endRowIndex":0,"sheetId":0,"startColumnIndex":0,"startRowIndex":0}},"majorDimension":"","values":[]}],"includeValuesInResponse":false,"responseDateTimeRenderOption":"","responseValueRenderOption":"","valueInputOption":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"data": @[ @{ @"dataFilter": @{ @"a1Range": @"", @"developerMetadataLookup": @{ @"locationMatchingStrategy": @"", @"locationType": @"", @"metadataId": @0, @"metadataKey": @"", @"metadataLocation": @{ @"dimensionRange": @{ @"dimension": @"", @"endIndex": @0, @"sheetId": @0, @"startIndex": @0 }, @"locationType": @"", @"sheetId": @0, @"spreadsheet": @NO }, @"metadataValue": @"", @"visibility": @"" }, @"gridRange": @{ @"endColumnIndex": @0, @"endRowIndex": @0, @"sheetId": @0, @"startColumnIndex": @0, @"startRowIndex": @0 } }, @"majorDimension": @"", @"values": @[ ] } ],
@"includeValuesInResponse": @NO,
@"responseDateTimeRenderOption": @"",
@"responseValueRenderOption": @"",
@"valueInputOption": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
[
'dataFilter' => [
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
],
'majorDimension' => '',
'values' => [
]
]
],
'includeValuesInResponse' => null,
'responseDateTimeRenderOption' => '',
'responseValueRenderOption' => '',
'valueInputOption' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter', [
'body' => '{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'data' => [
[
'dataFilter' => [
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
],
'majorDimension' => '',
'values' => [
]
]
],
'includeValuesInResponse' => null,
'responseDateTimeRenderOption' => '',
'responseValueRenderOption' => '',
'valueInputOption' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'data' => [
[
'dataFilter' => [
'a1Range' => '',
'developerMetadataLookup' => [
'locationMatchingStrategy' => '',
'locationType' => '',
'metadataId' => 0,
'metadataKey' => '',
'metadataLocation' => [
'dimensionRange' => [
'dimension' => '',
'endIndex' => 0,
'sheetId' => 0,
'startIndex' => 0
],
'locationType' => '',
'sheetId' => 0,
'spreadsheet' => null
],
'metadataValue' => '',
'visibility' => ''
],
'gridRange' => [
'endColumnIndex' => 0,
'endRowIndex' => 0,
'sheetId' => 0,
'startColumnIndex' => 0,
'startRowIndex' => 0
]
],
'majorDimension' => '',
'values' => [
]
]
],
'includeValuesInResponse' => null,
'responseDateTimeRenderOption' => '',
'responseValueRenderOption' => '',
'valueInputOption' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"
payload = {
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": False
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": False,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter"
payload <- "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter') do |req|
req.body = "{\n \"data\": [\n {\n \"dataFilter\": {\n \"a1Range\": \"\",\n \"developerMetadataLookup\": {\n \"locationMatchingStrategy\": \"\",\n \"locationType\": \"\",\n \"metadataId\": 0,\n \"metadataKey\": \"\",\n \"metadataLocation\": {\n \"dimensionRange\": {\n \"dimension\": \"\",\n \"endIndex\": 0,\n \"sheetId\": 0,\n \"startIndex\": 0\n },\n \"locationType\": \"\",\n \"sheetId\": 0,\n \"spreadsheet\": false\n },\n \"metadataValue\": \"\",\n \"visibility\": \"\"\n },\n \"gridRange\": {\n \"endColumnIndex\": 0,\n \"endRowIndex\": 0,\n \"sheetId\": 0,\n \"startColumnIndex\": 0,\n \"startRowIndex\": 0\n }\n },\n \"majorDimension\": \"\",\n \"values\": []\n }\n ],\n \"includeValuesInResponse\": false,\n \"responseDateTimeRenderOption\": \"\",\n \"responseValueRenderOption\": \"\",\n \"valueInputOption\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter";
let payload = json!({
"data": (
json!({
"dataFilter": json!({
"a1Range": "",
"developerMetadataLookup": json!({
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": json!({
"dimensionRange": json!({
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
}),
"locationType": "",
"sheetId": 0,
"spreadsheet": false
}),
"metadataValue": "",
"visibility": ""
}),
"gridRange": json!({
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
})
}),
"majorDimension": "",
"values": ()
})
),
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter \
--header 'content-type: application/json' \
--data '{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}'
echo '{
"data": [
{
"dataFilter": {
"a1Range": "",
"developerMetadataLookup": {
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": {
"dimensionRange": {
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
},
"locationType": "",
"sheetId": 0,
"spreadsheet": false
},
"metadataValue": "",
"visibility": ""
},
"gridRange": {
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
}
},
"majorDimension": "",
"values": []
}
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "data": [\n {\n "dataFilter": {\n "a1Range": "",\n "developerMetadataLookup": {\n "locationMatchingStrategy": "",\n "locationType": "",\n "metadataId": 0,\n "metadataKey": "",\n "metadataLocation": {\n "dimensionRange": {\n "dimension": "",\n "endIndex": 0,\n "sheetId": 0,\n "startIndex": 0\n },\n "locationType": "",\n "sheetId": 0,\n "spreadsheet": false\n },\n "metadataValue": "",\n "visibility": ""\n },\n "gridRange": {\n "endColumnIndex": 0,\n "endRowIndex": 0,\n "sheetId": 0,\n "startColumnIndex": 0,\n "startRowIndex": 0\n }\n },\n "majorDimension": "",\n "values": []\n }\n ],\n "includeValuesInResponse": false,\n "responseDateTimeRenderOption": "",\n "responseValueRenderOption": "",\n "valueInputOption": ""\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"data": [
[
"dataFilter": [
"a1Range": "",
"developerMetadataLookup": [
"locationMatchingStrategy": "",
"locationType": "",
"metadataId": 0,
"metadataKey": "",
"metadataLocation": [
"dimensionRange": [
"dimension": "",
"endIndex": 0,
"sheetId": 0,
"startIndex": 0
],
"locationType": "",
"sheetId": 0,
"spreadsheet": false
],
"metadataValue": "",
"visibility": ""
],
"gridRange": [
"endColumnIndex": 0,
"endRowIndex": 0,
"sheetId": 0,
"startColumnIndex": 0,
"startRowIndex": 0
]
],
"majorDimension": "",
"values": []
]
],
"includeValuesInResponse": false,
"responseDateTimeRenderOption": "",
"responseValueRenderOption": "",
"valueInputOption": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values:batchUpdateByDataFilter")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
sheets.spreadsheets.values.clear
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear
QUERY PARAMS
spreadsheetId
range
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"),
Content = new StringContent("{}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:clear HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:clear',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear',
headers: {'content-type': 'application/json'},
body: {},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:clear", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear"
payload <- "{}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range:clear') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range:clear")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
sheets.spreadsheets.values.get
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range
QUERY PARAMS
spreadsheetId
range
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v4/spreadsheets/:spreadsheetId/values/:range HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range
http GET {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PUT
sheets.spreadsheets.values.update
{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range
QUERY PARAMS
spreadsheetId
range
BODY json
{
"majorDimension": "",
"range": "",
"values": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range" {:content-type :json
:form-params {:majorDimension ""
:range ""
:values []}})
require "http/client"
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"),
Content = new StringContent("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
payload := strings.NewReader("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PUT /baseUrl/v4/spreadsheets/:spreadsheetId/values/:range HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 57
{
"majorDimension": "",
"range": "",
"values": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.setHeader("content-type", "application/json")
.setBody("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.header("content-type", "application/json")
.body("{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
.asString();
const data = JSON.stringify({
majorDimension: '',
range: '',
values: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range',
headers: {'content-type': 'application/json'},
data: {majorDimension: '', range: '', values: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"majorDimension":"","range":"","values":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "majorDimension": "",\n "range": "",\n "values": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({majorDimension: '', range: '', values: []}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range',
headers: {'content-type': 'application/json'},
body: {majorDimension: '', range: '', values: []},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
majorDimension: '',
range: '',
values: []
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range',
headers: {'content-type': 'application/json'},
data: {majorDimension: '', range: '', values: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"majorDimension":"","range":"","values":[]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"majorDimension": @"",
@"range": @"",
@"values": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'majorDimension' => '',
'range' => '',
'values' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PUT', '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range', [
'body' => '{
"majorDimension": "",
"range": "",
"values": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'majorDimension' => '',
'range' => '',
'values' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'majorDimension' => '',
'range' => '',
'values' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"majorDimension": "",
"range": "",
"values": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"majorDimension": "",
"range": "",
"values": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
payload = {
"majorDimension": "",
"range": "",
"values": []
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range"
payload <- "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/v4/spreadsheets/:spreadsheetId/values/:range') do |req|
req.body = "{\n \"majorDimension\": \"\",\n \"range\": \"\",\n \"values\": []\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range";
let payload = json!({
"majorDimension": "",
"range": "",
"values": ()
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range \
--header 'content-type: application/json' \
--data '{
"majorDimension": "",
"range": "",
"values": []
}'
echo '{
"majorDimension": "",
"range": "",
"values": []
}' | \
http PUT {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "majorDimension": "",\n "range": "",\n "values": []\n}' \
--output-document \
- {{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"majorDimension": "",
"range": "",
"values": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/spreadsheets/:spreadsheetId/values/:range")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()