PHP examples use the PHP Client Library with SimpleXML
Description
object
search_hotels_range([string $params="" [,string $tour="" [,int $channel=0]]])
Parameters
$params
Querystring, see "Querystring parameters" section below
$tour
Restrict the Search to a specific hotel ID
$channel
ID for a Channel (supplier) to list products from. Set as 0 for all.
Example
// Define channel
$channel = 3;
// Define search parameters
$params = "start_date_start=2011-07-01&start_date_end=2011-07-31";
// Query the TourCMS API
$result = $tourcms->search_hotels_range($params, "", $channel);
// Loop through each Hotel and output the name
foreach($result->tour as $hotel) {
print $hotel->tour_name.'<br />';
}
The Hilton
Travel Lodge
C# examples use the .Net Client Library
Overload list
XmlDocument SearchHotelsByRange ()
XmlDocument SearchHotelsByRange (string queryString)
XmlDocument SearchHotelsByRange (string queryString, string tour)
XmlDocument SearchHotelsByRange (string queryString, string tour, int channelId)
Parameters
queryString
Search querystring, see possible values in the table below
tour
Comma separated list of Tours to include in the search,
empty string/blank for all
channelId
Channel to search, 0/blank for all connected channels
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 search all
int channelId = 0;
// Define the Tour IDs
// Passing an empty string to search all
string tour = "";
// Define search parameters (any properties available during July 2011)
string queryString = "start_date_start=2011-07-01&start_date_end=2011-07-31";
// Call the API
XmlDocument doc = myTourCMS.SearchHotelsByRange(queryString, tour, channelId);
// Loop through each Hotel and output the name
XmlNodeList tourList = doc.GetElementsByTagName("tour");
foreach (XmlNode tour in tourList)
{
string tourName = tour.SelectSingleNode("tour_name").InnerText;
Console.WriteLine(tourName);
}
The Hilton
Travel Lodge
VB examples use the .Net Client Library
Overload list
XmlDocument SearchHotelsByRange ()
XmlDocument SearchHotelsByRange (string queryString)
XmlDocument SearchHotelsByRange (string queryString, string tour)
XmlDocument SearchHotelsByRange (string queryString, string tour, int channelId)
Parameters
queryString
Search querystring, see possible values in the table below
tour
Comma separated list of Tours to include in the search,
empty string/blank for all
channelId
Channel to search, 0/blank for all connected channels
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 search all
Dim channelId As Integer = 0
' Define the Tour IDs
' Passing an empty string to search all
Dim tour As String = ""
' Define search parameters (any properties available during July 2011)
Dim queryString As String = "start_date_start=2011-07-01&start_date_end=2011-07-31"
' Call the API
Dim doc As XmlDocument =
myTourCMS.SearchHotelsByRange(queryString, tour, channelId)
' Loop through each Hotel and output the name
Dim tourList As XmlNodeList = doc.GetElementsByTagName("tour")
For Each tour As XmlNode In tourList
Dim tourName As String = tour.SelectSingleNode("tour_name").InnerText
Console.WriteLine(tourName)
Next
The Hilton
Travel Lodge