This will work in 2.2 or higher.
There are two API's you will want to look at. App Integration API and Single Integration API.
You are probably going to want to focus on the App Integration API. You can find it here: http://help.qlik.com/en-US/sense-developer/2.2/Subsystems/APIs/Content/AppIntegrationAPI/app-integration-api.htm?q=app integration API
It gives examples as well.