home > support > API > Marketplace API > customer login search
Verify a customer username/password are correct, retrieve the ID number for the matching customer
Designed to be used by Tour Operators (not for use by Marketplace Partners) perhaps to build a customer login area that could let customers view and modify their bookings, enquiries and contact details.
Call | /c/customers/login_search |
Formats | XML |
Example | /c/customers/login_search.xml?customer_username=jbloggs123&customer_password=password |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
object check_customer_login ( string $username, string $password, int $channel )
// Set the channel ID
$channel = 3;
// Username, perhaps entered by the customer in a login form
$username = "jbloggs123"
// Password, perhaps entered by the customer in a login form
$password = "password"
// Query the TourCMS API
$result = $tourcms->check_customer_login($username, $password, $channel);
// Check the result, will be "OK" if login details are correct
if($result->error = "OK") {
// Correct details, we can now get the customer ID from the XML
$customer_id = $result->customer->customer_id;
// Print a success message
print "Login details are correct, the customer ID is ".$customer_id;
} else {
// There has been a problem
print "Sorry, unable to log you in";
}
Login details are correct, the customer ID is 12345
C# examples use the .Net Client Library
XmlDocument CheckCustomerLogin ( string username, string password, int channelId )
username
Username, perhaps entered by the customer in a login form
password
Password, perhaps entered by the customer in a login form
channelId
ID number for the channel the customer belongs to
// Set the channel ID
int channelId = 3;
// Username, perhaps entered by the customer in a login form
string username = "jbloggs123"
// Password, perhaps entered by the customer in a login form
string pass = "password"
// Query the TourCMS API
XmlDocument doc = myTourCMS.CheckCustomerLogin(username, pass, channelId);
// Check the status
string status = doc.SelectSingleNode("//error").InnerText;
if ( status == "OK" )
{
// Get the customer_id
string cId = doc.SelectSingleNode("//customer/customer_id").InnerText;
Console.WriteLine("Login details are correct, the customer ID is " + cId);
} else {
// There has been a problem
Console.WriteLine("Sorry, unable to log you in");
}
Login details are correct, the customer ID is 12345
VB examples use the .Net Client Library
XmlDocument CheckCustomerLogin ( String username, String password, Integer channelId )
username
Username, perhaps entered by the customer in a login form
password
Password, perhaps entered by the customer in a login form
channelId
ID number for the channel the customer belongs to
' Set the channel ID
Dim channelId As Integer = 3
' Username, perhaps entered by the customer in a login form
Dim username As String = "jbloggs123"
' Password, perhaps entered by the customer in a login form
Dim pass As String = "password"
' Query the TourCMS API
Dim doc As XmlDocument = myTourCMS.CheckCustomerLogin(username, pass, channelId)
' Check the status
Dim status As String = doc.SelectSingleNode("//error").InnerText
If status = "OK" Then
' Get the customer_id
Dim cId As String = doc.SelectSingleNode("//customer/customer_id").InnerText
Console.WriteLine("Login details are correct, the customer ID is " + cId)
Else
' There has been a problem
Console.WriteLine("Sorry, unable to log you in")
End If
Login details are correct, the customer ID is 12345
Parameter | Notes |
---|---|
username | The customers username, perhaps via a login form |
password | The customers password, perhaps via a login form |
NB: The Channel ID is also required, this is passed in the API request header - or if using one of the wrapper libraries as the third parameter in the 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 | customer |
If the login details are correct there will be a customer node containing the following child nodes.
|