Working with Itineraries
Beacon's complex GET method for itineraries allow you to retrieve a fully formatted itinerary by specifying a departure GUID and the type of itinerary:
NOTE: If the departure doesn't have an itinerary template specified for the type of itinerary requested, the result will be blank.
When submitting a request, you must authenticate to PEAK 15 using a valid user name and password for PEAK 15, however, you must append our domain, “@tripsync” to the user name.
The result set will be the exact same fully formatted HTML page that a user would see when previewing an Itinerary within PEAK 15.
Typically you will create a page on your website such as https://www.yourwebsite.com/itinerary.html?departureid=[departureGUID] which when opened requests the Proposal itinerary from Beacon for that departure and then displays the results within a DIV tag along with any other branding or navigation or functionality such as a "Book Now" button.
Our partner Net2Net has created a sample aspx page that shows how your itinerary page might display an itinerary. Note that these samples are provided "as is" and are not part of the system.
Sample Page (click to view)
The source is available below:
<%@ Page Language="VB" %> <script runat="server"> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ' Create a request for the URL. Dim myUri As String = "https://data2011.peak15systems.com/beacon2011/service.svc/get/<orgnamename>/complex/itinerary?p15_tripdeparturesid=" & Request.QueryString("DID") & "&templateType=" & Request.QueryString("Type") Dim myRequest As HttpWebRequest = HttpWebRequest.Create(myUri) myRequest.Method = "GET" ' If required by the server, set the credentials. myRequest.Credentials = New NetworkCredential("<yourusername>@tripsync", "<yourpassword>") Dim myResponse As HttpWebResponse = myRequest.GetResponse() Dim myDataStream As Stream = myResponse.GetResponseStream() Dim myReader As StreamReader = New StreamReader(myDataStream) Dim myResponseFromServer As String = myReader.ReadToEnd() Literal1.Text = myResponseFromServer myReader.Close() myDataStream.Close() myResponse.Close() End Sub </script> <title>My Itinerary</title> <form id="form1" runat="server"> <div> <asp:literal id="Literal1" runat="server"></asp:literal> </div> </form>