Monday, April 19, 2021

#842 OIC - Oracle Hospitality syncing Company/Guest with SFDC Account/Contact








I covered the very basic Oracle Hospitality to SFDC integration a couple of posts ago. Now to a more compelling example - Oracle Hospitality allows us to create profiles for companies and guests - the latter being employees of the former. So, with this background, how about syncing Oracle Hospitality company and guest profiles with SFDC Accounts and Contacts?

I start, as usual, in Postman - working out which REST apis I need to invoke -

Here is the api to create a company profile - I create one for the Hare of the Dog Pub.

Note the id returned - 17858.

I then create a Guest profile - for the Hare's general factotum - Jimmy Keenahann.


 











Note the id for Jimmy - 17860.

Now to create the relationship between the 2 -











I now update the Company Profile with address and telephone data -













I also update Jimmy's profile - 














I can now use the following api to retrieve the relationship -













With OHIP, one can create a reservation for an existing profile id -



 







Note the reservation id - 19650.

I can use this to retrieve the Reservation, which will include the profile id -














Final step - I use the following api to store Jimmy's preferences for Banquets.













So now to the integration use case - based on a reservation id 

- retrieve the guest profile

- retrieve the company 

SFDC - check if an Account exists for the OH Company - if not, create a new Account in SFDC.

SFDC - check if a Contact exists for the OH Guest -  if not, create a new Contact in SFDC, linked to the relevant Account.

So let's build this incrementally - first step goes as far as creating the Account in SFDC -













I use the following SOQL in Check4Account - 














The SWITCH action is used to check if any records are returned - 













Now to testing...

CreateAccount returns me the SFDC Account id - 








I can check this out in SFDC - 








Note the id in the url.

Next step is to create the contact - now to save time, I won't go thru the existence check steps beforehand - you've already seen how easy it is to do that.













Check4Contact uses SOQL - checking for match on name and Contact Account Id -












The CreateContact configuration is simple - 











I only map a couple of fields - name etc. and accountId - 

Note: I am only showing the mapped fields -












Test Result in SFDC -









Now in a real life situation I could have a plethora of information coming from Oracle Hospitality e.g.













So I would probably add a couple of custom objects to my CRM to store such data. 

















I have surfaced these as the Bookings and Guest Preferences sections in the SFDC Contacts page -


 






























Bookings - could include reservation / stay data; a reservation morphing into a stay, once the guest has checked out. Sales activities with this SFDC contact can, of course, be progressed thru the standard SFDC business objects - Opportunities etc.

Naturally, I can update these custom business objects via the OIC SFDC adapter - 










Wednesday, April 14, 2021

#841 - OIC --> Oracle Hospitality - refreshing OAuth Token

A BIG THANK YOU to Devikiran G. for his support here!

Every OHIP request requires an OAuth token. 






In the previous posts on OHIP and OIC, I was hardcoding the token value in a Lookup -









Note the Authorisation entry - Bearer tokenValue

The token request is as follows - 

Authorisation is Basic Auth - Client_id/ Client_Secret








The response is in the following format - we are interested in the access_token. 














The curl representation is as follows -







So, essentially, I need to replicate this in OIC - 

I begin with the connection - 









URL is set to the OHIP host.

Username / Password set to Client_Id and Client_Secret.

The Integration is as follows - 














I get the token then update the lookup table via the OIC REST API - 









Now to the configuration of GetToken -






Note the Host custom header - will be set to OHIP host.






























The Mapping is similar to the previous examples covered in the Oracle Hospitality Integration posts -










As you can see, I am hardcoding most of the values - these I could, of course, externalise to the lookup.

Now to configuring the updateLookup Invoke -



























name will be set to the Lookup name.























The Mapping reflects the structure of the Lookup -












2 columns - name and value. Then the rows with the name value pairs.

Activate and test -

Here is the Lookup pre-test -


























Lookup post-test - 









Sanity test of an api that leverages the lookup -














All that's needed now is to schedule the integration e.g. run every 30 minutes.