Method: query.removeActivity
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
POST https://cloudsearch.googleapis.com/v1/query:removeActivity
這個網址使用 gRPC 轉碼語法。
要求主體
要求主體的資料會採用以下結構:
欄位 |
userActivity |
object (UserActivity )
包含要刪除資料的使用者活動。
|
requestOptions |
object (RequestOptions )
要求選項,例如搜尋應用程式和 clientId。
|
授權範圍
需要下列其中一種 OAuth 範圍:
https://www.googleapis.com/auth/cloud_search.query
https://www.googleapis.com/auth/cloud_search
詳情請參閱授權指南。
UserActivity
使用者的單一或大量查詢活動。這可以是記錄查詢或刪除查詢。
JSON 表示法 |
{
// Union field activity can be only one of the following:
"queryActivity": {
object (QueryActivity )
}
// End of list of possible types for union field activity .
} |
欄位 |
聯集欄位 activity 。 activity 只能是下列其中一項:
|
queryActivity |
object (QueryActivity )
包含需要記錄/移除的資料。
|
QueryActivity
JSON 表示法 |
{
"query": string
} |
欄位 |
query |
string
要記錄/移除的使用者輸入查詢。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Method: query.removeActivity\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- [Authorization scopes](#body.aspect)\n- [UserActivity](#UserActivity)\n - [JSON representation](#UserActivity.SCHEMA_REPRESENTATION)\n- [QueryActivity](#QueryActivity)\n - [JSON representation](#QueryActivity.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nProvides functionality to remove logged activity for a user.\n\n**Note:** This API requires a standard end user account to execute. A service account can't perform Remove Activity requests directly; to use a service account to perform queries, set up [Google Workspace domain-wide delegation of authority](https://developers.google.com/workspace/cloud-search/docs/guides/delegation/).\n\n### HTTP request\n\n`POST https://cloudsearch.googleapis.com/v1/query:removeActivity`\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| ``` { \"userActivity\": { object (/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity) }, \"requestOptions\": { object (/workspace/cloud-search/docs/reference/rest/v1/RequestOptions) } } ``` |\n\n| Fields ||\n|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `userActivity` | `object (`[UserActivity](/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#UserActivity)`)` User Activity containing the data to be deleted. |\n| `requestOptions` | `object (`[RequestOptions](/workspace/cloud-search/docs/reference/rest/v1/RequestOptions)`)` Request options, such as the search application and clientId. |\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud_search.query`\n- `https://www.googleapis.com/auth/cloud_search`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nUserActivity\n------------\n\nUser's single or bulk query activity. This can be a logging query or deletion query.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { // Union field `activity` can be only one of the following: \"queryActivity\": { object (/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity) } // End of list of possible types for union field `activity`. } ``` |\n\n| Fields ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Union field `activity`. `activity` can be only one of the following: ||\n| `queryActivity` | `object (`[QueryActivity](/workspace/cloud-search/docs/reference/rest/v1/query/removeActivity#QueryActivity)`)` Contains data which needs to be logged/removed. |\n\nQueryActivity\n-------------\n\nDetails about a user's query activity.\n\n| JSON representation |\n|-----------------------------|\n| ``` { \"query\": string } ``` |\n\n| Fields ||\n|---------|-------------------------------------------------|\n| `query` | `string` User input query to be logged/removed. |"]]