Thank you for replying to the thread.
I'm already using HTTPProvider to call the API method, that part of the configuration is already working. In the example choosing the app instance is again done with (app.getAppInstance("_definst_");) which also does not work if the instance is not active.
I fixed the problem with starting the application prior to selecting the app instance and the null pointer exception is gone.
Current code is:
IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
IApplication app = vhost.getApplication(appName);
IApplicationInstance applicationInstance = application.getAppInstance(application.getAppInstanceNames().get(0));