spreadsheets

POST /v4/spreadsheets/{spreadsheetId}/values:batchUpdate

Changed on

Sets values in one or more ranges of a spreadsheet. The caller must specify the spreadsheet ID, a valueInputOption, and one or more ValueRanges.

Request

  • Base URL
    https://sheets.googleapis.com
  • Auth
    • OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/drive
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/drive
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/drive.file
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/drive.file
    • or OAuth 2 and OAuth 2
      Implicithttps://accounts.google.com/o/oauth2/auth
      Scopeshttps://www.googleapis.com/auth/spreadsheets
      Authorization codehttps://accounts.google.com/o/oauth2/auth
      Token URLhttps://accounts.google.com/o/oauth2/token
      Scopeshttps://www.googleapis.com/auth/spreadsheets

Path parameters

spreadsheetId, string required

The ID of the spreadsheet to update.

Query parameters

$.xgafv, '1' | '2'

V1 error format.

access_token, string

OAuth access token.

alt, 'json' | 'media' | 'proto'

Data format for response.

callback, string

JSONP

fields, string

Selector specifying which fields to include in a partial response.

key, string

API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

oauth_token, string

OAuth 2.0 token for the current user.

prettyPrint, boolean

Returns response with indentations and line breaks.

quotaUser, string

Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

uploadType, string

Legacy upload protocol for media (e.g. "media", "multipart").

upload_protocol, string

Upload protocol for media (e.g. "raw", "multipart").

Request body

BatchUpdateValuesRequest required

The request for updating more than one range of values in a spreadsheet.

data, ValueRange[]

The new values to apply to the spreadsheet.

includeValuesInResponse, boolean

Determines if the update response should include the values of the cells that were updated. By default, responses do not include the updated values. The updatedData field within each of the BatchUpdateValuesResponse.responses contains the updated values. If the range to write was larger than the range actually written, the response includes all values in the requested range (excluding trailing empty rows and columns).

responseDateTimeRenderOption, 'SERIAL_NUMBER' | 'FORMATTED_STRING'

Determines how dates, times, and durations in the response should be rendered. This is ignored if response_value_render_option is FORMATTED_VALUE. The default dateTime render option is SERIAL_NUMBER.

responseValueRenderOption, 'FORMATTED_VALUE' | 'UNFORMATTED_VALUE' | 'FORMULA'

Determines how values in the response should be rendered. The default render option is FORMATTED_VALUE.

valueInputOption, 'INPUT_VALUE_OPTION_UNSPECIFIED' | 'RAW' | 'USER_ENTERED'

How the input data should be interpreted.

Response

Successful response

BatchUpdateValuesResponse required

The response when updating a range of values in a spreadsheet.

responses, UpdateValuesResponse[]

One UpdateValuesResponse per requested range, in the same order as the requests appeared.

spreadsheetId, string

The spreadsheet the updates were applied to.

totalUpdatedCells, integer

The total number of cells updated.

totalUpdatedColumns, integer

The total number of columns where at least one cell in the column was updated.

totalUpdatedRows, integer

The total number of rows where at least one cell in the row was updated.

totalUpdatedSheets, integer

The total number of sheets where at least one cell in the sheet was updated.

Changes

    • info

      the security scope https://www.googleapis.com/auth/drive was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/drive was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/spreadsheets was removed from the endpoint's security scheme Oauth2

    1 more change in this revision