TourCMS, a leading online booking and channel management solution is operated by Palisis.

Contact Info

Palisis AG
Florastrasse 18A
8610 Uster
support@palisis.com
+41 44 533 40 40

Follow Us

home > support > API > Method list > Delete tour image

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.

REST info

Endpoint/c/tour/images/delete
FormatsXML
Example/c/tour/images/delete.xml
VerbPOST
 
POST data:
<?xml version="1.0"?>
<file>
	<tour_id>1</tour_id>
	<image_id>10</image_id>
</file>

Code samples

PHP examples use the PHP Client Library with the return type set to SimpleXML


Description

object delete_tour_image(int $channel, SimpleXMLElement $image_info)


Parameters

$channel
Integer ID number for the channel this tour belongs to.
$image_info
SimpleXML object with info for the tour and the image ID you want to delete


Example


// 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

Querystring parameters

There are no querystring parameters.

Post fields

Post fields
XML NodeNotes
file

The root XML element, can contain any of the following child nodes.

XML NodeNotes
tour_idThe Tour ID the image belongs to. Mandatory.
image_idThe ID of the image (1-10). Can be obtained from Show Tour. Mandatory.

Response fields

Response fields
XML NodeNotes
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:.

XML NodeNotes
warningA warning node for each warning, containing a textual description.
For example Tour has no more images.

More information