REST API Get Calendars

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Posts: 3
Joined: Tue Aug 25, 2020 7:53 am

REST API Get Calendars

Postby zimbrat0r » Tue Aug 25, 2020 7:56 am

Hi !

I'm using the REST API to query the calendar items of users.
The only way i'm able to do that for now is to connect by using the users credentials.

I would like to know (not found in the doc :( ) if there is a way to connect by using "impersonation" using REST API.

Thanks at all for your help (i'm using Python).

User avatar
Zimbra Employee
Zimbra Employee
Posts: 102
Joined: Tue Jun 17, 2014 3:31 am

Re: REST API Get Calendars

Postby barrydegraaff » Thu Sep 03, 2020 7:34 am

There are a number of ways to do this.

One easy way is to set up preAuth on your domain, that way you can get an authtoken for any user you need to get the calendar of, and then use the REST API as you already now. If you implement your own pre-auth mechanism be careful not to expose/open it to the public as this may have security implications. get an auth token, then you can use REST!

Another way is using an admin account to get the calendar using SOAP. One way to find out how to do this is take a look at what the zmmailbox command does when you invoke it via the CLI on the server

Code: Select all

 zmmailbox -d -z -m -t 0 getRestURL "/calendar"

This will dump all SOAP requests to the terminal, so you can implement whatever you need from that in your application.
Barry de Graaff
Admin of Zimbra-Community Github:
Developer of Zimbra OpenPGP Zimlet, Zimbra ownCloud Zimlet and more.
A Zetalliance Founder
Posts: 3
Joined: Tue Aug 25, 2020 7:53 am

Re: REST API Get Calendars

Postby zimbrat0r » Thu Sep 03, 2020 7:52 am

Thanks for your reply i managed to do it by using auht, thanks again !
Posts: 10
Joined: Mon Nov 30, 2020 7:10 pm

Re: REST API Get Calendars

Postby alexvenne » Tue Jan 05, 2021 3:40 pm

I'd be really curious to see the performance of this method vs. using EWS. I was tasked with building an out of office calendar that managers could use to schedule projects. It needed to show all out of office events for every employee within a certain time period\

Kodi nox

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 4 guests