home > support > API > Marketplace API > API: tours list

List Tour Images

PurposeList 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 syncronise
NotesN/A
REST info
Call/c/tours/images/list
/p/tours/images/list
FormatsXML
Example/c/tours/images/list.xml
VerbGET
PHP info

PHP examples use the PHP Client Library with SimpleXML

Description

object list_tour_images ( [ int $channel = 0 ] ) 

Parameters

$channel
	ID for a Channel (supplier) to list images from

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: http://media.tourcms.com/a/5/161/1.jpg,
http://media.tourcms.com/a/5/161/2.jpg, 
http://media.tourcms.com/a/5/161/3.jpg, 
Tour id 172: http://media.tourcms.com/a/5/172/1.jpg,
http://media.tourcms.com/a/5/172/2.jpg, 
http://media.tourcms.com/a/5/172/3.jpg,
http://media.tourcms.com/a/5/172/4.jpg

Querystring parameters

N/A

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

Each tour node contains the following child nodes.

XML NodeNotes
channel_idChannel ID
account_idAccount ID
tour_idTour/Hotel 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 image should be used as the thumbnail if a single image is being displayed (e.g. list pages).

Each image node contains a url node.

XML NodeNotes
url URL (web address) for the image

Sample XML Response

None here currently

More information

© 2003-2012 Travel UCD Limited. All rights reserved. TourCMS® is a registered trademark of Travel UCD Limited, United Kingdom. View Privacy policy.

Free 1 hour webinar - An introduction to TourCMS, 31st May @ 3pm GMT / 4pm BST (UK). Check in your timezone and register »