home > support > API > Marketplace API > List channels

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

REST info

Endpoint/p/channels/list
FormatsXML
Example/p/channels/list.xml
VerbGET

Code samples

PHP examples use the PHP Client Library with SimpleXML

Description

object list_channels ()


Parameters

n/a

Example

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

Overload list

XmlDocument ListChannels ()


Parameters

n/a

Example

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

Overload list

XmlDocument ListChannels ()


Parameters

n/a

Example

' 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


Example

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

Querystring parameters

There are no querystring parameters supported by this method.

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
channel

There will be one channel node for channel returned

Each channel node contains the following child nodes.

XML NodeNotes
channel_idChannel ID
account_idAccount ID
channel_nameChannel name
logo_urlChannel logo URL
home_urlURL website homepage
home_url_trackedURL website homepage (with agent tracking)
langLanguage
sale_currencySale currency
short_descShort description
long_descLong description
payment_gateway

Information about the payment gateway used by the operator, containing:

XML NodeNotes
gateway_id TourCMS unique identifier for this gateway
name Staff entered name for the gateway, freetext
take_visa
take_mastercard
take_diners
take_discover
take_amex
take_unionpay
A field for each possible supported credit/debit card type (MasterCard, Diners Club, Discover, American Express, UnionPay).
 
Will be "1" if card type is accepted, "0" if it isn't
 
Useful to display an indication of which card types are accepted when booking, perhaps using icons like these.
gateway_type Indicates the type of gateway used, if "SPRE" then the operator is using Spreedly which allows agents websites/apps to offer payments direct to the operator.
 
Other values include "PAYP" for PayPal, "AUN" for Authorize.net
If the operator is using Spreedly (gateway_type "SPRE")
spreedly_environment_keyRequired for taking credit card payments via Spreedly payment solution powered companies. This is open for travel agent use as well as supplier. More details
If accessing as a tour operator (not an agent)
field_1
field_2
....
field_10
Configuration settings for the payment gateway, useful if building a custom booking engine, allows gateway details to be stored once - in TourCMS.
 
10 fields, not all are used for all gateways (so some may be blank). The data stored in each numbered field varies by gateway, see the gateway settings page in TourCMS to match up the correct fields.

Sample XML response

/p/channels/list.xml

More information