Method: photo.startUpload
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Requête HTTP
POST https://streetviewpublish.googleapis.com/v1/photo:startUpload
L'URL utilise la syntaxe de transcodage gRPC.
Corps de la requête
Le corps de la requête doit être vide.
Corps de la réponse
Si la requête aboutit, le corps de la réponse contient une instance de UploadRef
.
Champs d'application des autorisations
Requiert le niveau d'accès OAuth suivant :
https://www.googleapis.com/auth/streetviewpublish
Pour en savoir plus, consultez la présentation d'OAuth 2.0.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eInitiates an upload session to facilitate uploading photo bytes using the returned UploadRef.\u003c/p\u003e\n"],["\u003cp\u003eUploaded photos must meet specific requirements, including Photo Sphere XMP metadata and size specifications.\u003c/p\u003e\n"],["\u003cp\u003eUpon completion, the UploadRef is utilized with photo.create to generate the Photo object entry.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should be empty for the POST request to \u003ccode\u003ehttps://streetviewpublish.googleapis.com/v1/photo:startUpload\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/streetviewpublish\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This describes how to start uploading photo bytes for Street View. It involves creating an upload session using a POST request to `https://streetviewpublish.googleapis.com/v1/photo:startUpload` with an empty request body. The response returns an `UploadRef` URL, which is used to upload the photo bytes. The photo needs Photo Sphere XMP metadata and must meet Google Maps' size requirements, including being a full 360-degree panorama. Finally use the `UploadRef` with `photo.create` to finalize. The process requires OAuth scope `https://www.googleapis.com/auth/streetviewpublish`.\n"],null,["# Method: photo.startUpload\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\nCreates an upload session to start uploading photo bytes. The method uses the upload URL of the returned [UploadRef](/streetview/publish/reference/rest/v1/photo#UploadRef) to upload the bytes for the [Photo](/streetview/publish/reference/rest/v1/photo#Photo).\n\nIn addition to the photo requirements shown in \u003chttps://support.google.com/maps/answer/7012050?ref_topic=6275604\u003e, the photo must meet the following requirements:\n\n- Photo Sphere XMP metadata must be included in the photo metadata. See \u003chttps://developers.google.com/streetview/spherical-metadata\u003e for the required fields.\n- The pixel size of the photo must meet the size requirements listed in \u003chttps://support.google.com/maps/answer/7012050?ref_topic=6275604\u003e, and the photo must be a full 360 horizontally.\n\nAfter the upload completes, the method uses [UploadRef](/streetview/publish/reference/rest/v1/photo#UploadRef) with [photo.create](/streetview/publish/reference/rest/v1/photo/create#google.streetview.publish.v1.StreetViewPublishService.CreatePhoto) to create the [Photo](/streetview/publish/reference/rest/v1/photo#Photo) object entry.\n\n### HTTP request\n\n`POST https://streetviewpublish.googleapis.com/v1/photo:startUpload`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\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 [UploadRef](/streetview/publish/reference/rest/v1/photo#UploadRef).\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)."]]