Method: photos.batchUpdate
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HTTP 要求
POST https://streetviewpublish.googleapis.com/v1/photos:batchUpdate
這個網址使用 gRPC 轉碼語法。
要求主體
要求主體的資料會採用以下結構:
JSON 表示法 |
{
"updatePhotoRequests": [
{
"photo": {
object (Photo )
},
"updateMask": string
}
]
} |
欄位 |
updatePhotoRequests[] |
object
必要欄位。UpdatePhotoRequests 清單。
|
updatePhotoRequests[].photo |
object (Photo )
必要欄位。包含新中繼資料的 Photo 物件。
|
updatePhotoRequests[].updateMask |
string (FieldMask format)
必要欄位。這個遮罩可識別要更新的相片中繼資料欄位。如果沒有,則這項要求中的舊 Photo 中繼資料會完全取代為新的 Photo 中繼資料。如果指定無效欄位,更新作業就會失敗。可以使用逗號分隔清單指定多個欄位。 以下是有效的欄位:
pose.heading
pose.lat_lng_pair
pose.pitch
pose.roll
pose.level
pose.altitude
connections
places
注意:如果 updateMask 包含重複欄位,整組重複值會替換為新內容。舉例來說,如果 updateMask 包含 connections ,且 UpdatePhotoRequest.photo.connections 為空白,則系統會移除所有連線。
|
回應主體
回應一或多個 Photos
的中繼資料批次更新。
如果成功,回應主體會含有以下結構的資料:
欄位 |
results[] |
object (PhotoResponse )
每個 Photo 的結果清單都會按照要求的順序更新。
|
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/streetviewpublish
詳情請參閱 OAuth 2.0 總覽。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-10 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2024-09-10 (世界標準時間)。"],[[["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"]]