Method: setWebAndAppActivityControl
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Thiết lập Web & Kiểm soát Hoạt động trong ứng dụng trên tài khoản dịch vụ.
Bạn cần phải bật cài đặt này để sử dụng Hành động cuộc gọi. Ban đầu, chế độ cài đặt này bị tắt đối với các tài khoản dịch vụ và được giữ nguyên cho đến khi được đặt thành một giá trị khác. Điều này có nghĩa là bạn chỉ cần bật tính năng này một lần cho mỗi tài khoản (không nhất thiết phải bật một lần cho mỗi thử nghiệm), trừ phi sau đó tính năng này bị tắt.
Trả về lỗi nếu phương thức gọi không phải là tài khoản dịch vụ. Tài khoản người dùng có thể thay đổi chế độ cài đặt này thông qua trang Kiểm soát hoạt động. Hãy xem https://support.google.com/websearch/answer/54068.
Yêu cầu HTTP
POST https://actions.googleapis.com/v2:setWebAndAppActivityControl
URL sử dụng cú pháp Chuyển mã gRPC.
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"enabled": boolean
} |
Trường |
enabled |
boolean
Nên đặt chế độ cài đặt thành trạng thái bật hay tắt.
|
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ trống.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eEnables or disables Web & App Activity control for service accounts, required for using call Actions.\u003c/p\u003e\n"],["\u003cp\u003eThis setting is persistent and needs to be enabled only once per account unless later disabled.\u003c/p\u003e\n"],["\u003cp\u003eReturns an error if used by non-service accounts; user accounts manage this setting through the Activity Controls page.\u003c/p\u003e\n"],["\u003cp\u003eThe request body uses a simple JSON structure with a boolean field "enabled" to set the desired state.\u003c/p\u003e\n"],["\u003cp\u003eA successful operation results in an empty response body.\u003c/p\u003e\n"]]],[],null,["# Method: setWebAndAppActivityControl\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n\nSets the Web \\& App Activity control on a service account.\n\nIt is necessary to have this setting enabled in order to use call Actions. The setting is originally disabled for service accounts, and it is preserved until set to a different value. This means it only needs to be enabled once per account (and not necessarily once per test), unless it is later disabled.\n\nReturns an error if the caller is not a service account. User accounts can change this setting via the Activity Controls page. See \u003chttps://support.google.com/websearch/answer/54068\u003e.\n\n### HTTP request\n\n`POST https://actions.googleapis.com/v2:setWebAndAppActivityControl`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation ||\n|--------------------------------|---|\n| ``` { \"enabled\": boolean } ``` |\n\n| Fields ||\n|-----------|------------------------------------------------------------------------------|\n| `enabled` | `boolean` Whether the setting should be set to an enabled or disabled state. |\n\n### Response body\n\nIf successful, the response body is empty."]]