Fatal error: Uncaught Zimbra\Common\Soap\Exception: no valid authtoken present in Common\Soap\AbstractApi.php
rizalhrm opened this issue · comments
<?php declare(strict_types=1);
require_once 'vendor/autoload.php';
use Zimbra\Mail\MailApi;
$query = 'in:inbox has:attachment';
$api = new MailApi('https://mycompanyserverzimbra.com/service/admin/soap');
$api->authByAccountName('rizalhrm@mycompanyserverzimbra.com', 'mypassword');
$response = $api->search($query, FALSE, 'message');
$messages = $response->getMessageHits();
var_dump($messages);
I tried the basic usage example above (based on https://github.com/zimbra-api/soap-api/blob/master/docs/usage.md) and got an error like :
"Fatal error: Uncaught Zimbra\Common\Soap\Exception: no valid authtoken present in D:\Development\soap-api\src\Common\Soap\AbstractApi.php on line 177".
Is there a solution to handle errors like the one above?
turns out the user has a different soap api url