// 1. When is the team working? Public holidays in Germany count as closed.
const desk = await client.hours.createSchedule({
name: 'Support desk',
timezone: 'Europe/Berlin',
country: 'DE',
days: ['MON', 'TUE', 'WED', 'THU', 'FRI'],
openTime: '09:00',
closeTime: '18:00',
});
// 2. Every 15 minutes, but only while the desk is open.
const sync = await client.jobs.recurring({
name: 'Sync open tickets',
url: 'https://example.com/hooks/sync',
cron: '*/15 * * * *',
timezone: 'Europe/Berlin',
businessHoursScheduleId: desk.id,
});
console.log(sync.status, sync.next_run_at);
# 1. When is the team working? Public holidays in Germany count as closed.
desk = client.hours.create_schedule(
name="Support desk",
timezone="Europe/Berlin",
country="DE",
days=["MON", "TUE", "WED", "THU", "FRI"],
open_time="09:00",
close_time="18:00",
)
# 2. Every 15 minutes, but only while the desk is open.
sync = client.jobs.recurring(
name="Sync open tickets",
url="https://example.com/hooks/sync",
cron="*/15 * * * *",
timezone="Europe/Berlin",
business_hours_schedule_id=desk["id"],
)
print(sync["status"], sync["next_run_at"])