Get-Calender REST API to get the current week

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
marco786
Posts: 1
Joined: Thu Oct 01, 2020 9:47 am

Get-Calender REST API to get the current week

Postby marco786 » Thu Oct 01, 2020 9:57 am

I am trying to get the name of the meetings in the calenders via REST API for lets say this week and not able to figure out how to specify the start and end
So far I have done the following:(Using Python 3.8)

Code: Select all

import requests
import json
response = requests.get('https://abc.example.com/home/john.doe/calendar?fmt=json&start=-1week', auth=('user', 'password'))
res = response.json()

for i,j in res.items():
    for k in j:
         print(k['inv'][0]['comp'][0]['name'])


I am able to get the names but I want to display it only for this week which is not working.
Can you point my mistake?


User avatar
jeastman
Zimbra Employee
Zimbra Employee
Posts: 33
Joined: Tue Mar 29, 2016 1:36 pm

Re: Get-Calender REST API to get the current week

Postby jeastman » Tue Oct 06, 2020 3:48 pm

You will likely need to specify a query to filter the results to what you are looking for.

Check the REST API notes for details on the querystring parameters you can pass (specifically. "query").

Notes are here: https://github.com/Zimbra/zm-mailbox/bl ... s/rest.txt

Hope that helps.
John Eastman
kazers
Posts: 1
Joined: Sat Dec 05, 2020 8:23 am

Re: Get-Calender REST API to get the current week

Postby kazers » Sat Dec 05, 2020 8:26 am

Its wiil work in my case

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 3 guests