v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-13163149.1 KB
scripts

post/v1/scripts/{scriptId}:run

Path parameters

scriptIdstring required

The script ID of the script to be executed. Find the script ID on the Project settings page under "IDs." As multiple executable APIs can be deployed in new IDE for same script, this field should be populated with DeploymentID generated while deploying in new IDE instead of script ID.

Request body

devModeboolean

If true and the user is an owner of the script, the script runs at the most recently saved version rather than the version deployed for use with the Apps Script API. Optional; default is false.

functionstring

The name of the function to execute in the given script. The name does not include parentheses or parameters. It can reference a function in an included library such as Library.libFunction1.

sessionStatestring

Deprecated. For use with Android add-ons only. An ID that represents the user's current session in the Android app for Google Docs or Sheets, included as extra data in the Intent that launches the add-on. When an Android add-on is run with a session state, it gains the privileges of a bound script—that is, it can access information like the user's current cursor position (in Docs) or selected cell (in Sheets). To retrieve the state, call Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState"). Optional.

Response

Successful response