This weekend we had a very severe snow storm on the east coast of the US which of course was a great excuse for me to stay in and do nothing or at least have a play around with my new Amazon Echo.
As I mentioned in my previous blog, I’ve been intrigued by Amazon opening up the Echo to developers to allow them to integrate it with whatever system they like so I decided to do just that and have integrated it with my S/4HANA demo system to see how easy it could be.
The following video gives an overview of what I built and there are more details on how I built it below. In terms of build time it took about 4 or 5 hours in total.
There are a two ways you can build an Amazon Skills Kit service (or ASKs). One is via Amazon’s own hosted systems and the other is via your own hosted web service. I opted for the latter as I like building web services and having complete control.
The concept is simple – The echo talks to Amazon, Amazon talks to my web service and then in turn my web service talks to S/4HANA. For me this was a perfect job for a Node.js development.
The skill is very easy to setup via developer.amazon.com and allows you to define your skill outline and add it to your own Echo to test (without publishing it for all the world to see). Here you outline the name of your skill (I opted for “HANA”) as well as what phrasing the Echo should expect – usually in the form of:
- Tell me x about y
- Tell me about how my cost centre is doing this month
The Node.JS server
This was probably the bit that took the most time. Amazon has very detailed information on what they expect from your web services – they provide you what the user has said in JSON format and you respond with what the Echo should say. It really is that simple.
The fun part was accepting the request, digesting it to understand the timeframe the user was interested in and then building the URL to call the OData service for the MySpend application on my S/4HANA system.
Finally I parsed the response from S/4 and constructed a response to Amazon.
But of course, don’t take my word for it! I’ve open sourced my code for anybody to try for themselves on Github – enjoy!
The S/4HANA bit was awesomely simple – I opened the MySpend app – figured out which OData service it was calling and how to interact with it and then integrated the same web call into my Node.JS server. Easy as that.
This was a lot of fun to put together and it really shows us a glimpse of the future where board meetings will be interactive sessions with data or interactions like Jarvis in Iron man (Thanks Nathan!).
For now though it’s just a PoC and is likely to remain that way – Some limitations on the Amazon side are quite annoying such as you can’t have a private skill you only give to certain people. Once you are finished development, it’s into the skills store for everybody or nothing at all. Not ideal for the enterprise. And of course, the old chestnut of privacy and security – it would need some more work and investigation before many companies would be happy putting their productive content through it.
Questions, comments are most gratefully received as always!