Apps Script API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
จัดการและดำเนินโครงการ Google Apps Script
บริการ: Script.googleapis.com
หากต้องการเรียกใช้บริการนี้ เราขอแนะนำให้คุณใช้ไลบรารีของไคลเอ็นต์ที่ Google มีให้ หากแอปพลิเคชันจำเป็นต้องใช้ไลบรารีของคุณเองเพื่อเรียกใช้บริการนี้ ให้ใช้ข้อมูลต่อไปนี้เมื่อคุณส่งคำขอ API
เอกสารการค้นพบ
เอกสารการค้นพบเป็นข้อกำหนดที่เครื่องอ่านได้สำหรับการอธิบายและใช้งาน REST API ใช้สำหรับสร้างไลบรารีของไคลเอ็นต์, ปลั๊กอิน IDE และเครื่องมืออื่นๆ ที่โต้ตอบกับ Google APIs บริการเดียวอาจมีเอกสารการค้นพบได้หลายรายการ บริการนี้มีเอกสารการค้นพบต่อไปนี้
ปลายทางบริการ
ปลายทางของบริการคือ URL พื้นฐานที่ระบุที่อยู่เครือข่ายของบริการ API บริการเดียวอาจมีปลายทางบริการหลายรายการ บริการนี้มีปลายทางบริการต่อไปนี้และ URI ด้านล่างทั้งหมดจะเกี่ยวข้องกับปลายทางของบริการนี้
https://script.googleapis.com
วิธีการ |
list |
GET /v1/processes
แสดงข้อมูลเกี่ยวกับขั้นตอนที่ผู้ใช้ทำหรือในนามของผู้ใช้ เช่น ประเภทกระบวนการและสถานะปัจจุบัน |
listScriptProcesses |
GET /v1/processes:listScriptProcesses
แสดงข้อมูลเกี่ยวกับกระบวนการที่สคริปต์ดำเนินการ เช่น ประเภทกระบวนการและสถานะปัจจุบัน |
วิธีการ |
create |
POST /v1/projects
สร้างโปรเจ็กต์สคริปต์ใหม่ที่ว่างเปล่าโดยไม่มีไฟล์สคริปต์และไฟล์ Manifest พื้นฐาน |
get |
GET /v1/projects/{scriptId}
รับข้อมูลเมตาของโปรเจ็กต์สคริปต์ |
getContent |
GET /v1/projects/{scriptId}/content
รับเนื้อหาของโปรเจ็กต์สคริปต์ รวมถึงแหล่งที่มาของโค้ดและข้อมูลเมตาสำหรับไฟล์สคริปต์แต่ละไฟล์ |
getMetrics |
GET /v1/projects/{scriptId}/metrics
รับข้อมูลเมตริกสำหรับสคริปต์ เช่น จำนวนการดำเนินการและผู้ใช้ที่ใช้งานอยู่ |
updateContent |
PUT /v1/projects/{scriptId}/content
อัปเดตเนื้อหาของโปรเจ็กต์สคริปต์ที่ระบุ |
วิธีการ |
create |
POST /v1/projects/{scriptId}/deployments
สร้างการทำให้ใช้งานได้ของโปรเจ็กต์ Apps Script |
delete |
DELETE /v1/projects/{scriptId}/deployments/{deploymentId}
ลบการติดตั้งใช้งานโปรเจ็กต์ Apps Script |
get |
GET /v1/projects/{scriptId}/deployments/{deploymentId}
รับการทำให้โปรเจ็กต์ Apps Script ใช้งานได้ |
list |
GET /v1/projects/{scriptId}/deployments
แสดงรายการการติดตั้งใช้งานโปรเจ็กต์ Apps Script |
update |
PUT /v1/projects/{deploymentConfig.scriptId}/deployments/{deploymentId}
อัปเดตการติดตั้งใช้งานโปรเจ็กต์ Apps Script |
วิธีการ |
create |
POST /v1/projects/{scriptId}/versions
สร้างเวอร์ชันใหม่ที่เปลี่ยนแปลงไม่ได้โดยใช้รหัสปัจจุบัน โดยมีหมายเลขเวอร์ชันที่ไม่ซ้ำกัน |
get |
GET /v1/projects/{scriptId}/versions/{versionNumber}
รับเวอร์ชันของโปรเจ็กต์สคริปต์ |
list |
GET /v1/projects/{scriptId}/versions
แสดงรายการเวอร์ชันของโปรเจ็กต์สคริปต์ |
วิธีการ |
run |
POST /v1/scripts/{scriptId}:run
เรียกใช้ฟังก์ชันในโปรเจ็กต์ Apps Script |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eThe Apps Script API manages and executes Google Apps Script projects, providing functionality for creating, deploying, and running scripts.\u003c/p\u003e\n"],["\u003cp\u003eIt offers REST resources for managing projects, deployments, versions, processes, and scripts themselves, allowing programmatic control over various aspects of Apps Script projects.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage the API using Google-provided client libraries or their own libraries by adhering to the provided discovery document and service endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe API enables functionalities such as retrieving project metadata, updating script content, listing deployments, running script functions, and managing versions.\u003c/p\u003e\n"],["\u003cp\u003eUsers can manage and execute Google Apps Scripts projects.\u003c/p\u003e\n"]]],[],null,["# Apps Script API\n\nManages and executes Google Apps Script projects.\n\n- [REST Resource: v1.processes](#v1.processes)\n- [REST Resource: v1.projects](#v1.projects)\n- [REST Resource: v1.projects.deployments](#v1.projects.deployments)\n- [REST Resource: v1.projects.versions](#v1.projects.versions)\n- [REST Resource: v1.scripts](#v1.scripts)\n\nService: script.googleapis.com\n------------------------------\n\nTo call this service, we recommend that you use the Google-provided [client libraries](https://cloud.google.com/apis/docs/client-libraries-explained). If your application needs to use your own libraries to call this service, use the following information when you make the API requests.\n\n### Discovery document\n\nA [Discovery Document](https://developers.google.com/discovery/v1/reference/apis) is a machine-readable specification for describing and consuming REST APIs. It is used to build client libraries, IDE plugins, and other tools that interact with Google APIs. One service may provide multiple discovery documents. This service provides the following discovery document:\n\n- \u003chttps://script.googleapis.com/$discovery/rest?version=v1\u003e\n\n### Service endpoint\n\nA [service endpoint](https://cloud.google.com/apis/design/glossary#api_service_endpoint) is a base URL that specifies the network address of an API service. One service might have multiple service endpoints. This service has the following service endpoint and all URIs below are relative to this service endpoint:\n\n- `https://script.googleapis.com`\n\nREST Resource: [v1.processes](/apps-script/api/reference/rest/v1/processes)\n---------------------------------------------------------------------------\n\n| Methods ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| [list](/apps-script/api/reference/rest/v1/processes/list) | `GET /v1/processes` List information about processes made by or on behalf of a user, such as process type and current status. |\n| [listScriptProcesses](/apps-script/api/reference/rest/v1/processes/listScriptProcesses) | `GET /v1/processes:listScriptProcesses` List information about a script's executed processes, such as process type and current status. |\n\nREST Resource: [v1.projects](/apps-script/api/reference/rest/v1/projects)\n-------------------------------------------------------------------------\n\n| Methods ||\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [create](/apps-script/api/reference/rest/v1/projects/create) | `POST /v1/projects` Creates a new, empty script project with no script files and a base manifest file. |\n| [get](/apps-script/api/reference/rest/v1/projects/get) | `GET /v1/projects/{scriptId}` Gets a script project's metadata. |\n| [getContent](/apps-script/api/reference/rest/v1/projects/getContent) | `GET /v1/projects/{scriptId}/content` Gets the content of the script project, including the code source and metadata for each script file. |\n| [getMetrics](/apps-script/api/reference/rest/v1/projects/getMetrics) | `GET /v1/projects/{scriptId}/metrics` Get metrics data for scripts, such as number of executions and active users. |\n| [updateContent](/apps-script/api/reference/rest/v1/projects/updateContent) | `PUT /v1/projects/{scriptId}/content` Updates the content of the specified script project. |\n\nREST Resource: [v1.projects.deployments](/apps-script/api/reference/rest/v1/projects.deployments)\n-------------------------------------------------------------------------------------------------\n\n| Methods ||\n|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| [create](/apps-script/api/reference/rest/v1/projects.deployments/create) | `POST /v1/projects/{scriptId}/deployments` Creates a deployment of an Apps Script project. |\n| [delete](/apps-script/api/reference/rest/v1/projects.deployments/delete) | `DELETE /v1/projects/{scriptId}/deployments/{deploymentId}` Deletes a deployment of an Apps Script project. |\n| [get](/apps-script/api/reference/rest/v1/projects.deployments/get) | `GET /v1/projects/{scriptId}/deployments/{deploymentId}` Gets a deployment of an Apps Script project. |\n| [list](/apps-script/api/reference/rest/v1/projects.deployments/list) | `GET /v1/projects/{scriptId}/deployments` Lists the deployments of an Apps Script project. |\n| [update](/apps-script/api/reference/rest/v1/projects.deployments/update) | `PUT /v1/projects/{deploymentConfig.scriptId}/deployments/{deploymentId}` Updates a deployment of an Apps Script project. |\n\nREST Resource: [v1.projects.versions](/apps-script/api/reference/rest/v1/projects.versions)\n-------------------------------------------------------------------------------------------\n\n| Methods ||\n|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|\n| [create](/apps-script/api/reference/rest/v1/projects.versions/create) | `POST /v1/projects/{scriptId}/versions` Creates a new immutable version using the current code, with a unique version number. |\n| [get](/apps-script/api/reference/rest/v1/projects.versions/get) | `GET /v1/projects/{scriptId}/versions/{versionNumber}` Gets a version of a script project. |\n| [list](/apps-script/api/reference/rest/v1/projects.versions/list) | `GET /v1/projects/{scriptId}/versions` List the versions of a script project. |\n\nREST Resource: [v1.scripts](/apps-script/api/reference/rest/v1/scripts)\n-----------------------------------------------------------------------\n\n| Methods ||\n|-------------------------------------------------------|------------------------------------------------------------------------------|\n| [run](/apps-script/api/reference/rest/v1/scripts/run) | `POST /v1/scripts/{scriptId}:run` Runs a function in an Apps Script project. |"]]