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 > Marketplace API > list tour images

List Tour Images

List of tours including their image URLs. Like List Tours, except use this one if you want all the URLs for all tour images. Handy if you are serving images from your own hosting and wish to quickly know what images you need to synchronise.

REST info

Endpoint/c/tours/images/list
/p/tours/images/list
FormatsXML
Example/c/tours/images/list.xml
VerbGET

Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object list_tour_images ( [ int $channel = 0 [, string $queryString = ""] ] ) 


Parameters

$channel
ID for a Channel (supplier) to list images from
queryString
Search query string, see possible values in the table below

Example

// Set the Channel ID
// For Suppliers this can be found in the API settings page
// For Partners this can be a specific Channel or 0 to list from all
$channel = 5;

// Query the TourCMS API, passing in our channel id
$result = $tourcms->list_tour_images($channel);

// Loop through each tour
foreach($result as $tour) {

	// Print out the tour id
	print '<strong>Tour id '.$tour->tour_id.':</strong> ';

	// Loop through each image and print out the url
	foreach($tour->images->image as $image) {
		print $image->url.', ';
	}

	print '<br />';
}
Tour id 161: https://cdn.tourcms.com/a/5/161/1.jpg,
https://cdn.tourcms.com/a/5/161/2.jpg,
https://cdn.tourcms.com/a/5/161/3.jpg,
Tour id 172: https://cdn.tourcms.com/a/5/172/1.jpg,
https://cdn.tourcms.com/a/5/172/2.jpg,
https://cdn.tourcms.com/a/5/172/3.jpg,
https://cdn.tourcms.com/a/5/172/4.jpg

C# examples use the .Net Client Library

Overload list

XmlDocument ListTourImages ()
XmlDocument ListTourImages (int channelId)
XmlDocument ListTourImages (string queryString)
XmlDocument ListTourImages (string queryString, int channelId)


Parameters

queryString
Search querystring, see possible values in the table below
channelId
Channel to list Tours from, 0/blank for all connected channels

Example

// Set the Channel ID
// For Operators this can be found in the API settings page
// For Agents this can be a specific Channel or 0 to list tours from all
int channelId = 0;

// Build Search querystring (see table below)
string queryString = "";

// Call the API
XmlDocument doc = myTourCMS.ListTourImages(queryString, channelId);

// Display Tour Image list
XmlNodeList tourList = doc.GetElementsByTagName("tour");
foreach (XmlNode tour in tourList)
{
	string tourId = tour.SelectSingleNode("tour_id").InnerText;
    Console.WriteLine("Tour id " + tourId);

    XmlNodeList imageList = tour.GetElementsByTagName("image");

    foreach(XmlNode image in imageList) {
    	string imageUrl = image.SelectSingleNode("url").InnerText;
    	Console.WriteLine(imageUrl);
    }

}
Tour id 161
https://cdn.tourcms.com/a/5/161/1.jpg
https://cdn.tourcms.com/a/5/161/2.jpg
https://cdn.tourcms.com/a/5/161/3.jpg
Tour id 172
https://cdn.tourcms.com/a/5/172/1.jpg
https://cdn.tourcms.com/a/5/172/2.jpg
https://cdn.tourcms.com/a/5/172/3.jpg
https://cdn.tourcms.com/a/5/172/4.jpg

VB examples use the .Net Client Library

Overload list

XmlDocument ListTourImages ()
XmlDocument ListTourImages (int channelId)
XmlDocument ListTourImages (string queryString)
XmlDocument ListTourImages (string queryString, int channelId)


Parameters

queryString
Search querystring, see possible values in the table below
channelId
Channel to list Tours from, 0/blank for all connected channels

Example

' Set the Channel ID
' For Operators this can be found in the API settings page
' For Agents this can be a specific Channel or 0 to list tours from all
Dim channelId As Integer = 0

' Build Search querystring (see table below)
Dim queryString As String = ""

' Call the API
Dim doc As XmlDocument = myTourCMS.ListTourImages(queryString, channelId)

' Display Tour Image list
Dim tourList As XmlNodeList = doc.GetElementsByTagName("tour")
For Each tour As XmlNode in tourList
	Dim tourId As String = tour.SelectSingleNode("tour_id").InnerText
    Console.WriteLine("Tour id " & tourId)

    Dim imageList As XmlNodeList = tour.GetElementsByTagName("image")

    For Each image As XmlNode in imageList
    	Dim imageUrl As String = image.SelectSingleNode("url").InnerText
    	Console.WriteLine(imageUrl)
    Next
Next
Tour id 161
https://cdn.tourcms.com/a/5/161/1.jpg
https://cdn.tourcms.com/a/5/161/2.jpg
https://cdn.tourcms.com/a/5/161/3.jpg
Tour id 172
https://cdn.tourcms.com/a/5/172/1.jpg
https://cdn.tourcms.com/a/5/172/2.jpg
https://cdn.tourcms.com/a/5/172/3.jpg
https://cdn.tourcms.com/a/5/172/4.jpg

Looking for sample code in a different language? TourCMS and community provided API libraries

Implementing yourself? Check the REST info for this endpoint.

Try it

Enter your TourCMS API credentials below to call the List Tour Images endpoint.


            
            


Querystring parameters

Querystring parameters
XML NodeNotes
booking_styleSet to booking to only return Tours from Channels (Operators) that take confirmed online bookings (e.g. will ignore Tours from any Channels who take online "bookings" as an Enquiry or Quotation stage of the process)
qcEnable/disable "Quality control". Quality control can be switched on/off (default is off) within the Agent control panel and also overriden using this querystring parameter.
Note: This setting has no impact when a tour operator uses this API method on their own website.
 
Quality control explanation:
If you are a web affiliate sending traffic through to the suppliers website then turn qc=on to only return tours where TourCMS is confident web tracking of bookings is in place. If - rather than sending traffic to the suppliers website - you are using the API to input web bookings or enquiries then you don't need to worry about leakage via insufficient web tracking, hence can leave the quality control off. Also ensures tours meet certain image and description length criteria.

A Channel ID can also be passed in the request header, if using an API wrapper the Channel ID is passed as a separate parameter

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
tour

There will be one tour node for each Tour returned

Each tour node contains the following child nodes.

XML NodeNotes
channel_idChannel ID
account_idAccount ID
tour_idTour ID
images

The images node will contain between 1 and 6 image nodes.

XML NodeNotes
image

The first image node will contain a thumbnail attribute with the value true, this indicates that it is the image that would likely have been used if the Tour was viewed in a list along side other Tours; to maintain consistency you may wish to ensure this image is displayed first / most prominently when showing the Tour.

Each image node contains a url node and image_desc node, it may also contain other url_ nodes for alternative image sizes, as detailed below. The default url is the only size that is guaranteed, other sizes will be returned if the original uploaded image was sufficiently large.

XML NodeNotes
url_thumbnail URL (web address) for thumbnail image size (max 342 pixels wide)
url URL (web address) for the default image size (max 800 pixels wide)
url_large URL (web address) for large image size (max 1500 pixels wide)
url_xlarge URL (web address) for extra large image size (max 1920 pixels wide)
url_original URL (web address) for the original image file (may be very large!)

More information