You can use the <GetFolderRequest> SOAP command and that will return a list of folders. The folders with view="appointment" are calendar folders.
Submit the <GetFolderRequest xmlns="urn:zimbraMail" /> request and get the response and parse the response for view="appointment" for calendar folders.
Code:
<GetFolderResponse xmlns="urn:zimbraMail">
<folder>........</folder>
<folder>........</folder>
<folder view="appointment" i4ms="307" ms="307" i4next="587" l="1" id="586" rev="307" color="1" f="#" n="0" name="myholidaycalendar" rgb="#9EB6F5" s="0"/>
<folder i4ms="306" view="appointment" ms="1" f="#" i4next="585" n="15" l="1" name="Calendar" s="0" id="10" rev="1"/>
<folder>........</folder>
<folder>........</folder>
<folder>........</folder>
</GetFolderResponse>
Now your next question is: I don't want to have to call SOAP, can I do this without SOAP? Yes.
You can just submit the SOAP formatted XML to the server SOAP URL. And read the XML response. That does not require SOAP or a SOAP library, so you can call it from anywhere.
For example, to do this thru Java, you can make a URL connection to the SOAP URL, post the XML content and read the response. The follow shows submitting SOAP XML to a URL without the use of a SOAP toolkit or any Zimbra-specific SOAP Java libraries...it's just plain-ol' Java:
Code:
String SOAPUrl = "http://localhost:7070/service/soap/";
// Create the connection where we're going to send the file.
URL url = new URL(SOAPUrl);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
String postContent = "<soap>....</soap>"; // insert your SOAP XML!!!
byte[] b = postContent.getBytes();
// Set the appropriate HTTP parameters.
httpConn.setRequestProperty( "Content-Length", String.valueOf( b.length ) );
httpConn.setRequestProperty("Content-Type","application/soap+xml; charset=utf-8");
httpConn.setRequestMethod( "POST" );
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
// Everything's set up; send the XML that was read in to b.
OutputStream out = httpConn.getOutputStream();
out.write( b );
out.close();
// Read the response and write it to standard out.
InputStreamReader isr = new InputStreamReader(httpConn.getInputStream());
BufferedReader in = new BufferedReader(isr);
// read & do something with input stream...
in.close(); Now what does a SOAP XML format look like? Here's a sample of making the <GetFolderRequest>. Be sure to replace the auth token with your auth token (from the ZM_AUTH_TOKEN cookie...or use the <AuthRequest> SOAP command to generate an auth token:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<format xmlns="" type="xml"/>
<authToken xmlns="">XXX_XXXX_XXXX</authToken>
</context>
</soap:Header>
<soap:Body>
<GetFolderRequest xmlns="urn:zimbraMail" />
</soap:Body>
</soap>
So it's not "REST" per se but it's a way of calling into Zimbra via URL and no external libraries required. You submit content to a URL and read a response. That's about it.
Note: you can do the same thing and submit JSON (instead of XML) and get a JSON response (instead of XML) if that format works better for you. See ZimbraServer/docs/soap.txt for more information on these commands and the SOAP API in general.
Also, if you want to test-out the SOAP commands, you can use the ZmSoap utility that is part of ZCS.
Zmsoap - Zimbra :: Wiki