您正在查看 Google Photos Library API 的旧版文档。
Method: albums.unshare
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将先前的共享影集标记为不公开。这意味着该影集将不再共享,所有非所有者用户都将失去对该影集的访问权限。所有非所有者的内容都将从影集中移除。如果非所有者之前已将该影集添加到其媒体库,则其媒体库中的所有照片仍会保留。您只能对开发者通过 API 创建的影集执行此操作。
HTTP 请求
POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:unshare
网址采用 gRPC 转码语法。
路径参数
参数 |
albumId |
string
必需。要停止分享的影集的标识符。此影集 ID 必须属于由开发者创建的影集。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/photoslibrary.sharing
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eUnshares a previously shared album, making it private and removing non-owner access.\u003c/p\u003e\n"],["\u003cp\u003eNon-owners who added the album to their library will retain their photos, but lose access to the shared album.\u003c/p\u003e\n"],["\u003cp\u003eOnly albums created by the developer via the API can be unshared using this method.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should be empty, and a successful response will also be empty.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/photoslibrary.sharing\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["The content details how to unshare a previously shared album via API. It uses a `POST` request to the provided URL, including the `albumId` as a path parameter. The request body must be empty. Upon successful execution, the response body will also be empty. This action removes non-owners' access and content from the album. Only albums created through the API can be unshared. It also requires the `https://www.googleapis.com/auth/photoslibrary.sharing` OAuth scope.\n"],null,["# Method: albums.unshare\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nMarks a previously shared album as private. This means that the album is no longer shared and all the non-owners will lose access to the album. All non-owner content will be removed from the album. If a non-owner has previously added the album to their library, they will retain all photos in their library. This action can only be performed on albums which were created by the developer via the API.\n\n### HTTP request\n\n`POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:unshare`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------|----------------------------------------------------------------------------------------------------------------------------|\n| `albumId` | `string` Required. Identifier of the album to be unshared. This album id must belong to an album created by the developer. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body is empty.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/photoslibrary.sharing`"]]