home > support > API > Marketplace API > retrieve agent booking key
Retrieve the booking agent key from a logged agent
Part of a series of API endpoints enabling Travel Agent Login to API powered websites.
After the agent has successfully logged in, pass the <private_token> received from Start New Agent Login to this endpoint to receive an <agent_booking_key> that can passed to Start New Booking to associate a new booking with this agent.
Endpoint | /c/retrieve_agent_booking_key |
Formats | XML |
Example | /c/retrieve_agent_booking_key.xml |
Verb | GET |
PHP examples use the PHP Client Library with SimpleXML
SimpleXMLObject retrieve_agent_booking_key( $private_token, int $channel )
// Set your channel ID
$channel_id = 3;
// Provide the private token
$private_token = "YOUR_PRIVATE_TOKEN";
// Query the TourCMS API
$response = $tourcms->retrieve_agent_booking_key($private_token, $channel_id);
// Check the response, will be "OK" if process was OK
switch ($response->error) {
case "OK":
// Print a success message
print "Your booking key is: " . $response->agent_booking_key;
break;
default:
// Some other problem (could check error to see what)
print "Sorry, unable to receive your booking key at this time.";
break;
}
Your booking key is: 12345
Looking for sample code in a different language?
Parameters | Descriptions |
---|---|
private_token | Your private token to verify if user is logged in |
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 |
maid | Marketplace_id of supplier channel. |
name | Agent name. |
Agent email. | |
agent_booking_key | Agent booking key. Pass this to Start New Booking as <agent_booking_key>, you will then not need to send a <booking_key> |
booking_key_valid_for | Key will be valid along a day. After that will be needed to retrieve another one. |