home > support > API > Add a note to a booking
Add a text-based note on to a booking
Using the various different note types this API call can be used for a variety of purposes from storing a basic log of events surrounding a booking to travel agents notifying tour operator staff of booking modification requests.
Call | /c/booking/note/new |
Formats | XML |
Example | URL: /c/booking/note/new.xml POST data:
|
Verb | POST |
PHP examples use the PHP Client Library with SimpleXML
object add_note_to_booking ( int $booking, int $channel, string $note, $string note_type )
// Set the channel ID
$channel = 3930;
// Which booking to update
$booking = 1234;
// The text to store
$note = "Some information to store on the booking";
// The type of note to store
$note_type = "AUDIT";
// Call TourCMS API, adding the note on to the booking
$result = $tourcms->add_note_to_booking($booking_id, $channel_id, $note, $note_type);
// Check the result, will be "OK" if the booking was updated
if ($result->error == "OK") {
// Print a success message
echo "Note stored";
} else {
// Some problem
print $result->error;
}
Note stored
C# examples use the .Net Client Library
XmlDocument AddNoteToBooking ( int bookingId, int channelId, string note, string noteType )
// Set the ID for the channel this booking is made with
int channelId = 3930;
// The booking to add a note to
int bookingId = 12345;
// The text to add
string note = "Some text to add";
// The type of note
string noteType = "AUDIT";
// Send the data to the TourCMS API, cancelling the Booking
XmlDocument doc = myTourCMS.AddNoteToBooking(
bookingId, channelId, note, noteType
);
// Check the status
// Will be "OK" if the booking was updated
string status = doc.SelectSingleNode("//error").InnerText;
Console.WriteLine(status);
OK
VB examples use the .Net Client Library
XmlDocument AddNoteToBooking ( int bookingId, int channelId, string note, string noteType )
' Set the ID for the channel this booking is made with
Dim channelId As Integer = 3930
' The booking to add a note to
Dim bookingId As Integer = 12345
' The text to add
Dim note As String = "Some text to add";
' The type of note
Dim noteType As String = "AUDIT"
' Send the data to the TourCMS API, cancelling the Booking
Dim doc As XmlDocument = myTourCMS.AddNoteToBooking(
bookingId, channelId, note, noteType
)
' Check the status
' Will be "OK" if the booking was updated
Dim status As String = doc.SelectSingleNode("//error").InnerText
Console.WriteLine(status)
OK
NodeJS examples use the NodeJS Wrapper
TourCMS.addNoteToBooking({
channelId: 3930,
booking: {
booking_id: 8451,
note: {
type: "AUDIT",
text: "Some note to store on the booking"
}
},
callback: function(response) {
console.log(response.error);
}
});
OK
Looking for sample code in a different language? TourCMS and community provided API libraries
Implementing yourself? Check the REST info for this endpoint.
Enter your TourCMS API credentials below to call the Booking add note endpoint.
Take care, submitting this form will modify live data!
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. |