Slash commands in HipChat can be implemented by making use of Add-ons. HipChat Add-ons are web apps which can be integrated to the HipChat client.
As the doc states:
'A HipChat add-on is just a set of "capabilities" that implement an OAuth based authentication flow, a set of REST APIs, and JavaScript APIs.'
- User begins installation of add-on in the HipChat server.
- HipChat server then retrieves hosted add-on's capabilities descriptor via GET.
- HipChat server registers the consumer and then posts OAuth consumerID/secret via POST to the Add-on.
- This info has to be saved as it will be required to make calls to the HipChat REST API.