home > support > API > Marketplace API > start new agent login
Start a new log into tourcms as agent
Part of a series of API endpoints enabling Travel Agent Login to API powered websites.
Call this endpoint to receive a link to the hosted Travel Agent login page.
Endpoint | /c/start_agent_login |
Formats | XML |
Example | /c/start_agent_login.xml |
Verb | POST |
PHP examples use the PHP Client Library with SimpleXML
SimpleXMLObject start_new_agent_login ( $params, int $channel )
// Set your channel ID
$channel_id = 3;
// Set your destination_url
// The customer will be redirected here after login
$final_url = "YOUR_DESTINATION_URL";
// Set your cancel page url
// The customer will be sent here if they cancel login
$cancel_page_url = "CANCEL_PAGE_URL";
// Generate xml with your parameters
$params = new SimpleXMLElement('<params />');
$params->final_url = $final_url;
$params->cancel_page_url = $cancel_page_url;
// Query the TourCMS API
$response = $tourcms->start_new_agent_login($params, $channel_id);
// Check the response, will be "OK" if process was OK
switch ($response->error) {
case "OK":
// Print login page URL
// (In reality you would store the tokens and then redirect)
print $response->login_page_url;
break;
default:
// Some other problem (could check error to see what)
print "Unable to log in.";
}
https://mp.tourcms.com/.....
Looking for sample code in a different language?
There are no querystring parameters.
XML Node | Notes |
---|---|
final_url | The URL TourCMS should redirect the user to after they log in. |
cancel_page_url | The URL TourCMS should redirect the user to if they cancel. |
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 |
login_page_url | URL to login page. Redirect the user to this URL. |
public_token | The public token for this login attempt. |
private_token | The private token for this login attempt. Do not display this in public, store this alongisde the public token. When the user returns to you after successful login the public_token will be provided in the querystring. Send the corresponding private_token to the Retrieve Agent Booking Key endpoint. |