Auth as Admin but create appointment as a specific user
undert03 opened this issue · comments
undert03 commented
Having troubling figuring out how to authenticate as the zimbra admin but set an appointment for a specific user on their calendar. Can anyone help?
undert03 commented
Anyone?
undert03 commented
Ended up figuring it out, here is the solution. But you need to generate a preauth token on your zimbra server
https://wiki.zimbra.com/wiki/Preauth
$account = new AccountSelector(AccountBy::NAME(), 'test@domain.com');
$preAuth = new PreAuth(time() * 1000, null, 0);
$preAuth->computeValue($account, INSERT_GENERATE_PREAUTH_TOKEN_HERE );
$api = MailFactory::instance('https://domain.com/service/soap');
$result = $api->auth($account, null, $preAuth);