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.

PUT /async/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/async/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/async/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/async/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/async/spreadsheets/{SpreadsheetId}/sheets/{SheetId}/data/{Region}', headers = headers)

print(r.json())

Returns

202 - Accepted

Returns a JSON object with data and next_url properties. data contains an id property providing a unique identifier for the job. next_url contains a fully qualified URL, including required query parameters, to query for the job status. If there is no next page to query for, this will be empty.

Example Responses


{
  "data": {
    "id": "bd9iOjhlYmViZDY2YjdkYzQzMHU5NmU5MWQ4YzRjMTNiOWYwOjI"
  },
  "next_url": "https://api.app.wdesk.com/spreadsheets/v1/queue-jobs/bd9iOjhlYmViZDY2YjdkYzQzMHU5NmU5MWQ4YzRjMTNiOWYwOjI",
  "request_id": "d6a6ce3f-f120-4104-9587-a5a2dc45626c"
}