如果您需要在应用中使用 Apps Script API,则必须在应用的 Google Cloud 项目中启用该 API。这样,您就可以创建 OAuth 凭据,以便应用用户对其进行授权。
如果您想让第三方应用管理脚本项目的内容或部署,则必须向其授予访问权限。
在应用中使用 Apps Script API
如果您想在应用中使用 Apps Script API,则必须在应用的 GCP 项目中启用 Apps Script API。启用 Apps Script API 后,您可以创建 OAuth 凭据,并下载要添加到应用中的客户端 ID 和密钥。您还可以在 Google Cloud 控制台中监控 API 用量。
您可以使用此向导在 API 控制台中创建或选择 Google Cloud 项目,并自动启用该 API。或者,您也可以打开控制台的管理资源页面,选择一个项目,然后使用该项目的API 和服务信息中心手动搜索并添加 Apps Script API。启用该 API 后,您可以在 API 和服务 > 凭据面板中为应用创建 OAuth 凭据、客户端 ID 和客户端密钥。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-22。"],[[["The Apps Script API requires enabling in your Google Cloud project to use it within your own application, allowing you to create OAuth credentials for user authorization."],["To allow external applications to manage your script projects, you must grant access to them through the Apps Script dashboard, understanding the potential security risks involved."],["Granting access enables third-party applications to create, modify, and deploy your Apps Script projects but does not automatically authorize them; individual authorization is still required."],["Executing Apps Script functions through the API does not necessitate granting access to your script projects."]]],[]]