Method: photo.create
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Setelah klien selesai mengupload foto dengan UploadRef
yang ditampilkan, photo.create
memublikasikan Photo
yang diupload ke Street View di Google Maps.
Saat ini, satu-satunya cara untuk menyetel judul, tinggi nada, dan lemparan di photo.create adalah melalui metadata Photo Sphere XMP dalam byte foto. photo.create mengabaikan kolom pose.heading
, pose.pitch
, pose.roll
, pose.altitude
, dan pose.level
di Pose.
Metode ini menampilkan kode error berikut:
Permintaan HTTP
POST https://streetviewpublish.googleapis.com/v1/photo
URL menggunakan sintaksis gRPC Transcoding.
Isi permintaan
Isi permintaan memuat instance Photo
.
Isi respons
Jika berhasil, isi respons memuat instance Photo
yang baru dibuat.
Cakupan otorisasi
Memerlukan cakupan OAuth berikut:
https://www.googleapis.com/auth/streetviewpublish
Untuk informasi selengkapnya, lihat Ringkasan OAuth 2.0.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-25 UTC.
[null,null,["Terakhir diperbarui pada 2025-07-25 UTC."],[[["\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)."]]