2025 年 4 月 1 日,我们移除了 Library API 中的部分镜重。
点击此处了解详情。
Method: mediaItems.get
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThis method retrieves a specific media item using its unique identifier (\u003ccode\u003emediaItemId\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe request must be authorized using one of the specified OAuth scopes, granting access to the user's photo library.\u003c/p\u003e\n"],["\u003cp\u003eFunctionality will be limited to media items created by your app starting March 31, 2025, as some authorization scopes are being changed (see Photos APIs updates for details).\u003c/p\u003e\n"],["\u003cp\u003eThe response provides a detailed representation of the requested media item, including its properties and metadata.\u003c/p\u003e\n"],["\u003cp\u003eNo request body is required; simply provide the \u003ccode\u003emediaItemId\u003c/code\u003e as a path parameter in the GET request URL.\u003c/p\u003e\n"]]],["The core content describes how to retrieve a media item using its identifier. A `GET` request is sent to `https://photoslibrary.googleapis.com/v1/mediaItems/{mediaItemId}`, with `mediaItemId` as a required path parameter. The request body must be empty. A successful response returns a `MediaItem`. Access requires one of three specified OAuth scopes. Functionality will change on March 31, 2025, limiting interaction to media items created by the app.\n"],null,["# Method: mediaItems.get\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\nReturns the app created media item for the specified media item identifier.\n\n### HTTP request\n\n`GET https://photoslibrary.googleapis.com/v1/mediaItems/{mediaItemId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|------------------------------------------------------------------|\n| `mediaItemId` | `string` Required. Identifier of the media item to be requested. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [MediaItem](/photos/library/reference/rest/v1/mediaItems#MediaItem).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `\n https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata`"]]