zimbra-api / soap-api

Zimbra SOAP client in PHP language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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