Filters

Apply filters to your findtime requests, to narrow the search-space.

Usually a search space defined only by beginning and end is not specific enough for your use-case. Most commonly physical resources are constrained by working or opening hours. Availability filters make it easy to add these constraints to your findtime requests.

Filter types

  • OR filters
    Will include the resulting timeslots from any of the supplied filters. If you supply two filters with timeslots that doesn't overlap, they will both be added to the result. Consider it equivalent of coding an OR in a conditional statement (Filter1Result OR Filter2Result OR Filter3Result ...).

Example:

"filters": {
  "or": [
    {"specific_day": {"day": "Monday"} },
    {"specific_day": {"day": "Wednesday"} }
  ]
}

This will return time-slots only on Mondays and Wednesdays.

  • AND filters
    Will only include time-slots that fit within all of the supplied filters. Time-slots resulting from two different filters must overlap both filters to be included in the result. Consider it the equivalent of coding an AND in a conditional statement (Filter1Result AND Filter2Result AND Filter3Result ...)

Example

"filters": {
  "and":[
    { "specific_time": {"start": 10, "end": 16} }, 
    { "specific_time": {"start": 12, "end": 18} }
  ]
}

This will return time-slots from 12 to 16, because this is the overlapping time-space.

Combined example:

"filters": {
  "and":[
    { "specific_time": {"start": 10, "end": 16} }, 
    { "specific_time": {"start": 12, "end": 18} }
  ],
  "or": [
    {"specific_day": {"day": "Monday"} },
    {"specific_day": {"day": "Wednesday"} }
  ]
}

This will return time-slots from 12 to 16 only on Mondays and Wednesdays.

Quicklinks

And/Or filters:

All filters example primarily meant as a quick syntax reference:

"filters": {
  "or": [
    { "specific_day": {"day": "Monday"} },
    { "specific_day_and_time": {"day": "Wednesday", "start": 10, "end": 12, "timezone": "Europe/Copenhagen"}},
    { "between_timestamps": {"start": "2016-05-26T15:30:00+00:00", "end": "2016-05-28T18:00:00+00:00"}},
    { "exclude_weekend": {} },
    { "only_weekend": {} },
    { "specific_time": {"start": 9, "end": 15} }

  ],
  "and": [
    { "business_hours": {"timezone": "America/Los_angeles"} },
    { "daytime": {"timezone": "Europe/Copenhagen"}}
  ]
}

Between timestamps filter

Limit the search-space to between two timestamps.

ArgumentDescriptionRequiredExample
startThe start timestamp of the filteryes"2016-05-26T15:30:00+00:00"
endThe end timestamp of the filteryes"2016-05-28T18:00:00+00:00"
timezoneSet timezoneno"Europe/Copenhagen"
"filters": {
  "and": [
    { "between_timestamps": {
      "start": "2016-05-26T15:30:00+02:00", 
      "end": "2016-05-28T18:00:00+02:00", 
      "timezone": "Europe/Copenhagen"}
    }
  ]
}

👍

Adding availability instead of blocking out.

The between-timestamps filter can be used as a way to add availability, so instead of blocking anything off like you would normally do, you supply a list of between-timestamps as or-filters, defining the time-slots you want bookable.

Business hours filter

Can be used to find all solutions in business hours (9 - 18 (6pm)) in a specific timezone.

ArgumentDescriptionRequiredExample
timezoneThe timezone the business should be inno - Default will be the timezone in the request headers"America/Los_angeles"
"filters": {
  "and": [
    { "business_hours": {"timezone": "America/Los_angeles"} },
    { "business_hours": {"timezone": "Europe/Copenhagen"} }
  ]
}

📘

You can add more than 1 business hour filter!

If you add two business-hour as 'and' filters with two different timezones, you can make sure both timezones are in business hours! This will be useful if you need to set up a meeting between two resources working in different timezones.

Daytime filter

Will only show options where its daytime (7 - 23 (11pm)) in the given timezone

ArgumentDescriptionRequiredExample
timezoneThe timezone the business should be inno - Default will be the timezone in the request headers"America/Los_angeles"
"filters": {
  "and": [
    { "daytime": {"timezone": "America/Los_angeles"} },
    { "daytime": {"timezone": "Europe/Copenhagen"} }
  ]
}

Exclude weekends filter

If you need to filter out weekends (Saturdays & Sundays) you can use this filter. It takes a single argument

ArgumentDescriptionRequiredExample
timezoneThe timezoneno - default is the timezone in the header request"Europe/Copenhagen"
"filters": {
  "and": [
    { "exclude_weekend": {}}
  ]
}

Only weekend filter

If you only need time-slots in the weekend use this filter. The filter takes a single argument:

ArgumentDescriptionRequiredExample
timezoneOnly weekend of the given timezoneno - default is the timezone in the header request"Europe/Copenhagen"

This simple filter will only give you time-slots during weekends.

"filters": {
  "and": [
    { "only_weekend": {}}
  ]
}

Specific day and time filter

If you only need time-slots for a specific day and time, you can use this filter. The filter takes 3 argument:

ArgumentDescriptionRequiredExample
dayThe day you need timeslots foryes"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or "Sunday"
startThe start hour for this filter (in 24 hour format)yes10
endThe end hour for this filter (in 24 hour format)yes16
"filters": {
  "and": [
    { "specific_day_and_time": {"day": "Monday", "start": 10, "end": 16}}
  ]
}

This will give you all time-slots on Mondays between 10 & 16.

Specific time filter

If you only need timeslots for a specific time interval, you can use this filter. The filter takes a single argument:

ArgumentDescriptionRequiredExample
startThe start hour for this filter (in 24 hour format)yes10
endThe end hour for this filter (in 24 hour format)yes16
timezoneThat timezone the start & end hour should makeno - default from the request headers"Europe/Copenhagen"
"filters": {
  "and": [
    { "specific_time": {"start": 10, "end": 16}}
  ]
}

Specific day filter

If you only need timeslots for a specific day, you can use this filter. The filter takes a single argument:

ArgumentDescriptionRequiredExample
dayThe day you need timeslots foryes"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" or "Sunday"
"filters": {
  "and": [
    { "specific_day": {"day": "Monday"}}
  ]
}