Method: photo.create
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پس از اینکه مشتری آپلود عکس را با UploadRef
برگشتی تمام کرد، photo.create
Photo
آپلود شده را در نمای خیابان در Google Maps منتشر می کند.
در حال حاضر، تنها راه برای تنظیم عنوان، زیر و بم، و رول در photo.create از طریق فراداده Photo Sphere XMP در بایت های عکس است. photo.create فیلدهای pose.heading
، pose.pitch
، pose.roll
، pose.altitude
و pose.level
را در Pose نادیده می گیرد.
این روش کدهای خطای زیر را برمی گرداند:
درخواست HTTP
POST https://streetviewpublish.googleapis.com/v1/photo
URL از دستور GRPC Transcoding استفاده می کند.
درخواست بدن
بدنه درخواست حاوی نمونه ای از Photo
است.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی یک نمونه جدید از Photo
است.
محدوده مجوز
به محدوده OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/streetviewpublish
برای اطلاعات بیشتر، به نمای کلی OAuth 2.0 مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003ephoto.create\u003c/code\u003e publishes a 360 photo to Street View on Google Maps after it's been uploaded using an UploadRef.\u003c/p\u003e\n"],["\u003cp\u003eCurrently, heading, pitch, and roll can only be set through Photo Sphere XMP metadata within the photo itself.\u003c/p\u003e\n"],["\u003cp\u003eThis method may return errors if the request is malformed, photo isn't 360, upload reference is invalid, or storage limit is reached.\u003c/p\u003e\n"],["\u003cp\u003eRequires \u003ccode\u003ehttps://www.googleapis.com/auth/streetviewpublish\u003c/code\u003e OAuth scope for authorization.\u003c/p\u003e\n"],["\u003cp\u003eUses a POST request to \u003ccode\u003ehttps://streetviewpublish.googleapis.com/v1/photo\u003c/code\u003e with the Photo details in the request body.\u003c/p\u003e\n"]]],["Clients upload a photo using `UploadRef`, then use `photo.create` to publish the `Photo` to Google Maps. Heading, pitch, and roll must be set in the Photo Sphere XMP metadata. The request URL is `POST https://streetviewpublish.googleapis.com/v1/photo`. The request body includes a `Photo` instance, and a successful response returns a created `Photo` instance. It requires the `streetviewpublish` OAuth scope and can return `INVALID_ARGUMENT`, `NOT_FOUND`, or `RESOURCE_EXHAUSTED` error codes.\n"],null,["# Method: photo.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nAfter the client finishes uploading the photo with the returned [UploadRef](/streetview/publish/reference/rest/v1/photo#UploadRef), [photo.create](/streetview/publish/reference/rest/v1/photo/create#google.streetview.publish.v1.StreetViewPublishService.CreatePhoto) publishes the uploaded [Photo](/streetview/publish/reference/rest/v1/photo#Photo) to Street View on Google Maps.\n\nCurrently, the only way to set heading, pitch, and roll in photo.create is through the [Photo Sphere XMP metadata](https://developers.google.com/streetview/spherical-metadata) in the photo bytes. photo.create ignores the `pose.heading`, `pose.pitch`, `pose.roll`, `pose.altitude`, and `pose.level` fields in Pose.\n\nThis method returns the following error codes:\n\n- [google.rpc.Code.INVALID_ARGUMENT](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT) if the request is malformed or if the uploaded photo is not a 360 photo.\n- [google.rpc.Code.NOT_FOUND](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.NOT_FOUND) if the upload reference does not exist.\n- [google.rpc.Code.RESOURCE_EXHAUSTED](/streetview/publish/reference/rest/v1/Code#ENUM_VALUES.RESOURCE_EXHAUSTED) if the account has reached the storage limit.\n\n### HTTP request\n\n`POST https://streetviewpublish.googleapis.com/v1/photo`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Request body\n\nThe request body contains an instance of [Photo](/streetview/publish/reference/rest/v1/photo#Photo).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Photo](/streetview/publish/reference/rest/v1/photo#Photo).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/streetviewpublish`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]