批量设置单元格样式

PUT {{base_url}}/sheets/v2/spreadsheets/:spreadsheetToken/styles_batch_update

该接口用于根据 spreadsheetToken 、range和样式信息 批量更新单元格样式;单次写入不超过5000行,100列。

参考接口文档:批量设置单元格样式

Request Body

{"data"=>[{"ranges"=>["1QXD0s!C7:E12", "1QXD0s!I20:K27"], "style"=>{"font"=>{"bold"=>true, "italic"=>true, "fontSize"=>"10pt/1.5", "clean"=>false}, "textDecoration"=>0, "formatter"=>"", "hAlign"=>0, "vAlign"=>0, "foreColor"=>"#000000", "backColor"=>"#21d11f", "borderType"=>"FULL_BORDER", "borderColor"=>"#ff0000", "clean"=>false}}, {"ranges"=>["1QXD0s!A1:C2"], "style"=>{"font"=>{"bold"=>true, "italic"=>true, "fontSize"=>"10pt/1.5", "clean"=>false}, "textDecoration"=>0, "formatter"=>"", "hAlign"=>0, "vAlign"=>0, "foreColor"=>"#000000", "backColor"=>"#21d11f", "borderType"=>"FULL_BORDER", "borderColor"=>"#ff0000", "clean"=>false}}]}

RESPONSES

status: OK

{"code":0,"data":{"responses":[{"spreadsheetToken":"shtcnyAti49vOKImQyn4ZH8rzLg","updatedCells":18,"updatedColumns":3,"updatedRange":"1QXD0s!C7:E12","updatedRows":6},{"spreadsheetToken":"shtcnyAti49vOKImQyn4ZH8rzLg","updatedCells":24,"updatedColumns":3,"updatedRange":"1QXD0s!I20:K27","updatedRows":8},{"spreadsheetToken":"shtcnyAti49vOKImQyn4ZH8rzLg","updatedCells":6,"updatedColumns":3,"updatedRange":"1QXD0s!A1:C2","updatedRows":2}],"revision":14,"spreadsheetToken":"shtcnyAti49vOKImQyn4ZH8rzLg","totalUpdatedCells":51,"totalUpdatedColumns":9,"totalUpdatedRows":16},"msg":"success"}