Method: accessproposals.resolve
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
HTTP 请求
POST https://www.googleapis.com/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve
网址采用 gRPC 转码语法。
路径参数
参数 |
fileId |
string
必需。相应请求所针对的商品的 ID。
|
proposalId |
string
必需。要解决的访问权限提案的 ID。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"role": [
string
],
"view": string,
"action": enum (Action ),
"sendNotification": boolean
} |
字段 |
role[] |
string
可选。审批者允许的角色(如果有)。如需了解详情,请参阅角色和权限。 注意:此字段是 ACCEPT 操作的必填字段。
|
view |
string
可选。指明相应访问提案的视图。只有当提案属于视图时,才应设置此字段。仅支持 published 。
|
action |
enum (Action )
必需。针对访问权限提案采取的操作。
|
sendNotification |
boolean
可选。是否在访问提案被拒绝或接受时向请求者发送电子邮件。
|
响应正文
如果成功,则响应正文为空的 JSON 对象。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/docs
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
某些范围受到限制,您的应用需要通过安全评估才能使用这些范围。如需了解详情,请参阅授权指南。
操作
枚举 |
ACTION_UNSPECIFIED |
未指定操作 |
ACCEPT |
用户接受访问权限提案。 注意:如果使用此操作,role 字段必须至少包含一个值。 |
DENY |
用户拒绝了访问提案。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-09-09。
[null,null,["最后更新时间 (UTC):2025-09-09。"],[],[],null,["- [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- [Authorization scopes](#body.aspect)\n- [Action](#Action)\n- [Try it!](#try-it)\n\nApproves or denies an access proposal. For more information, see [Manage pending access proposals](https://developers.google.com/workspace/drive/api/guides/pending-access).\n\nHTTP request\n\n`POST https://www.googleapis.com/drive/v3/files/{fileId}/accessproposals/{proposalId}:resolve`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\nPath parameters\n\n| Parameters ||\n|--------------|--------------------------------------------------------------|\n| `fileId` | `string` Required. The ID of the item the request is on. |\n| `proposalId` | `string` Required. The ID of the access proposal to resolve. |\n\nRequest body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"role\": [ string ], \"view\": string, \"action\": enum (/workspace/drive/api/reference/rest/v3/accessproposals/resolve#Action), \"sendNotification\": boolean } ``` |\n\n| Fields ||\n|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `role[]` | `string` Optional. The roles that the approver has allowed, if any. For more information, see [Roles and permissions](https://developers.google.com/workspace/drive/api/guides/ref-roles). Note: This field is required for the `ACCEPT` action. |\n| `view` | `string` Optional. Indicates the view for this access proposal. This should only be set when the proposal belongs to a view. Only `published` is supported. |\n| `action` | `enum (`[Action](/workspace/drive/api/reference/rest/v3/accessproposals/resolve#Action)`)` Required. The action to take on the access proposal. |\n| `sendNotification` | `boolean` Optional. Whether to send an email to the requester when the access proposal is denied or accepted. |\n\nResponse body\n\nIf successful, the response body is an empty JSON object.\n\nAuthorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/docs`\n- `\n https://www.googleapis.com/auth/drive`\n- `\n https://www.googleapis.com/auth/drive.file`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent).\n\nAction The state change of the access proposal.\n\n| Enums ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------|\n| `ACTION_UNSPECIFIED` | Unspecified action |\n| `ACCEPT` | The user accepts the access proposal. Note: If this action is used, the `role` field must have at least one value. |\n| `DENY` | The user denies the access proposal. |"]]