對話動作已於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
Actions API
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Actions API 適用的 REST 服務。
服務:actions.googleapis.com
如要呼叫這項服務,建議您使用 Google 提供的用戶端程式庫。如果應用程式需要使用您自己的程式庫來呼叫這項服務,請在提出 API 要求時使用下列資訊。
探索文件
探索文件是一種機器可解讀的規格,用於說明和使用 REST API。此文件用於建構用戶端程式庫、IDE 外掛程式,以及與 Google API 互動的其他工具。一項服務可能會提供多個探索文件。這項服務提供下列探索文件:
服務端點
服務端點是指定 API 服務網路位址的基準網址。一項服務可能有多個服務端點。這項服務有以下服務端點,且下方的 URI 皆以此服務端點為基準:
https://actions.googleapis.com
方法 |
matchIntents |
POST /v2/{project=projects/*}:matchIntents 尋找符合特定查詢的意圖。 |
sendInteraction |
POST /v2/{project=projects/*}:sendInteraction
播放一回合的對話。 |
方法 |
read |
POST /v2/{name=projects/*/draft}:read 讀取專案草稿的完整內容。 |
write |
POST /v2/{parent=projects/*}/draft:write
根據模型更新專案草稿。 |
方法 |
write |
POST /v2/{parent=projects/*}/preview:write
根據模型更新使用者的專案預覽畫面。 |
方法 |
list |
GET /v2/{parent=projects/*}/releaseChannels 列出所有發布版本和對應的版本 (如有)。 |
方法 |
create |
POST /v2/{parent=projects/*}/versions:create
根據模型建立專案版本,並觸發部署至指定的發布版本 (如有指定)。 |
list |
GET /v2/{parent=projects/*}/versions 列出所有版本及其目前狀態。 |
read |
POST /v2/{name=projects/*/versions/*}:read 讀取專案版本的完整內容。 |
方法 |
list |
GET /v2/sampleProjects
列出 Gactions CLI 支援的所有範例專案。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[null,null,["上次更新時間:2025-07-26 (世界標準時間)。"],[[["\u003cp\u003eThis is a RESTful API service for Google Actions, allowing developers to build and manage conversational experiences.\u003c/p\u003e\n"],["\u003cp\u003eIt provides access to various resources for tasks like intent matching, conversation interactions, project draft management, and version control.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can leverage Google-provided client libraries or utilize the provided discovery document and service endpoint for custom integrations.\u003c/p\u003e\n"],["\u003cp\u003eThe service offers functionalities for encrypting/decrypting secrets, managing web and app activity control, and working with sample projects.\u003c/p\u003e\n"],["\u003cp\u003eAll API requests are relative to the service endpoint: \u003ccode\u003ehttps://actions.googleapis.com\u003c/code\u003e.\u003c/p\u003e\n"]]],["The Actions API offers a RESTful service with resources for managing projects, drafts, previews, release channels, and versions. Key actions include: decrypting/encrypting OAuth secrets, managing web and app activity controls, matching intents to queries, and simulating conversations. Project drafts can be read and updated. Project previews can be updated. Release channels and project versions can be listed, and project versions can be created and read. The service also provides a list of available sample projects.\n"],null,["# Actions API\n\nA RESTful service for the Actions API.\n\n- [REST Resource: v2](#v2)\n- [REST Resource: v2.projects](#v2.projects)\n- [REST Resource: v2.projects.draft](#v2.projects.draft)\n- [REST Resource: v2.projects.preview](#v2.projects.preview)\n- [REST Resource: v2.projects.releaseChannels](#v2.projects.releaseChannels)\n- [REST Resource: v2.projects.versions](#v2.projects.versions)\n- [REST Resource: v2.sampleProjects](#v2.sampleProjects)\n\nService: actions.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://actions.googleapis.com/$discovery/rest?version=v2\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://actions.googleapis.com`\n\nREST Resource: [v2](/assistant/actions/api/reference/rest/v2/TopLevel)\n----------------------------------------------------------------------\n\n| Methods ||\n|--------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\n| [decryptSecret](/assistant/actions/api/reference/rest/v2/TopLevel/decryptSecret) | `POST /v2:decryptSecret` Decrypts the OAuth client secret used in account linking flows. |\n| [encryptSecret](/assistant/actions/api/reference/rest/v2/TopLevel/encryptSecret) | `POST /v2:encryptSecret` Encrypts the OAuth client secret used in account linking flows. |\n| [setWebAndAppActivityControl](/assistant/actions/api/reference/rest/v2/TopLevel/setWebAndAppActivityControl) | `POST /v2:setWebAndAppActivityControl` Sets the Web \\& App Activity control on a service account. |\n\nREST Resource: [v2.projects](/assistant/actions/api/reference/rest/v2/projects)\n-------------------------------------------------------------------------------\n\n| Methods ||\n|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [matchIntents](/assistant/actions/api/reference/rest/v2/projects/matchIntents) | `POST /v2/{project=projects/*}:matchIntents` Finds the intents that match a given query. |\n| [sendInteraction](/assistant/actions/api/reference/rest/v2/projects/sendInteraction) | `POST /v2/{project=projects/*}:sendInteraction` Plays one round of the conversation. |\n\nREST Resource: [v2.projects.draft](/assistant/actions/api/reference/rest/v2/projects.draft)\n-------------------------------------------------------------------------------------------\n\n| Methods ||\n|------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [read](/assistant/actions/api/reference/rest/v2/projects.draft/read) | `POST /v2/{name=projects/*/draft}:read` Reads the entire content of the project draft. |\n| [write](/assistant/actions/api/reference/rest/v2/projects.draft/write) | `POST /v2/{parent=projects/*}/draft:write` Updates the project draft based on the model. |\n\nREST Resource: [v2.projects.preview](/assistant/actions/api/reference/rest/v2/projects.preview)\n-----------------------------------------------------------------------------------------------\n\n| Methods ||\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|\n| [write](/assistant/actions/api/reference/rest/v2/projects.preview/write) | `POST /v2/{parent=projects/*}/preview:write` Updates the user's project preview based on the model. |\n\nREST Resource: [v2.projects.releaseChannels](/assistant/actions/api/reference/rest/v2/projects.releaseChannels)\n---------------------------------------------------------------------------------------------------------------\n\n| Methods ||\n|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------|\n| [list](/assistant/actions/api/reference/rest/v2/projects.releaseChannels/list) | `GET /v2/{parent=projects/*}/releaseChannels` Lists all release channels and corresponding versions, if any. |\n\nREST Resource: [v2.projects.versions](/assistant/actions/api/reference/rest/v2/projects.versions)\n-------------------------------------------------------------------------------------------------\n\n| Methods ||\n|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [create](/assistant/actions/api/reference/rest/v2/projects.versions/create) | `POST /v2/{parent=projects/*}/versions:create` Creates a project version based on the model and triggers deployment to the specified release channel, if specified. |\n| [list](/assistant/actions/api/reference/rest/v2/projects.versions/list) | `GET /v2/{parent=projects/*}/versions` Lists all versions and their current states. |\n| [read](/assistant/actions/api/reference/rest/v2/projects.versions/read) | `POST /v2/{name=projects/*/versions/*}:read` Reads the entire content of a project version. |\n\nREST Resource: [v2.sampleProjects](/assistant/actions/api/reference/rest/v2/sampleProjects)\n-------------------------------------------------------------------------------------------\n\n| Methods ||\n|----------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| [list](/assistant/actions/api/reference/rest/v2/sampleProjects/list) | `GET /v2/sampleProjects` Lists all the sample projects supported by the gactions CLI. |"]]