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 之一。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):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. |"]]