Thursday, September 16, 2021

#878 OIC and Oracle Hospitality - Creating a Reservation with multiple rates

This post is more of a note for myself, but may be of interest to others needing to integrate with Oracle Hospitality via OHIP.

It leads on from the previous post - the situation is as follows - guest reserves a room for 2 nights, different rates for each night. So my request payload for the OIC Integration CreateReservation could look like the following - 














2 room rates one for the 10th of Oct and one for the 11th. They have different rate plan codes, ergo - different prices.

The Request for the OHIP Reservation Post is as follows - 

{

  "reservations" : {

    "reservation" : [ {

      "roomStay" : {

        "roomRates" : [ {

          "rates" : {

            "rate" : [ {

              "base" : {

                "amountBeforeTax" : "500"},

              "start" : "2021-10-10",

              "end" : "2021-10-10"

            } ]

          },

          "guestCounts" : {

            "adults" : 2,

            "children" : 0},

          "roomType" : "SU1B",

          "ratePlanCode" : "DAILY",

          "marketCode" : "LEISURE",

          "sourceCode" : "PHONE",

          "numberOfUnits" : "1",

          "pseudoRoom" : false,

          "roomTypeCharged" : "SU1B",

          "fixedRate" : false,

          "start" : "2021-10-10",

          "end" : "2021-10-10"

        }, {

          "rates" : {

            "rate" : [ {

              "base" : {

                "amountBeforeTax" : "400"},

              "start" : "2021-10-11",

              "end" : "2021-10-11"

            } ]

          },

          "guestCounts" : {

            "adults" : 2,

            "children" : 0},

          "roomType" : "SU1B",

          "ratePlanCode" : "CommiskeySpecial",

          "marketCode" : "LEISURE",

          "sourceCode" : "PHONE",

          "numberOfUnits" : "1",

          "pseudoRoom" : false,

          "roomTypeCharged" : "SU1B",

          "fixedRate" : true,

          "start" : "2021-10-11",

          "end" : "2021-10-11"

        } ],

        "guestCounts" : {

          "adults" : 2,

          "children" : 0},

        "guarantee" : {

          "guaranteeCode" : "6PM"},

        "bookingMedium" : "AA",

        "arrivalDate" : "2021-10-10",

        "departureDate" : "2021-10-12"

      },

      "reservationGuests" : [ {

        "profileInfo" : {

          "profileIdList" : [ {

            "type" : "Profile",

            "id" : "32848"

          } ]

        }

      } ],

      "reservationPaymentMethods" : [ {

        "paymentMethod" : "CA",

        "folioView" : "1"

      } ],

      "hotelId" : "CommiskeyTowers",

      "reservationStatus" : "Reserved",

      "preRegistered" : false,

      "allowMobileCheckout" : false

    } ]

  }

Integration is as follows - 



 











Map is as follows - 











Integration .iar available here

Sunday, September 12, 2021

#877 OIC Integrating Oracle Hospitality and Oracle CPQ

This is an interesting assignment - show how bi-directional integration between Oracle Hospitality and Oracle CPQ could work. In this case, CPQ is being used as the hotel call center reservation app. Here is a component overview -






Think of a chain of hotels, leveraging CPQ in their call center as their room reservation tool. Commiskey Hotels has 7 properties, scattered across the northside of Dublin city, and I need to get their room rates into CPQ, so that my call center folks can start providing visitors with the holiday of a lifetime.
  
The base data for the reservations - room availability - is stored in a CPQ Data Table, format is as follows - 


  














The reservation UI, surfaced in Oracle CPQ, leverages this data for finding the right room for the guest.

























Data Tables are used to store product and commerce data. They can be accessed from any part of the Oracle CPQ application where BML is used. BML = Big Machines Extensible Language - Oracle CPQ's scripting language.
Finally, a BML script will be used in Oracle CPQ to invoke the OIC integration to create the room reservation in Oracle Hospitality.  

OIC interfaces with Oracle Hospitality via OHIP (Oracle Hospitality Integration Platform). Check out the posts here for an introduction to OIC and OHIP.

Integrations - Oracle Hospitality to CPQ

Here I have 5 integrations - 
  1. getRoomRates 
    1. invokes the OHIP api to get rates
    2. invokes the integration - updateCPQDataTable
  2. updateCPQDataTable
    1. invokes the CPQ REST api to update the Data Table with the daily rate info.
  3. deployCPQDataTable
    1. invokes the CPQ REST api to deploy the Data Table, essentially making the data live and visible in the reservation UI.
  4. getRatesForProperties
    1. invokes getRoomRates for each property.
  5. updateOHIPToken
    1. This is a scheduled OIC integration that updates the Authorization token (stored in an OIC Lookup) every 45 minutes. 
Firstly, a short discourse on the subject of room rates. Hotels have different types of rooms e.g. king Room, 2 queens room, suite, junior suite. Room types could also include a reference to such things as views e.g. King Room with Lake view etc. Net, net, hotels can have many room types.

Each room type can have different rates. You have probably heard of the rack rate - this is the price that a hotel charges for a room before any discounts have been applied. This can often be set artificially high, to make discounts sound really compelling. 

Room rates can differ for a stay in the same room. We are all used to business hotels charging less at the weekend, so a stay from Thursday to Sunday could include different room rates. 

Room availability and the relevant rates are retrieved using the OHIP api - 

{{OHIPHostName}}/par/v0/hotels/{{HotelId}}/availability?roomStayStartDate=2021-09-01&roomStayEndDate=2021-09-02&roomStayQuantity=1&adults=1&children=0&limit=20&includeClosedRates=true

Note the parameters - limit - specifies the number of records to be returned, includeClosedRates will ensure that rates for unavailable rooms (e.g. already booked) are also returned.

I try the availability api in Postman to get a handle on the data structure returned - here I check for a room from 01 to 05 October - essentially for 4 nights 01, 02, 03, 04 October.


 
 
  
 



















As you can see, the Rack rate for a Superior room for the 4 nights 01 - 04 Oct is $400. 
The target Data Table in CPQ has rates per night, so for the above, I would need to create 4 rows with the same rate amount in the CPQ Data table. As discussed above, we could of course have multiple rates for this stay period.

In this particular scenario, I need to sync rate data between Oracle Hospitality and CPQ. I will need to do this for more than 1 hotel, and, per default, syncs will be executed with start and end dates being within the same month. The latter is for the POC only,  making date processing easier for me.

In the OIC integration, I will need to do some array processing, i.e.

Within roomStays
  • For Each  set of room rates
    • For Each set of rates
      • For Each rate...


   

But this is simple to design in OIC. 






































Next step is to insert the room rate data into the CPQ Data Table. This functionality is not currently covered by the CPQ adapter which focuses on supporting the CPQ Commerce api.

Therefore I use the OIC REST adapter and invoke the CPQ REST api directly. 
Step 1 is to create a new REST adapter based connection e.g. OHIP-REST-CPQ. I provide the CPQ base url and enter my CPQ username / password. 

I consulted the CPQ REST api docs - finding the Create Data Table Row api. The endpoint is as follows - /rest/v12/adminCustomYourDataTableName.

 

As usual, I try this REST invoke in Postman then "transcribe" it to OIC.
























Once the data is in CPQ, the data table needs to be deployed. This will ensure data changes are reflected in the UI. Again, same modus operandi - try out in Postman, transcribe to OIC - creating a separate integration for this functionality.





























 -













I mentioned earlier the need to process multiple properties. I create a separate integration for this, it accepts an array of properties and invokes getRoomRates for each property.

Finally, I also have a scheduled job that updates the OHIP token every 45 minutes. The token is used for authorization purposes in each call to OHIP. This scheduled job, retrieves the token from OHIP via - 





It then invokes the OIC REST api to recreate the lookup table (AA-Hospitality-Lookup) that includes the Bearer token value. 

























I also have a couple of other lookups - 









For example, each hotel will have it's own rate plan codes. Room types have a code and a description e.g. code ABCD may equate to Classic King Non-Smoking.
  

Integrations - CPQ to Oracle Hospitality

Very simple integration here - create a reservation in Oracle Hospitality - 






































Check my previous post for details on implementing the Reservation integration.
This integration will be invoked from CPQ - all we need is OIC endpoint and credentials, naturally I could put OCI API Gateway in between to mask the credentials. This invoke is implemented in CPQ BML -








Tuesday, September 7, 2021

#876 OIC - Aug 21 New Features - Zendesk Adapter

 Welcome to the new OIC Zendesk adapter, part of the August 21 release.






Firstly, apologies for the tardiness of this post, but that's what a 3 week vacation does to you!

ZenDesk is one of the most popular customer service apps on the planet - my simple demo covers creating a ticket in ZenDesk.  








Pre-requisites

I need the ZenDesk Client ID and Secret, in order to create the connection in OIC - So I click on the admin icon and select API.
















There is a button on the left (not shown in the above screenshot) - Add OAuth Client. I fill in all the fields and save - the Client Id is shown once and only once. I save it to a file.

Btw. the redirect url format is https://yourOICInstance/icsapis/agent/oauth/callback



Now I create the connection in OIC - using the Zendesk field Unique Identifier as Client Id.

Create the ZenDesk Connection in OIC 












I enter the data above and then click Provide Consent.

















Create an app-driven Integration in OIC


Now I can leverage the connection in an integration - 










































One can consult the ZenDesk REST api docs for details on Ticket fields. The docs can be found here  
So this is my Integration Request sample payload -   


I map to the target fields - 

I activate and test - 

























I validate in ZenDesk -


Conclusion 

The ZenDesk adapter supports the following (taken from the OIC docs)- 
  • Create or Update (create or update records in Zendesk)
  • Query (get records from Zendesk)
  • Delete (delete records from Zendesk)
  • Bulk Import (import bulk records into Zendesk)
All protected using OAuth 2.0 three-legged authentication. More details in the OIC ZenDesk adapter Guide, available here















Monday, August 30, 2021

#875 Oracle Assistant for OIC



The artificial intelligence capabilities of OIC have been augmented by the introduction of the Oracle Assistant for OIC. This compelling new feature of the August release is a great resource for folks new to Oracle Integration and also for those who are not so new.  

Usage is simple - here are some examples - 























Clicking on features above brings me to the documentation for the ERP adapter.








Another example - this time somewhat more complex - How do I import employees?














I select EBS - 












Naturally, there are some questions outside of the Assistant's remit - 











You can also help improve the Assistant - here I ask about adding conditional logic to an integration - 










So get asking those questions!


Monday, August 2, 2021

#874 OIC & Blue Prism Part 3 - Invoking an OIC Integration from Blue Prism


This post details how to invoke OIC REST based integrations from Blue Prism. 
The first example is calling an OIC integration, exposed as REST. The verb is GET and a parameter needs to be passed. The second example, uses POST and has JSON request / response payloads. The final example uses POST and a JSON array.

Example 1 - GET with Parameter

The integration, AA-HelloWorld-GET, is very simple - 



I test it in OIC - 


Ok, let's now invoke this from Blue Prism -

Some setup first - Create Security Credentials in Blue Prism - this essentially holds the OIC username/password I want to use.


I have called my entry here - Oracle Integration



Very important - thanks to Google for this - you need to set the Access Rights -
I just selected all, for simplicity sake -


Ok, that's the credentials taken care of - now to define the OIC api we need to call -


 
I have called mine OIC and the configuration is as follows - 

Specify the base OIC url here -


I specify the use of the Credential here - 



Note, I have 2 actions - let's look at GetHelloWorld - and its configuration - 





Now let's invoke this from a Blue Prism Process - this is probably the simplest Blue Prism process ever!


I used an "Action" for InvokeOIC - it's configured as follows - 


Note the input - here I hard code it to "BluePrism".

Essentially, that's it - the Output is configured as follows -  


I run the Process - 


I check OIC Monitoring-Tracking -


I can also see this in Blue Prism Control - 


I can easily process the OIC response - all I do is add an output value to the End.



I re-run the Process in the Control Panel, by dragging the process to a robot. 
I see the response -


Example 2 - POST with JSON Request/Response

Here is my OIC integration - 

























Note the Request/ Response JSON payloads above; these will be used when creating the Web API definition in Blue Prism. 


I create a new API definition in Blue Prism (System - Web API Services) - 



I add the following Parameters


These are then used in the Request definition - 


Note, the orderStatus is hardcoded - "pending".

I add the following Request Header


Now to the Response


Here is my Blue Prism automation Process -


Again, very simple, it only invokes the OIC integration. Let's look at the configuration - 



Note how the 2 response fields I specified appear in the Outputs section.


I test the Process -


I check for the instance in OIC - 



I see the response in Blue Prism - 


Excellent, as we say in Germany, wir sind die Roboter!


Example 3 - POST with JSON Array

Now what happens if the JSON request contains an array?
Here we can leverage the Blue Prism JSON Utility - 


 
I import the file - 



Now to the actual Process, I will read the Excel file used in the previous post


The contents of this file need to be passed to the following OIC integration - 


Note the array of employees - akin to those in the Excel sheet.
I use the Excel workbook processing logic from the previous post - 


Note the 2 new actions - Utility - JSON:Collection: Collection to JSON and OIC ProcessEmps.
But firstly, the Web API definition - 






The Utility:JSON action is configured as follows - 
















OIC-Process Emps action is configured as follows -




I test the Process - 



I see the instance in OIC -