REST API Get Calendars

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
zimbrat0r
Posts: 2
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
barrydegraaff
Zimbra Employee
Zimbra Employee
Posts: 95
Joined: Tue Jun 17, 2014 3:31 am
Contact:

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. https://wiki.zimbra.com/wiki/Preauth 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 info@example.com -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: https://github.com/orgs/Zimbra-Community/
Developer of Zimbra OpenPGP Zimlet, Zimbra ownCloud Zimlet and more.
A Zetalliance Founder http://www.zetalliance.org/
zimbrat0r
Posts: 2
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 !

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 5 guests