1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="script_v1.html">Apps Script API</a> . <a href="script_v1.projects.html">projects</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="script_v1.projects.deployments.html">deployments()</a></code> 79</p> 80<p class="firstline">Returns the deployments Resource.</p> 81 82<p class="toc_element"> 83 <code><a href="script_v1.projects.versions.html">versions()</a></code> 84</p> 85<p class="firstline">Returns the versions Resource.</p> 86 87<p class="toc_element"> 88 <code><a href="#create">create(body, x__xgafv=None)</a></code></p> 89<p class="firstline">Creates a new, empty script project with no script files and a base</p> 90<p class="toc_element"> 91 <code><a href="#get">get(scriptId, x__xgafv=None)</a></code></p> 92<p class="firstline">Gets a script project's metadata.</p> 93<p class="toc_element"> 94 <code><a href="#getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</a></code></p> 95<p class="firstline">Gets the content of the script project, including the code source and</p> 96<p class="toc_element"> 97 <code><a href="#getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, x__xgafv=None, metricsGranularity=None)</a></code></p> 98<p class="firstline">Get metrics data for scripts, such as number of executions and</p> 99<p class="toc_element"> 100 <code><a href="#updateContent">updateContent(scriptId, body, x__xgafv=None)</a></code></p> 101<p class="firstline">Updates the content of the specified script project.</p> 102<h3>Method Details</h3> 103<div class="method"> 104 <code class="details" id="create">create(body, x__xgafv=None)</code> 105 <pre>Creates a new, empty script project with no script files and a base 106manifest file. 107 108Args: 109 body: object, The request body. (required) 110 The object takes the form of: 111 112{ # Request to create a script project. 113 "title": "A String", # The title for the project. 114 "parentId": "A String", # The Drive ID of a parent file that the created script project is bound to. 115 # This is usually the ID of a Google Doc, Google Sheet, Google Form, or 116 # Google Slides file. If not set, a standalone script project is created. 117 } 118 119 x__xgafv: string, V1 error format. 120 Allowed values 121 1 - v1 error format 122 2 - v2 error format 123 124Returns: 125 An object of the form: 126 127 { # The script project resource. 128 "updateTime": "A String", # When the script was last updated. 129 "lastModifyUser": { # A simple user profile resource. # User who last modified the script. 130 "domain": "A String", # The user's domain. 131 "email": "A String", # The user's identifying email address. 132 "name": "A String", # The user's display name. 133 "photoUrl": "A String", # The user's photo. 134 }, 135 "title": "A String", # The title for the project. 136 "creator": { # A simple user profile resource. # User who originally created the script. 137 "domain": "A String", # The user's domain. 138 "email": "A String", # The user's identifying email address. 139 "name": "A String", # The user's display name. 140 "photoUrl": "A String", # The user's photo. 141 }, 142 "scriptId": "A String", # The script project's Drive ID. 143 "parentId": "A String", # The parent's Drive ID that the script will be attached to. This is usually 144 # the ID of a Google Document or Google Sheet. This filed is optional, and 145 # if not set, a stand-alone script will be created. 146 "createTime": "A String", # When the script was created. 147 }</pre> 148</div> 149 150<div class="method"> 151 <code class="details" id="get">get(scriptId, x__xgafv=None)</code> 152 <pre>Gets a script project's metadata. 153 154Args: 155 scriptId: string, The script project's Drive ID. (required) 156 x__xgafv: string, V1 error format. 157 Allowed values 158 1 - v1 error format 159 2 - v2 error format 160 161Returns: 162 An object of the form: 163 164 { # The script project resource. 165 "updateTime": "A String", # When the script was last updated. 166 "lastModifyUser": { # A simple user profile resource. # User who last modified the script. 167 "domain": "A String", # The user's domain. 168 "email": "A String", # The user's identifying email address. 169 "name": "A String", # The user's display name. 170 "photoUrl": "A String", # The user's photo. 171 }, 172 "title": "A String", # The title for the project. 173 "creator": { # A simple user profile resource. # User who originally created the script. 174 "domain": "A String", # The user's domain. 175 "email": "A String", # The user's identifying email address. 176 "name": "A String", # The user's display name. 177 "photoUrl": "A String", # The user's photo. 178 }, 179 "scriptId": "A String", # The script project's Drive ID. 180 "parentId": "A String", # The parent's Drive ID that the script will be attached to. This is usually 181 # the ID of a Google Document or Google Sheet. This filed is optional, and 182 # if not set, a stand-alone script will be created. 183 "createTime": "A String", # When the script was created. 184 }</pre> 185</div> 186 187<div class="method"> 188 <code class="details" id="getContent">getContent(scriptId, versionNumber=None, x__xgafv=None)</code> 189 <pre>Gets the content of the script project, including the code source and 190metadata for each script file. 191 192Args: 193 scriptId: string, The script project's Drive ID. (required) 194 versionNumber: integer, The version number of the project to retrieve. If not provided, the 195project's HEAD version is returned. 196 x__xgafv: string, V1 error format. 197 Allowed values 198 1 - v1 error format 199 2 - v2 error format 200 201Returns: 202 An object of the form: 203 204 { # The Content resource. 205 "files": [ # The list of script project files. 206 # One of the files is a script manifest; it must be named "appsscript", 207 # must have type of JSON, and include the manifest configurations for the 208 # project. 209 { # An individual file within a script project. 210 # A file is a third-party source code created by one or more 211 # developers. It can be a server-side JS code, HTML, or a 212 # configuration file. Each script project can contain multiple files. 213 "updateTime": "A String", # Last modified date timestamp. 214 # This read-only field is only visible to users who have WRITER 215 # permission for the script project. 216 "lastModifyUser": { # A simple user profile resource. # The user who modified the file most recently. 217 # This read-only field is only visible to users who have WRITER 218 # permission for the script project. 219 "domain": "A String", # The user's domain. 220 "email": "A String", # The user's identifying email address. 221 "name": "A String", # The user's display name. 222 "photoUrl": "A String", # The user's photo. 223 }, 224 "source": "A String", # The file content. 225 "functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. 226 "values": [ # A list of functions composing the set. 227 { # Represents a function in a script project. 228 "name": "A String", # The function name in the script project. 229 }, 230 ], 231 }, 232 "type": "A String", # The type of the file. 233 "createTime": "A String", # Creation date timestamp. 234 # This read-only field is only visible to users who have WRITER 235 # permission for the script project. 236 "name": "A String", # The name of the file. The file extension is not part of the file 237 # name, which can be identified from the type field. 238 }, 239 ], 240 "scriptId": "A String", # The script project's Drive ID. 241 }</pre> 242</div> 243 244<div class="method"> 245 <code class="details" id="getMetrics">getMetrics(scriptId, metricsFilter_deploymentId=None, x__xgafv=None, metricsGranularity=None)</code> 246 <pre>Get metrics data for scripts, such as number of executions and 247active users. 248 249Args: 250 scriptId: string, Required field indicating the script to get metrics for. (required) 251 metricsFilter_deploymentId: string, Optional field indicating a specific deployment to retrieve metrics from. 252 x__xgafv: string, V1 error format. 253 Allowed values 254 1 - v1 error format 255 2 - v2 error format 256 metricsGranularity: string, Required field indicating what granularity of metrics are returned. 257 258Returns: 259 An object of the form: 260 261 { # Resource containing usage stats for a given script, based on the supplied 262 # filter and mask present in the request. 263 "totalExecutions": [ # Number of total executions. 264 { # Metrics value that holds number of executions counted. 265 "endTime": "A String", # Required field indicating the end time of the interval. 266 "startTime": "A String", # Required field indicating the start time of the interval. 267 "value": "A String", # Indicates the number of executions counted. 268 }, 269 ], 270 "activeUsers": [ # Number of active users. 271 { # Metrics value that holds number of executions counted. 272 "endTime": "A String", # Required field indicating the end time of the interval. 273 "startTime": "A String", # Required field indicating the start time of the interval. 274 "value": "A String", # Indicates the number of executions counted. 275 }, 276 ], 277 "failedExecutions": [ # Number of failed executions. 278 { # Metrics value that holds number of executions counted. 279 "endTime": "A String", # Required field indicating the end time of the interval. 280 "startTime": "A String", # Required field indicating the start time of the interval. 281 "value": "A String", # Indicates the number of executions counted. 282 }, 283 ], 284 }</pre> 285</div> 286 287<div class="method"> 288 <code class="details" id="updateContent">updateContent(scriptId, body, x__xgafv=None)</code> 289 <pre>Updates the content of the specified script project. 290This content is stored as the HEAD version, and is used when the script is 291executed as a trigger, in the script editor, in add-on preview mode, or as 292a web app or Apps Script API in development mode. This clears all the 293existing files in the project. 294 295Args: 296 scriptId: string, The script project's Drive ID. (required) 297 body: object, The request body. (required) 298 The object takes the form of: 299 300{ # The Content resource. 301 "files": [ # The list of script project files. 302 # One of the files is a script manifest; it must be named "appsscript", 303 # must have type of JSON, and include the manifest configurations for the 304 # project. 305 { # An individual file within a script project. 306 # A file is a third-party source code created by one or more 307 # developers. It can be a server-side JS code, HTML, or a 308 # configuration file. Each script project can contain multiple files. 309 "updateTime": "A String", # Last modified date timestamp. 310 # This read-only field is only visible to users who have WRITER 311 # permission for the script project. 312 "lastModifyUser": { # A simple user profile resource. # The user who modified the file most recently. 313 # This read-only field is only visible to users who have WRITER 314 # permission for the script project. 315 "domain": "A String", # The user's domain. 316 "email": "A String", # The user's identifying email address. 317 "name": "A String", # The user's display name. 318 "photoUrl": "A String", # The user's photo. 319 }, 320 "source": "A String", # The file content. 321 "functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. 322 "values": [ # A list of functions composing the set. 323 { # Represents a function in a script project. 324 "name": "A String", # The function name in the script project. 325 }, 326 ], 327 }, 328 "type": "A String", # The type of the file. 329 "createTime": "A String", # Creation date timestamp. 330 # This read-only field is only visible to users who have WRITER 331 # permission for the script project. 332 "name": "A String", # The name of the file. The file extension is not part of the file 333 # name, which can be identified from the type field. 334 }, 335 ], 336 "scriptId": "A String", # The script project's Drive ID. 337} 338 339 x__xgafv: string, V1 error format. 340 Allowed values 341 1 - v1 error format 342 2 - v2 error format 343 344Returns: 345 An object of the form: 346 347 { # The Content resource. 348 "files": [ # The list of script project files. 349 # One of the files is a script manifest; it must be named "appsscript", 350 # must have type of JSON, and include the manifest configurations for the 351 # project. 352 { # An individual file within a script project. 353 # A file is a third-party source code created by one or more 354 # developers. It can be a server-side JS code, HTML, or a 355 # configuration file. Each script project can contain multiple files. 356 "updateTime": "A String", # Last modified date timestamp. 357 # This read-only field is only visible to users who have WRITER 358 # permission for the script project. 359 "lastModifyUser": { # A simple user profile resource. # The user who modified the file most recently. 360 # This read-only field is only visible to users who have WRITER 361 # permission for the script project. 362 "domain": "A String", # The user's domain. 363 "email": "A String", # The user's identifying email address. 364 "name": "A String", # The user's display name. 365 "photoUrl": "A String", # The user's photo. 366 }, 367 "source": "A String", # The file content. 368 "functionSet": { # A set of functions. No duplicates are permitted. # The defined set of functions in the script file, if any. 369 "values": [ # A list of functions composing the set. 370 { # Represents a function in a script project. 371 "name": "A String", # The function name in the script project. 372 }, 373 ], 374 }, 375 "type": "A String", # The type of the file. 376 "createTime": "A String", # Creation date timestamp. 377 # This read-only field is only visible to users who have WRITER 378 # permission for the script project. 379 "name": "A String", # The name of the file. The file extension is not part of the file 380 # name, which can be identified from the type field. 381 }, 382 ], 383 "scriptId": "A String", # The script project's Drive ID. 384 }</pre> 385</div> 386 387</body></html>