API Reference

Description

Overwrites all data in a region with new data. If the provided range data is smaller than the specified region, all cells in the region and not covered by the range data will be cleared. The provided range data must not be larger than the specified region. An empty range data is valid and may be used to clear a region.

If a very large payload is supplied, or changes to the updated region trigger complex formula recalculations, the operation may result in an error. If this is encountered frequently, consider using the corresponding Asynchronous update endpoint to asynchronously write data to a region instead.

PUT /spreadsheets/{SpreadsheetId}/sheets/{SheetId}/data/{Region}

🚧

Required OAuth Scopes:

data_tables|w

Parameters

ParameterInTypeRequiredDescription
SpreadsheetIdpathstringtrueA unique identifier for a spreadsheet
SheetIdpathstringtrueA unique identifier for a sheet within a spreadsheet
RegionpathstringtrueA1 style representation of a cell or range. A range may be unbounded in any/all directions by leaving off the corresponding column or row. Unbounded ranges will be clamped to the data in the queried region.
bodybodyRangeDataBodytrueMultidimensional array of cell values in row-major order. The null JSON value may be used to avoid modifying a cell.

Detailed descriptions

Region: A1 style representation of a cell or range. A range may be unbounded in any/all directions by leaving off the corresponding column or row. Unbounded ranges will be clamped to the data in the queried region.

Cell Syntax: [Column][Row]

Range Syntax: [Start Column][Start Row]:[Stop Column][Stop Row]

Examples:

  • The region A1 selects data in the cell A1
  • The region A2:D8 selects all data in the range between A2 and D8 (inclusive)
  • The region A:A selects all data in column A
  • The region 1:3 selects all data in rows 1 through 3
  • The region B3: selects all data below and to the right of B3 (inclusive)
  • The region : selects all data in the sheet

Be sure to URL encode the region to avoid misinterpretation of the :.

Body parameter example

{
  "values": [
    [
      "Row1-Column1 Data",
      "Row1-Column2 Data"
    ],
    [
      "Row2-Column1 Data",
      "Row2-Column2 Data"
    ]
  ]
}

Code Samples

curl -X PUT https://api.app.wdesk.com/spreadsheets/v1/spreadsheets/{SpreadsheetId}/sheets/{SheetId}/data/{Region}  \ 
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http PUT https://api.app.wdesk.com/spreadsheets/v1/spreadsheets/{SpreadsheetId}/sheets/{SheetId}/data/{Region}  \ 
Content-Type:application/json \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=PUT "https://api.app.wdesk.com/spreadsheets/v1/spreadsheets/{SpreadsheetId}/sheets/{SheetId}/data/{Region}" \
 --output-document -  \ 
 --header 'Content-Type: application/json' \ 
 --header 'Accept: application/json' \ 
 --header 'Authorization: Bearer {access-token}'
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('https://api.app.wdesk.com/spreadsheets/v1/spreadsheets/{SpreadsheetId}/sheets/{SheetId}/data/{Region}', headers = headers)

print(r.json())

Returns

200 - OK

No content returned.

Example Responses


{
  "message": "Operation successful",
  "request_id": "d6a6ce3f-f120-4104-9587-a5a2dc45626c"
}