Method: notes.permissions.batchCreate
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
為記事建立一或多項權限。您只能建立具有 WRITER
角色的權限。如果新增任何權限失敗,整個要求都會失敗,且不會進行任何變更。
HTTP 要求
POST https://keep.googleapis.com/v1/{parent=notes/*}/permissions:batchCreate
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
parent |
string
所有權限共用的父項資源。格式:notes/{note} 如果設定了這個值,CreatePermission 訊息中的父項欄位必須為空白,或與這個欄位相符。
|
要求主體
要求主體的資料會採用以下結構:
欄位 |
requests[] |
object (CreatePermissionRequest )
指定要建立的資源要求訊息。
|
回應主體
建立筆記權限的回應。
如果成功,回應主體會含有以下結構的資料:
JSON 表示法 |
{
"permissions": [
{
object (Permission )
}
]
} |
欄位 |
permissions[] |
object (Permission )
已建立權限。
|
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/keep
詳情請參閱授權指南。
CreatePermissionRequest
JSON 表示法 |
{
"parent": string,
"permission": {
object (Permission )
}
} |
欄位 |
parent |
string
必要欄位。表示將建立此權限的父項附註。格式:notes/{note}
|
permission |
object (Permission )
必要欄位。建立權限。必須提供 Permission.email、User.email 或 Group.email 其中一個。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[],[],null,["# Method: notes.permissions.batchCreate\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchCreatePermissionsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [CreatePermissionRequest](#CreatePermissionRequest)\n - [JSON representation](#CreatePermissionRequest.SCHEMA_REPRESENTATION)\n\nCreates one or more permissions on the note. Only permissions with the `WRITER` role may be created. If adding any permission fails, then the entire request fails and no changes are made.\n\n### HTTP request\n\n`POST https://keep.googleapis.com/v1/{parent=notes/*}/permissions:batchCreate`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` The parent resource shared by all Permissions being created. Format: `notes/{note}` If this is set, the parent field in the CreatePermission messages must either be empty or match this field. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requests\": [ { object (/workspace/keep/api/reference/rest/v1/notes.permissions/batchCreate#CreatePermissionRequest) } ] } ``` |\n\n| Fields ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requests[]` | `object (`[CreatePermissionRequest](/workspace/keep/api/reference/rest/v1/notes.permissions/batchCreate#CreatePermissionRequest)`)` The request message specifying the resources to create. |\n\n### Response body\n\nThe response for creating permissions on a note.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------|\n| ``` { \"permissions\": [ { object (/workspace/keep/api/reference/rest/v1/notes#Permission) } ] } ``` |\n\n| Fields ||\n|-----------------|--------------------------------------------------------------------------------------------------------|\n| `permissions[]` | `object (`[Permission](/workspace/keep/api/reference/rest/v1/notes#Permission)`)` Permissions created. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/keep`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nCreatePermissionRequest\n-----------------------\n\nThe request to add a single permission on the note.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------|\n| ``` { \"parent\": string, \"permission\": { object (/workspace/keep/api/reference/rest/v1/notes#Permission) } } ``` |\n\n| Fields ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent note where this permission will be created. Format: `notes/{note}` |\n| `permission` | `object (`[Permission](/workspace/keep/api/reference/rest/v1/notes#Permission)`)` Required. The permission to create. One of Permission.email, User.email or Group.email must be supplied. |"]]