home > support > API > remove booking component
Remove a tour from a regular (i.e. non-temporary, non-archived) booking.
Endpoint | /c/booking/component/delete |
Formats | XML |
Example | URL: /c/booking/component/delete.xml POST data:
|
Verb | POST |
PHP examples use the PHP Client Library with SimpleXML
object booking_remove_component ( SimpleXmlElement $component_data, int $channel )
// Set the channel this booking will be made with
$channel = 3930;
// Start building the booking XML
$component_data = new SimpleXMLElement('<booking />');
// Set the ID for the booking the tour is on
$component_data->addChild('booking_id', 'BOOKING_ID_HERE');
// Add a component node
$component = $component_data->addChild('component');
// Set the ID for the tour to remove, obtained from the Show booking API
$component->addChild('component_id', 'COMPONENT_ID_HERE');
// Query the TourCMS API, removing a tour from a regular (i.e. non-temporary, non-archived) booking
$result = $tourcms->booking_remove_component($component_data, $channel);
// Check the result, will be "OK" if the tour was removed
switch ($result->error) {
case "OK":
// Print a success message
print "Thanks, your tour has been removed.";
break;
default:
// Some other problem (could check error to see what)
print "Sorry, unable to remove the tour at this time.";
break;
}
Thanks, your tour has been removed.
C# examples use the .Net Client Library
Code sample here soon
VB examples use the .Net Client Library
Code sample here soon
NodeJS examples use the NodeJS Wrapper
// Remove a component from a booking
TourCMS.removeBookingComponent({
channelId: 3930,
booking: {
booking_id: 12920,
component: {
component_id: 8286001
}
},
callback: function(response) {
console.log(response.error);
}
});
OK
Looking for sample code in a different language? TourCMS and community provided API libraries
XML Node | Notes | ||||||
---|---|---|---|---|---|---|---|
booking |
The root XML element
|
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. |