dockerman_20
dockerman_20

Reputation: 55

Cronofy available_periods does not do anything

I am trying to get a user's availability, but in one use case, I want to ignore their actual availability rules and even their current schedule and calendar. Basically I am using cronofy in this use case to just provide me a list of times.

According to the docs https://docs.cronofy.com/developers/api/scheduling/availability/ I should be able to specify participants.members.available_periods.start and participants.members.available_periods.end. I've read and re-read these params over and over and am sure I am sending it as specified, but cronofy still returns to me only times that the user is not "busy".

Am I still not understanding this param? Is there another way to ignore a user's calendar, ie ignore their "busy" time slots?

Upvotes: 0

Views: 183

Answers (1)

adambird
adambird

Reputation: 183

The intent of the participants.members.available_periods parameter is to define a specific participant's availability hours for the query. Useful in multi-person queries when one or more participants have ad-hoc shift patterns or other complicated working hours. You can choose to specify these here or use our Available Periods endpoint along with Managed Availability to have the availability query consider the latest set of Available Periods when it is run.

The Availability query isn't designed to ignore all calendar events for an individual participant but there is another way you can achieve what you're looking for.

Application Calendars are designed as drop in replacements for synced-calendar Accounts in Cronofy. So you can create one of more of these via the API and use them in the Availability query as a stand-in for the participant.

They still support Managed Availability and can have events created in them. So if you wanted to ensure that your application doesn't double book over the events it already knows about, you can just create the events as your application books them.

I hope this helps. Our support team ([email protected]) are always happy to talk through the specifics of your use case if that would be helpful.

-- UPDATE --

We've decided to support this as a first class concept in our API.

You can now pass an empty array to the participants.member.calendar_ids attribute to indicate that you don't want any calendars included within the availability query. And thus, only the Availability Rules or query periods will be considered. Thanks for the question.

More information here.

Upvotes: 2

Related Questions