home > support > API > Marketplace API > List channels
List of connected channels. Probably useful if you are taking all API data into a local database and you want to quickly find out which channels you are connected to. This call will give you a good list of channels to then run /c/channel/show against
You can also use this as a very basic list of suppliers featured on a multi-supplier website
Endpoint | /p/channels/list |
Formats | XML |
Example | /p/channels/list.xml |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object list_channels ()
n/a
// Query the TourCMS API
$result = $tourcms->list_channels();
// Loop through each channel
foreach($result as $channel) {
// Print out the channel name
print $channel->channel_name.'<br />';
}
Example Tours
Operator two
Another operator name
C# examples use the .Net Client Library
XmlDocument ListChannels ()
n/a
// Query the TourCMS API
XmlDocument doc = myTourCMS.ListChannels();
// Display Channel list
XmlNodeList chanList = doc.GetElementsByTagName("channel");
foreach (XmlNode channel in chanList)
{
string chanName = channel.SelectSingleNode("channel_name").InnerText;
Console.WriteLine(chanName);
}
Example Tours
Operator two
Another operator name
VB examples use the .Net Client Library
XmlDocument ListChannels ()
n/a
' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.ListChannels()
' Display Channel list
Dim chanList As XmlNodeList = doc.GetElementsByTagName("channel")
For Each channel As XmlNode In chanList
{
Dim chanName As String = channel.SelectSingleNode("channel_name").InnerText
Console.WriteLine(channelName);
}
Example Tours
Operator two
Another operator name
NodeJS examples use the NodeJS Wrapper
TourCMS.listChannels({
callback: function(response) {
console.log(response);
}
})
Example Tours
Operator two
Another operator name
Looking for sample code in a different language? TourCMS and community provided API libraries
Implementing yourself? Check the REST info for this endpoint.
Enter your TourCMS API credentials below to call this endpoint.
There are no querystring parameters supported by this method.
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 | ||||||||||||||||||||||||||||||||||||||||||
channel |
There will be one channel node for channel returned Each channel node contains the following child nodes.
|
<?xml version="1.0" encoding="UTF-8"?>
<response>
<request>GET /p/channels/list.xml</request>
<error>OK</error>
<channel>
<channel_id>3930</channel_id>
<account_id>4069</account_id>
<channel_name>TourCMS Example Tour Operator</channel_name>
<tour_count>9</tour_count>
<logo_url>https://cdn.tourcms.com/a/4069/w3930_logo.gif</logo_url>
<connection_permission>3</connection_permission>
<lang>en</lang>
<sale_currency>GBP</sale_currency>
<home_url>http://tourcms.com</home_url>
<home_url_tracked>http://live.tourcms.com/track/t.php?p=1&m=0&a=4069&k=aa3fb7a3429f&url=http%3A%2F%2Ftourcms.com</home_url_tracked>
<short_desc>TourCMS Example Tour Operator</short_desc>
<long_desc>TourCMS Example Tour Operator, use this for testing adding enquiries, bookings etc without fear of messing up a live account :)</long_desc>
<payment_gateway>
<gateway_id>1452</gateway_id>
<name>TMTP</name>
<credit_card_fee_sale_percentage>0.00</credit_card_fee_sale_percentage>
<gateway_type>TMTP</gateway_type>
<take_visa>1</take_visa>
<take_mastercard>1</take_mastercard>
<take_diners>0</take_diners>
<take_discover>0</take_discover>
<take_amex>0</take_amex>
<take_unionpay>0</take_unionpay>
</payment_gateway>
</channel>
</response>