คุณกำลังดูเอกสารประกอบเดิมสำหรับ Google Photos Library API
REST Resource: sharedAlbums
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทรัพยากร: อัลบั้ม
การนําเสนออัลบั้มใน Google Photos อัลบั้มเป็นคอนเทนเนอร์สำหรับรายการสื่อ หากแอปพลิเคชันแชร์อัลบั้ม อัลบั้มจะมีพร็อพเพอร์ตี้ shareInfo
เพิ่มเติม
การแสดง JSON |
{
"id": string,
"title": string,
"productUrl": string,
"isWriteable": boolean,
"shareInfo": {
object (ShareInfo )
},
"mediaItemsCount": string,
"coverPhotoBaseUrl": string,
"coverPhotoMediaItemId": string
} |
ช่อง |
id |
string
ตัวระบุสำหรับอัลบัม ซึ่งเป็นตัวระบุถาวรที่ใช้ระหว่างเซสชันเพื่อระบุอัลบั้มนี้ได้
|
title |
string
ชื่ออัลบั้มที่แสดงต่อผู้ใช้ในบัญชี Google Photos สตริงนี้ต้องมีความยาวไม่เกิน 500 อักขระ
|
productUrl |
string
[เอาต์พุตเท่านั้น] URL ของ Google Photos สำหรับอัลบั้ม ผู้ใช้ต้องลงชื่อเข้าใช้บัญชี Google Photos เพื่อเข้าถึงลิงก์นี้
|
isWriteable |
boolean
[เอาต์พุตเท่านั้น] เป็นจริงหากคุณสร้างรายการสื่อในอัลบั้มนี้ได้ ช่องนี้จะอิงตามขอบเขตที่ให้สิทธิ์และสิทธิ์ของอัลบั้ม หากมีการเปลี่ยนแปลงขอบเขตหรือสิทธิ์ของอัลบั้ม ระบบจะอัปเดตช่องนี้
|
shareInfo |
object (ShareInfo )
[เอาต์พุตเท่านั้น] ข้อมูลที่เกี่ยวข้องกับอัลบั้มที่แชร์ ช่องนี้จะป้อนข้อมูลก็ต่อเมื่ออัลบั้มนี้เป็นอัลบั้มที่แชร์ นักพัฒนาซอฟต์แวร์เป็นผู้สร้างอัลบั้ม และผู้ใช้ได้อนุญาตขอบเขต photoslibrary.sharing แล้ว
|
mediaItemsCount |
string (int64 format)
[เอาต์พุตเท่านั้น] จำนวนรายการสื่อในอัลบั้ม
|
coverPhotoBaseUrl |
string
[เอาต์พุตเท่านั้น] URL ไปยังไบต์ของรูปภาพหน้าปก ไม่ควรใช้ URL นี้ตามที่เป็น ควรเพิ่มพารามิเตอร์ต่อท้าย URL นี้ก่อนใช้งาน ดูรายการพารามิเตอร์ที่รองรับทั้งหมดได้ในเอกสารประกอบสำหรับนักพัฒนาซอฟต์แวร์ เช่น '=w2048-h1024' กำหนดขนาดของรูปภาพหน้าปกให้มีความกว้าง 2048 พิกเซลและความสูง 1024 พิกเซล
|
coverPhotoMediaItemId |
string
ตัวระบุรายการสื่อที่เชื่อมโยงกับรูปภาพปก
|
เมธอด |
|
แสดงผลอัลบั้มตาม shareToken ที่ระบุ |
|
เข้าร่วมอัลบั้มที่แชร์ในนามของผู้ใช้ Google Photos |
|
ออกจากอัลบั้มที่แชร์ซึ่งเข้าร่วมไว้ก่อนหน้านี้ในนามของผู้ใช้ Google Photos |
|
แสดงรายการอัลบั้มที่แชร์ทั้งหมดที่มีอยู่ในแท็บการแชร์ของแอป Google Photos ของผู้ใช้ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eAlbums in Google Photos are containers for media items and can be shared.\u003c/p\u003e\n"],["\u003cp\u003eShared albums have a \u003ccode\u003eshareInfo\u003c/code\u003e property and developers can access them with the \u003ccode\u003ephotoslibrary.sharing\u003c/code\u003e scope.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAlbum\u003c/code\u003e resource provides methods to get, join, leave, and list shared albums.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAlbum\u003c/code\u003e properties provide information such as ID, title, URL, writability status, media count, and cover photo details.\u003c/p\u003e\n"]]],["Albums in Google Photos are containers for media items, identified by a unique `id` and a user-facing `title`. Key details include the album's `productUrl`, whether it's `isWriteable`, `mediaItemsCount`, and cover photo information (`coverPhotoBaseUrl`, `coverPhotoMediaItemId`). Shared albums contain a `shareInfo` property. Actions include: retrieving albums with a `shareToken`, joining, leaving, and listing shared albums via methods such as `get`, `join`, `leave`, and `list`.\n"],null,["# REST Resource: sharedAlbums\n\n- [Resource: Album](#Album)\n - [JSON representation](#Album.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: Album\n---------------\n\nRepresentation of an album in Google Photos. Albums are containers for media items. If an album has been shared by the application, it contains an extra `shareInfo` property.\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"title\": string, \"productUrl\": string, \"isWriteable\": boolean, \"shareInfo\": { object (/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo) }, \"mediaItemsCount\": string, \"coverPhotoBaseUrl\": string, \"coverPhotoMediaItemId\": string } ``` |\n\n| Fields ||\n|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` Identifier for the album. This is a persistent identifier that can be used between sessions to identify this album. |\n| `title` | `string` Name of the album displayed to the user in their Google Photos account. This string shouldn't be more than 500 characters. |\n| `productUrl` | `string` \\[Output only\\] Google Photos URL for the album. The user needs to be signed in to their Google Photos account to access this link. |\n| `isWriteable` | `boolean` \\[Output only\\] True if you can create media items in this album. This field is based on the scopes granted and permissions of the album. If the scopes are changed or permissions of the album are changed, this field is updated. |\n| `shareInfo` | `object (`[ShareInfo](/photos/library/legacy/reference/rest/v1/albums#Album.ShareInfo)`)` \\[Output only\\] Information related to shared albums. This field is only populated if the album is a shared album, the developer created the album and the user has granted the `photoslibrary.sharing` scope. |\n| `mediaItemsCount` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` \\[Output only\\] The number of media items in the album. |\n| `coverPhotoBaseUrl` | `string` \\[Output only\\] A URL to the cover photo's bytes. This shouldn't be used as is. Parameters should be appended to this URL before use. See the [developer documentation](https://developers.google.com/photos/library/guides/access-media-items#base-urls) for a complete list of supported parameters. For example, `'=w2048-h1024'` sets the dimensions of the cover photo to have a width of 2048 px and height of 1024 px. |\n| `coverPhotoMediaItemId` | `string` Identifier for the media item associated with the cover photo. |\n\n| Methods ------- ||\n|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------|\n| ### [get](/photos/library/legacy/reference/rest/v1/sharedAlbums/get) | Returns the album based on the specified `shareToken`. |\n| ### [join](/photos/library/legacy/reference/rest/v1/sharedAlbums/join) | Joins a shared album on behalf of the Google Photos user. |\n| ### [leave](/photos/library/legacy/reference/rest/v1/sharedAlbums/leave) | Leaves a previously-joined shared album on behalf of the Google Photos user. |\n| ### [list](/photos/library/legacy/reference/rest/v1/sharedAlbums/list) | Lists all shared albums available in the Sharing tab of the user's Google Photos app. |"]]