Page 1 of 1

GetAppointment by uid using SOAP API

Posted: Thu Feb 23, 2017 10:26 am
by catone.cremonesi
Hello all,

I'm trying to fetch an appointment by uid using the SOAP API.

Here's a SSCCE using the php wrapper ( https://github.com/zimbra-api/zimbra-api ):

Code: Select all

<?php

require 'vendor/autoload.php';

use Zimbra\Enum\AccountBy;
use Zimbra\Mail\MailFactory;
use Zimbra\Struct\AccountSelector;

$api = MailFactory::instance('https://... my zimbra server ...');
try {
    $account = new AccountSelector(AccountBy::NAME(), '... my user name ...');
    $api->auth($account, '...  my password ..');

    $result = $api->getAppointment(null, null, null, '8705c923-0281-4cf7-80b9-3a4fa37f93ee', null);
    var_dump($result);
}
catch(Exception $ex) {
    $client = $api->getClient();
    echo $client->lastResponse();
}


When the uid refers to an appointment contained in a local calendar the code works correctly, when the uid refers to an appointment in a shared calendar (not owned by the account that performs the request) I get the following error:

Code: Select all

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <context xmlns="urn:zimbra"><change token="1902"/></context>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <soap:Code>
                <soap:Value>soap:Sender</soap:Value>
            </soap:Code>
            <soap:Reason>
                <soap:Text>no such appointment or task: 8705c923-0281-4cf7-80b9-3a4fa37f93ee</soap:Text>
            </soap:Reason>
            <soap:Detail>
                <Error xmlns="urn:zimbra">
                    <Code>mail.NO_SUCH_CALITEM</Code>
                    <Trace>qtp1937601231-845243:https://... my zimbra server ... /service/soap:1487843590290:9167a921c22538c7</Trace>
                    <a t="STR" n="uid">8705c923-0281-4cf7-80b9-3a4fa37f93ee</a>
                </Error>
            </soap:Detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>


It's working as it should or am I missing something?

I need some kind of id to fetch a specific appointment using the GetAppointment method, the id can't change in time and I need to use the same id to fetch the appointment from different zimbra accounts who share calendars with each others.

Thank you