home > support > API > Add a note to a booking

Booking add note

Add a note on to a booking


Notes

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.

REST info

Call/c/booking/note/new
FormatsXML
ExampleURL: /c/booking/note/new.xml
 
POST data:
<?xml version="1.0"?>
<booking>
  <booking_id>12345</booking_id>
  <note>
  	<type>AUDIT</type>
  	<text>Some information to store</text>
  </note>
</booking>
VerbPOST

Notes

PHP examples use the PHP Client Library with SimpleXML

Description

object add_note_to_booking (  int $booking, int $channel, string $note, $string note_type  )


Parameters

$booking
ID number for the booking to update
$channel
ID number for the channel the booking belongs to
note
The freetext to store in the note
note_type
The type of note being added

Example

// 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

Overload list

XmlDocument AddNoteToBooking ( int bookingId, int channelId, string note, string noteType )


Parameters

bookingId
The ID of the booking to add the note to
channelId
ID number for the channel the booking belongs to
note
The text to add
noteType
The type of note to add (see below)

Example

//  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

Overload list

XmlDocument AddNoteToBooking ( int bookingId, int channelId, string note, string noteType )


Parameters

bookingId
The ID of the booking to add the note to
channelId
ID number for the channel the booking belongs to
note
The text to add
noteType
The type of note to add (see below)

Example

'  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


Example

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

Note types

AUDIT
The least visible note type. Designed for storing a general log of things that have happened. For example the fact a third party system has been updated following a Webhook event.
SERVICE
Adds a customer note to the "Notes" section of the booking. Visually distinctive from staff notes however otherwise currently triggers no flags or alters - this is likely to change.
MODIFY
The most visible note type. This sets a Modification Request "Flag" within the TourCMS system that will notify any staff users set to receive the flag. Agents should use this note type for booking modification requests.

Response fields

Response fields
XML NodeNotes
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.

More information