home > support > API > Method list > Delete tour image
Remove an image (and related description) from a Tour.
A tour must have at least one image to be distributed via TourCMS API / Marketplace, deleting all images for a tour will cause it to be delisted and may affect bookings.
Want to replace the image instead? See the Tour file upload endpoint.
Endpoint | /c/tour/images/delete |
Formats | XML |
Example | /c/tour/images/delete.xml |
Verb | POST POST data:
|
PHP examples use the PHP Client Library with the return type set to SimpleXML
object delete_tour_image(int $channel, SimpleXMLElement $image_info)
// The channel ID this tour belongs to.
$channel = 3930;
// Start building the XML
$image_info = new SimpleXMLElement('<file />');
// Define the ID of the Tour we wish to delete
$image_info->addChild('tour_id', '1');
// And the Image ID (1-10, can be found in Show Tour)
$image_info->addChild('image_id', '10');
// Call TourCMS API, deleting the image
$result = $tourcms->delete_tour_image($channel, $image_info);
if ($result->error == "OK") {
print "Image deleted";
} else {
print $result->error;
}
Image deleted
Looking for sample code in a different language? TourCMS and community provided API libraries
Enter your TourCMS API credentials below to call the Delete Tour Image endpoint.
Take care, submitting this form will modify live data!
There are no querystring parameters.
XML Node | Notes | ||||||
---|---|---|---|---|---|---|---|
file |
The root XML element, can contain any of the following child nodes.
|
XML Node | Notes | ||||
---|---|---|---|---|---|
request | Confirmation of the request that you sent | ||||
error | Any error message returned, if there is no error this will just contain the text OK. If the image has already been deleted then the error will be IMAGE_NOT_FOUND. |
||||
warnings |
If any warnings are returned there will be a warnings node containing:.
|