How to Manage Images in a Listing
Section titled “How to Manage Images in a Listing”This guide outlines the process of adding, deleting, and reordering images in an existing listing and publishing those changes to the web.
Prerequisites
You will need your Listing UUID to begin, and the Publication UUID if the listing is already published.
Adding an Image
Section titled “Adding an Image”1. Request a Media Ticket
Section titled “1. Request a Media Ticket”Send a POST request to the /media endpoint. The API will respond with:
- A unique Ticket UUID (Note: This has an expiration date).
- A Presigned URL for image upload.
2. Upload the Image
Section titled “2. Upload the Image”Use the Presigned URL to upload your image directly to the designated storage. This is a direct transfer from your system; the API is not involved in this file transfer.
3. Add Media to the Listing
Section titled “3. Add Media to the Listing”Send a PUT request to /listing/{listing_uuid}/media. Include the Ticket UUID in the payload. Note: A Ticket UUID can only be used once successfully.
Deleting Images
Section titled “Deleting Images”To delete one or multiple images:
- Identify the image URLs you wish to delete from the listing’s array of URLs.
- Send a
DELETErequest to/listing/{listing_uuid}/media. - Include the
urlsquery parameter with a comma-separated list of the URLs.
Example: DELETE .../media?urls=url_path_1,url_path_2. Successful requests return 204 No Content.
Reordering Images
Section titled “Reordering Images”To change the display order of your images:
- Retrieve the image URLs from the listing.
- Send a
PUTrequest to/listing/{listing_uuid}/media/order. - Add the list of URLs in the request payload in your desired order.
Important Notes
- The first URL in the list will be the cover image of your ad.
- You cannot add or remove URLs during this request; it must contain the same set of existing URLs.
🚀 Publish Changes
Section titled “🚀 Publish Changes”To make image changes visible on the web, you must republish the listing:
- Send a
PUTrequest to/listing/{listing_uuid}/publication/{publication_uuid}. - Add the query parameter
requestedStateset toPUBLISHEDorPAUSED. - Provide an empty JSON body
{}. - The API will return 204 No Content and initiate the asynchronous republish process.