home > support > API > Marketplace API > API: tours list
List Tour Images
| Purpose | 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 syncronise |
| Notes | N/A |
| REST info |
| Call | /c/tours/images/list /p/tours/images/list |
| Formats | XML |
| Example | /c/tours/images/list.xml |
| Verb | GET |
|
| 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 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 |
tour |
There will be one tour node for each Tour/Hotel returned
Each tour node contains the following child nodes.
| XML Node | Notes |
| channel_id | Channel ID |
| account_id | Account ID |
| tour_id | Tour/Hotel ID |
| images |
The images node will contain between 1 and 6 image nodes.
| XML Node | Notes |
| 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 Node | Notes |
| url |
URL (web address) for the image |
|
|
|
Sample XML Response
None here currently
More information