Method: mediaItems.list
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[[["\u003cp\u003eRetrieves a list of media items selected by a user during a specific Photos Picker session.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the session ID as a query parameter in the GET request.\u003c/p\u003e\n"],["\u003cp\u003eSupports pagination to retrieve large lists of media items.\u003c/p\u003e\n"],["\u003cp\u003eReturns an error if the user has not finished picking media items, prompting the application to poll until the session is ready.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/photospicker.mediaitems.readonly\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This describes retrieving a list of media items selected by a user within a specific session. A `GET` request to `https://photospicker.googleapis.com/v1/mediaItems` is used, with the `sessionId` as a required query parameter. Optional parameters include `pageSize` (max 100) and `pageToken` for pagination. The request body must be empty. A successful response includes an array of `mediaItems` and optionally a `nextPageToken`. If the session is incomplete, a `FAILED_PRECONDITION` error is returned, requiring polling. The authorization scope `https://www.googleapis.com/auth/photospicker.mediaitems.readonly` is needed.\n"],null,["# Method: mediaItems.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListMediaItemsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n\nReturns a list of media items picked by the user during the specified session.\n\nA `FAILED_PRECONDITION` error is returned if the user has not yet finished picking media items for the specified session. In this scenario, your application should poll `sessions.get` until the session is ready before retrying this method.\n\n### HTTP request\n\n`GET https://photospicker.googleapis.com/v1/mediaItems`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `sessionId` | `string` Required. The Google-generated identifier for this session. |\n| `pageSize` | `integer` Optional. The maximum number of media items to return. The service may return fewer than this value (including zero results). If unspecified or set to 0, at most 50 media items is returned. The maximum value is 100; values above 100 will be coerced to 100. Negative values will result in an `INVALID_ARGUMENT` error. |\n| `pageToken` | `string` Optional. A page token, received from a previous `mediaItems.list` call. Provide this to retrieve the subsequent page. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nResponse to the `mediaItems.list` method.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"mediaItems\": [ { object (/photos/picker/reference/rest/v1/mediaItems#PickedMediaItem) } ], \"nextPageToken\": string } ``` |\n\n| Fields ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mediaItems[]` | `object (`[PickedMediaItem](/photos/picker/reference/rest/v1/mediaItems#PickedMediaItem)`)` A page of picked media items. |\n| `nextPageToken` | `string` If set, this field can be used as the `pageToken` in a subsequent `mediaItems.list` call to retrieve the next page of picked media items. If this field is omitted, there are no subsequent pages. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/photospicker.mediaitems.readonly`"]]