zimbra-api / soap-api

Zimbra SOAP client in PHP language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth as Admin but create appointment as a specific user

undert03 opened this issue · comments

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?

Anyone?

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);