POST/api/v4/locations/photos/remove

從地點移除相片

依媒體 ID 解除一或多個媒體檔案與地點的關聯。

需要 API 金鑰。標頭格式與金鑰輪替請參閱驗證。

參數

請求主體

名稱類型必填說明
input.locationIdstring必填The location's Base64-encoded Relay ID the photos belong to.
input.photoIdsarray of strings必填Media file IDs to detach from the location (as returned by the get-photos or upload endpoints).

請求範例

可直接貼上的請求主體。請將預留位置 ID 與值換成您自己的。

Request body
{  "input": {    "locationId": "TG9jYXRpb246MTgwMDI4OQ==",    "photoIds": [      "TWVkaWFGaWxlOjU4Nzg5MzI="    ]  }}

回應

200Photos removed. `removedCount` reports how many media files were detached.
Response
{  "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="      ]    }  }'