Method: photos.batchUpdate
Stay organized with collections
Save and categorize content based on your preferences.
Updates the metadata of Photos
, such as pose, place association, connections, etc. Changing the pixels of photos is not supported.
Note that if photos.batchUpdate
fails, either critical fields are missing or there is an authentication error. Even if photos.batchUpdate
succeeds, individual photos in the batch may have failures. These failures are specified in each PhotoResponse.status
in BatchUpdatePhotosResponse.results
. See photo.update
for specific failures that can occur per photo.
Only the fields specified in updateMask
field are used. If updateMask
is not present, the update applies to all fields.
The number of UpdatePhotoRequest
messages in a BatchUpdatePhotosRequest
must not exceed 20.
Note: To update Pose.altitude
, Pose.latLngPair
has to be filled as well. Otherwise, the request will fail.
HTTP request
POST https://streetviewpublish.googleapis.com/v1/photos:batchUpdate
The URL uses gRPC Transcoding syntax.
Request body
The request body contains data with the following structure:
JSON representation |
{
"updatePhotoRequests": [
{
"photo": {
object (Photo )
},
"updateMask": string
}
]
} |
Fields |
updatePhotoRequests[] |
object
Required. List of UpdatePhotoRequests .
|
updatePhotoRequests[].photo |
object (Photo )
Required. Photo object containing the new metadata.
|
updatePhotoRequests[].updateMask |
string (FieldMask format)
Required. Mask that identifies fields on the photo metadata to update. If not present, the old Photo metadata is entirely replaced with the new Photo metadata in this request. The update fails if invalid fields are specified. Multiple fields can be specified in a comma-delimited list. The following fields are valid:
pose.heading
pose.lat_lng_pair
pose.pitch
pose.roll
pose.level
pose.altitude
connections
places
Note: When updateMask contains repeated fields, the entire set of repeated values get replaced with the new contents. For example, if updateMask contains connections and UpdatePhotoRequest.photo.connections is empty, all connections are removed.
|
Response body
Response to batch update of metadata of one or more Photos
.
If successful, the response body contains data with the following structure:
JSON representation |
{
"results": [
{
object (PhotoResponse )
}
]
} |
Fields |
results[] |
object (PhotoResponse )
List of results for each individual Photo updated, in the same order as the request.
|
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/streetviewpublish
For more information, see the OAuth 2.0 Overview.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["The API updates metadata of photos, such as pose, connections, and place association, but does not change pixel data."],["Requests are submitted as a batch of up to 20 `UpdatePhotoRequest` messages specifying the photo and fields to update."],["If the `updateMask` is not provided, all fields of the Photo resource will be updated with the values provided in the request."],["When updating `Pose.altitude`, `Pose.latLngPair` must also be specified, or the request will fail."],["This API requires the `https://www.googleapis.com/auth/streetviewpublish` OAuth scope for authorization."]]],["This document details the process of updating photo metadata via the `photos:batchUpdate` method. It outlines that you can update fields like pose, place association, and connections, but not photo pixels. The request involves sending `UpdatePhotoRequests` within a `BatchUpdatePhotosRequest` to `POST https://streetviewpublish.googleapis.com/v1/photos:batchUpdate`. An `updateMask` specifies which fields to modify. The response contains a list of `PhotoResponse` objects, indicating the success or failure of each photo update. A maximum of 20 `UpdatePhotoRequest` messages are allowed.\n"]]