POST
/api/v4/locations/photos/remove從地點移除相片
依媒體 ID 解除一或多個媒體檔案與地點的關聯。
參數
請求主體
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
| input.locationId | string | 必填 | The location's Base64-encoded Relay ID the photos belong to. |
| input.photoIds | array of strings | 必填 | Media file IDs to detach from the location (as returned by the get-photos or upload endpoints). |
請求範例
可直接貼上的請求主體。請將預留位置 ID 與值換成您自己的。
{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "photoIds": [ "TWVkaWFGaWxlOjU4Nzg5MzI=" ] }}回應
200Photos removed. `removedCount` reports how many media files were detached.
{ "data": { "removeLocationPhotos": { "clientMutationId": null, "removedCount": 1, "errors": null } }}401Unauthenticated, missing or invalid API key.
解除媒體與地點的關聯。使用 photoIds(由 get-photos 或上傳端點傳回的 ID)指定要移除的檔案。回應中的 removedCount 會告訴您實際解除了多少個檔案的關聯,讓您能辨識出已不存在的 ID。
使用案例:撤下過時的店面圖片。 重新裝潢後,列出該地點的相片,挑出過時的額外圖片,並透過 photoIds 傳入這些圖片的 ID,即可在一次呼叫中將它們從各發布平台下架。
使用案例:復原錯誤的批次上傳。 如果自動匯入程序關聯了錯誤的素材,請從上傳回應中收集這些錯誤素材的媒體 ID 並立即移除,再重新上傳正確的檔案。
注意事項。
- 只有
ADDITIONAL類別的相片可透過 API 移除。LOGO和COVER圖片無法在此刪除,請改用上傳端點替換。 - 移除媒體會解除它與地點的關聯,但不一定會從帳戶媒體庫中徹底刪除該檔案。
removedCount為0且伴隨errors: null,表示所提供的 ID 均未與該地點關聯。
Request
curl -X POST 'https://listingsapi.com/api/v4/locations/photos/remove' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "locationId": "TG9jYXRpb246MTgwMDI4OQ==", "photoIds": [ "TWVkaWFGaWxlOjU4Nzg5MzI=" ] } }'