Empty event list with the API

Hello,

I am trying to get the list of events from the remote account’s calendars of my team members.

Since we are using the ‘custom availability’ feature of YouCanBookMe I know my team members have some events on their calendars. But I can’t seem to be able to fetch these events through the API.
The events field for all calendar return as empty arrays.

Is this normal behavior ? Or am I doing something wrong ?
Thanks in advance :slight_smile:

@Atoria this is normal behavior. The events array through the remote account is only accessible from our system. You can retrieve events by the event Id through the events end point. or you can search with a query on the Queries endpoint: YCBM API docs

The payload would be:
{
“calendar”: “{calendarEmail}”,
“title”: “{customAvailabilityPhrase}”,
“start”: “2019-01-01T00:00:00Z”,
“end”: “2019-02-01T00:00:00Z”
}

You an adjust the date range to what you need. You also can incorporate an “and” and “or” clauses:
{
“or”: [
{
“calendar”: “{calendar1Email}”,
“title”: “YCBM”
},
{
“calendar”: “{calendar2Email}”,
“start”: “2019-01-01T00:00:00Z”,
“end”: “2019-02-01T00:00:00Z”
}
]
}

Hello,

Thank you for your response, this is exactly what I was looking for :slight_smile: !

I overlooked the “Queries” section of the documentation because it wasn’t written, it deserves an update I think :slight_smile: