When using a service user to execute administration commands, it is not necessary to perform an explicit login operation to acquire a session identifier (sessionID).
Instead, the service user’s credentials need to be put into the session identifier (sessionID) for each command. This can be achieved by creating an instance of AdministrationSessionStorage and configure it by calling createAndStoreSession() with the service user’s credentials as sessionID. This AdministrationSessionStorage instance can then be directly used to initialize the various handler helper classes.
AdministrationSessionStorage sessionStorage = new AdministrationSessionStorage(); sessionStorage.createAndStoreSession("Apikey serviceUserId:1234567890abcdef", "{soapURL}"); UserHandler userHandler = new UserHandler(sessionStorage); userHandler.create(…);