PHP Soap -> SearchRequest -> Appointment Problem
-
- Posts: 1
- Joined: Fri Sep 12, 2014 11:51 pm
PHP Soap -> SearchRequest -> Appointment Problem
Hello,
I have problems to get my appointments with the searchrequest.
The Request is:
http://schemas.xmlsoap.org/soap/envelop ... /envelope/" xmlns:ns1="urn:zimbraMail" xmlns:ns2="urn:zimbra">
XXXXX
And the Response is
http://schemas.xmlsoap.org/soap/envelop ... /envelope/">
1257174
5.0.10_GA_2638.UBUNTU6 20081003035628 20081003-0401 NETWORK
I'm sure that there are appointments. But why he doesn't show them?
P.S. The old GetApptSummariesRequest returns the same.
Thank you in advance,
Daniel
I have problems to get my appointments with the searchrequest.
The Request is:
http://schemas.xmlsoap.org/soap/envelop ... /envelope/" xmlns:ns1="urn:zimbraMail" xmlns:ns2="urn:zimbra">
XXXXX
And the Response is
http://schemas.xmlsoap.org/soap/envelop ... /envelope/">
1257174
5.0.10_GA_2638.UBUNTU6 20081003035628 20081003-0401 NETWORK
I'm sure that there are appointments. But why he doesn't show them?
P.S. The old GetApptSummariesRequest returns the same.
Thank you in advance,
Daniel
PHP Soap -> SearchRequest -> Appointment Problem
http://blog.xenco.be/wp-content/uploads ... -admin.txt
[QUOTE]
-----------------------------
...
...*
{more-flag} = 1 if the results were truncated.
{tokenize-key-op} = and|or
- Not present if the search key was not tokenized.
- Some clients backtrack on GAL results assuming the results of a more
specific key is the subset of a more generic key, and it checks cached
results instead of issuing another SOAP request to the server.
If search key was tokenized and expanded with AND or OR, this cannot
be assumed.
{type} = type of addresses to search
"account" for regular user accounts, aliases and distribution lists
"resource" for calendar resources
"all" for combination of both types
if omitted, defaults to "all"
[/QUOTE]
use zimbra_search_gal(..) with my modification
function zimbra_search_gal($name,$domain,$type = "all") {
$xml = new xml2Array();
$this->set_zimbra_header();
$soapmessage = $this->soapheader . '
' . $name . '
';
curl_setopt($this->curlhandle, CURLOPT_POSTFIELDS, $soapmessage);
if (!($zimbraSOAPResponse = curl_exec($this->curlhandle))) {
$this->zimbraerrno = curl_errno($this->curlhandle);
$this->zimbraerror = curl_error($this->curlhandle);
return false;
}
$res = $xml->parse($zimbraSOAPResponse);
if (isset ($res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHGALRESPONSE']))
return $res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHGALRESPONSE'];
return false;
}
How does it right reponse for you ?
...
[QUOTE]
-----------------------------
...
...*
{more-flag} = 1 if the results were truncated.
{tokenize-key-op} = and|or
- Not present if the search key was not tokenized.
- Some clients backtrack on GAL results assuming the results of a more
specific key is the subset of a more generic key, and it checks cached
results instead of issuing another SOAP request to the server.
If search key was tokenized and expanded with AND or OR, this cannot
be assumed.
{type} = type of addresses to search
"account" for regular user accounts, aliases and distribution lists
"resource" for calendar resources
"all" for combination of both types
if omitted, defaults to "all"
[/QUOTE]
use zimbra_search_gal(..) with my modification
function zimbra_search_gal($name,$domain,$type = "all") {
$xml = new xml2Array();
$this->set_zimbra_header();
$soapmessage = $this->soapheader . '
' . $name . '
';
curl_setopt($this->curlhandle, CURLOPT_POSTFIELDS, $soapmessage);
if (!($zimbraSOAPResponse = curl_exec($this->curlhandle))) {
$this->zimbraerrno = curl_errno($this->curlhandle);
$this->zimbraerror = curl_error($this->curlhandle);
return false;
}
$res = $xml->parse($zimbraSOAPResponse);
if (isset ($res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHGALRESPONSE']))
return $res['SOAP:ENVELOPE']['SOAP:BODY']['SEARCHGALRESPONSE'];
return false;
}
How does it right reponse for you ?
...
PHP Soap -> SearchRequest -> Appointment Problem
I am seeing the same behavior. SearchRequest seems to be able to return emails between a specified date just fine, but other types such as tasks and appointments don't seem to have any returned results in SearchResponse. Is this is bug or are we just missing something?
-
- Posts: 4
- Joined: Sat Sep 13, 2014 12:27 am
PHP Soap -> SearchRequest -> Appointment Problem
From looking at the dev debug mode, it seems that zimbra passes the query "inid:13" which I assume is the calendar id. I think you get it from the refresh or elsewhere.
PHP Soap -> SearchRequest -> Appointment Problem
I have the same strange behaviour with zimbra 5.0.11, with a json query:
the body of the reply is empty after a SearchRequest on type "appointment".
the body of the reply is empty after a SearchRequest on type "appointment".
PHP Soap -> SearchRequest -> Appointment Problem
here is the json query (javascript):
{ "Header": { "context": { "_jsns": "urn:zimbra", "authToken": { "_content": "' + Net.soapAuthToken + '" } }, "format": { "type": "js" } }, "Body":{ "SearchRequest": { "_jsns":"urn:zimbraMail", "sortBy":"dateAsc", "types": "appointment", "fetch": "all", "offset":"' + calOffset + '"; "limit": "30", "calExpandInstStart": "' + Math.floor(StartTime.getTime() / 1000) + '", "calExpandInstEnd": "' + Math.floor(EndTime.getTime() / 1000) + '" } } }
and here is the response:
{"Body":{"SearchResponse":{"more":false,"sortBy":"dateAsc","offset":0,"_jsns":"urn:zimbraMail"}},"Header":{....etc.... }}
{ "Header": { "context": { "_jsns": "urn:zimbra", "authToken": { "_content": "' + Net.soapAuthToken + '" } }, "format": { "type": "js" } }, "Body":{ "SearchRequest": { "_jsns":"urn:zimbraMail", "sortBy":"dateAsc", "types": "appointment", "fetch": "all", "offset":"' + calOffset + '"; "limit": "30", "calExpandInstStart": "' + Math.floor(StartTime.getTime() / 1000) + '", "calExpandInstEnd": "' + Math.floor(EndTime.getTime() / 1000) + '" } } }
and here is the response:
{"Body":{"SearchResponse":{"more":false,"sortBy":"dateAsc","offset":0,"_jsns":"urn:zimbraMail"}},"Header":{....etc.... }}
PHP Soap -> SearchRequest -> Appointment Problem
OK, to get the appointments, i must provide a calendar folder id in the query:
... "query": { "_content": "inid:10" } } } }
or xml:
...
inid:10
... "query": { "_content": "inid:10" } } } }
or xml:
...
inid:10
Re: PHP Soap -> SearchRequest -> Appointment Problem
Ok, but If I have more than one calendar under the main with ID=10, how can get the appointments of all calendars?be1 wrote:OK, to get the appointments, i must provide a calendar folder id in the query:
... "query": { "_content": "inid:10" } } } }
or xml:
...
inid:10
Is there a "query" in order to have all these appointments?
Thanks,
Regards
-
- Elite member
- Posts: 1112
- Joined: Sat Sep 13, 2014 12:47 am
Re: PHP Soap -> SearchRequest -> Appointment Problem
You should open new threads rather than revive old ones. The original relates to zimbra 5.0 which I am sure you are not using.
To answer your question - the best way to figure out how to build a query is to use the web client.
Open the web client,
click across to the Calendar tab,
Press F12 or whatever you need to open the Developer Tools,
Select the Network tab within the Developer Tools,
Now, perform a search within the zimbra client.
Look in the Developer tools for the SearchRequest, and click on it.
In the results window highlight Headers.
Scroll down to RequestPayload and expand it
Expand RerquestPayload->Header->Body->SearchRequest
Here you will find how the zimbra client formats a search request. Pay attention the the query attribute as this is the one that will specify the range of folders it is querying.
To answer your question - the best way to figure out how to build a query is to use the web client.
Open the web client,
click across to the Calendar tab,
Press F12 or whatever you need to open the Developer Tools,
Select the Network tab within the Developer Tools,
Now, perform a search within the zimbra client.
Look in the Developer tools for the SearchRequest, and click on it.
In the results window highlight Headers.
Scroll down to RequestPayload and expand it
Expand RerquestPayload->Header->Body->SearchRequest
Here you will find how the zimbra client formats a search request. Pay attention the the query attribute as this is the one that will specify the range of folders it is querying.
Re: PHP Soap -> SearchRequest -> Appointment Problem
Ok, sorry. You're right. I didn't want open another thread with similar problem.liverpoolfcfan wrote:You should open new threads rather than revive old ones. The original relates to zimbra 5.0 which I am sure you are not using.
To answer your question - the best way to figure out how to build a query is to use the web client.
Open the web client,
click across to the Calendar tab,
Press F12 or whatever you need to open the Developer Tools,
Select the Network tab within the Developer Tools,
Now, perform a search within the zimbra client.
Look in the Developer tools for the SearchRequest, and click on it.
In the results window highlight Headers.
Scroll down to RequestPayload and expand it
Expand RerquestPayload->Header->Body->SearchRequest
Here you will find how the zimbra client formats a search request. Pay attention the the query attribute as this is the one that will specify the range of folders it is querying.
I tryed with your suggestion and tThe answer is "{_content: " (inid:"10" OR inid:"280")"}" where 280 is ID of the other one calendar.