Home > Software design >  Querying events from google calendar api by multiple emails
Querying events from google calendar api by multiple emails

Time:12-05

I am using the google calendar API in my project (Angular in my case). My problem is that I have a situation in which I need to query events by multiple emails in one request. By using the "q" field in the request - which represents a free search, I can only search for events by one term- in my case, it means one email.

Example for my request:

gapi.client.calendar.events.list({
'calendarId': 'primary',
'maxResults': '9999999',
'q': '[email protected]' (and here I want to put more than one email but I can't!)
})

Can I use this field or is there any other way in which I can get events by multiple emails in one request?

CodePudding user response:

In your situation, how about the following modification?

From:

'q': '[email protected]'

To:

'q': '[email protected] [email protected] [email protected]'
  • In this case, those emails are used as "AND". When you want to use these emails as "OR", it is required to request them as each request.

Note:

  • In this case, q is used as the query parameter. So, when you add a lot of emails and when an error related to the length of the URL occurs, please split the requests. Please be careful about this.

Reference:

  • Related