Method: projects.updateContent Stay organized with collections Save and categorize content based on your preferences.
Page Summary
This API updates the content of a specified script project, overwriting existing files and storing the new content as the HEAD version used for various execution contexts.
The request uses a PUT HTTP method to the specified endpoint including the
scriptIdas a path parameter.The request body must contain a JSON object with a
filesarray, where each object represents a script project file including a required manifest file named "appsscript".A successful response returns an instance of
Content.Authorization requires the
https://www.googleapis.com/auth/script.projectsOAuth scope.
Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.
HTTP request
PUT https://script.googleapis.com/v1/projects/{scriptId}/content
The URL usesgRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
scriptId |
The script project's Drive ID. |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{"files":[{object ( |
| Fields | |
|---|---|
files[] |
The list of script project files. One of the files is a script manifest; it must be named "appsscript", must have type of JSON, and include the manifest configurations for the project. |
Response body
If successful, the response body contains an instance ofContent.
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/script.projects
For more information, see theOAuth 2.0 Overview.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.