We plan on using Rocket.Chat in a similar way but we plan on heavily using the Twilio integrations as well. To me, it seems like a matter of using Rocket.Chat's REST API and maybe some of their i-frame integration.
On a side note, we just replaced Slack with Rocket.Chat for our company communications and we like it a lot. The only problem with Rocket.Chat is that its Android mobile app is somewhat weak (iOS mobile can be somewhat iffy too). I've used MatterMost before and it feels almost exactly like Slack.
Rocketchat has a nice and rather well documented API and a good support from the dev team.
I have it running almost plain vanilla, integrated with the company's portal and notifications work very well. Before RocketChat, the plan was also a custom UI based chat. We had a proof-of-concept running on an IRC server based on TheLounge (https://thelounge.chat) It presented more development costs than expected and with that, more maintenance costs as well. RocketChat proved to be better over the time.