您目前查看的是 Google Photos Library API 的舊版說明文件。
Method: albums.unshare
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
將先前共享的相簿標示為私人。也就是說,相簿將不再共用,所有非擁有者都無法再存取相簿。所有非擁有者內容都會從相簿中移除。非擁有者之前曾將相簿加入相片庫,但仍保留相片庫中的所有相片。這項動作只能對開發人員透過 API 建立的相簿執行。
HTTP 要求
POST https://photoslibrary.googleapis.com/v1/albums/{albumId}:unshare
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
albumId |
string
必要欄位。要取消分享的相簿 ID。這個相簿 ID 必須屬於開發人員建立的相簿。
|
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/photoslibrary.sharing
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間: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`"]]