NOTE: We recommend using HTTP POST method for all calls.  This allows you to send parameters including the token in the payload of the message which increases security.  


Planner 2.0 Departure Itineraries

Planner 2.0 introduced the concept of Versions which can have distinct itineraries.  By default if your request doesn't specify a Version or Scenario ID, the Current Version will be used.  By default if your request doesn't include a Template ID, the Template associated with the type requested will be used.


POST /beacon/service.svc/get/your-orgname-here/complex/planneritinerary HTTP/1.1
Host: data.peak15systems.com
Content-Type: application/x-www-form-urlencoded

token=your-token-here
&departureid=your-departure-guid-here
&templateType=outline-or-proposal-or-final-or-operations-here
&scenarioid=your-version-guid-here
&templateid=your-itinerary-templateid-here

Planner 2.0 Guest Itineraries

Departures created in Planner 2.0 can also have itineraries generated for specific guests using Beacon.  There are two different endpoints depending on your needs.  The first endpoint allows you to pass in as a parameter a comma separated list of guest IDs like this:


POST /beacon/service.svc/get/your-orgname-here/complex/planneritinerary HTTP/1.1
Host: data.peak15systems.com
Content-Type: application/x-www-form-urlencoded

token=your-token-here
&departureid=your-departure-guid-here
&templateType=outline-or-proposal-or-final-or-operations-here
&scenarioid=your-version-guid-here
&templateid=your-itinerary-templateid-here
&guestid=your-guest1id-here,your-guest2id-here



The same result can be achieved with our advancedplanneritinerary endpoint which expects JSON in the body

Post URL

https://data.peak15systems.com/beacon/service.svc/get/[orgname]/complex/advancedplanneritinerary

JSON BODY

{
    "departures": [
        {
            "departureIds": "[departureid]",
            "type": "[outline/proposal/final/operations]",
            "scenarioId": "[scenarioid]",
            "templateId": "[templateid]"
        }
    ],
    "guests": [
        {
            "guestIds": "[guestid1],[guestid2]"
        }
    ],
    "orgName": "[orgname]",
    "token": "[tokenvalue]"
}

The advancedplanneritinerary endpoint must be used when requesting back to back itineraries for guests that have related bookings on different departures.  Note that the sequence of the departure array and guest arrays must be consistent.  In other words in the example below, guestid3 and guestid4 must be the guestids for departureid2.


JSON BODY

{
    "departures": [
        {
            "departureIds": "[departureid]",
            "type": "[outline/proposal/final/operations]",
            "scenarioId": "[scenarioid]",
            "templateId": "[templateid]"
        },
        {
            "departureIds": "[departureid2]",
            "type": "[outline/proposal/final/operations]",
            "scenarioId": "[scenarioid2]",
            "templateId": "[templateid2]"
        }
    ],
    "guests": [
        {
            "guestIds": "[guestid1],[guestid2]"
        },
        {
            "guestIds": "[guestid3],[guestid4]"
        }
    ],
    "orgName": "[orgname]",
    "token": "[tokenvalue]"
}


Planner 1.0 Departure Itineraries


Beacon's complex GET method for itineraries allow you to retrieve a fully formatted itinerary for Planner 1.0 by specifying a departure GUID and the type of itinerary:

POST /beacon/service.svc/get/your-orgname-here/complex/itinerary HTTP/1.1
Host: data.peak15systems.com
Content-Type: application/x-www-form-urlencoded

token=your-token-here
&p15_tripdeparturesid=your-departure-guid-here
&templateType=outline-or-proposal-or-final-or-operations-here


NOTE: If the departure doesn't have an itinerary template specified for the type of itinerary requested, the result will be blank.



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://data.peak15systems.com/beacon/service.svc/get/<orgnamename>/complex/itinerary?p15_tripdeparturesid=" &amp; Request.QueryString("DID") &amp; "&amp;templateType=" &amp; 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>