zimbra-api / soap-api

Zimbra SOAP client in PHP language
BSD 3-Clause "New" or "Revised" License
62 stars 48 forks source link

Auth as Admin but create appointment as a specific user #27

Closed undert03 closed 6 years ago

undert03 commented 6 years ago

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 6 years ago

Anyone?

undert03 commented 6 years ago

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