Create Weekday Schedule

The next must have for a properly set-up system is a Schedule.

A schedule is what will be used to determine when a person will be allowed to enter an area or when an area will be accessible in general.

A schedule can hold multiple time frames with in it and that is why in the example we have added a schedule item with in an array of schedule items even though there is only one duration. This schedule allows for access between the 9th hour of the day to the 17th hour of the day, 9am to 5pm.

For more information on Schedules and the methods used please look at ScheduleInfo and ScheduleDurationItem.

For information on Holidays please look at HolidayInfo.

Example in C#

var newSchedule = await client.AddScheduleAsync(currentInstance,
new ScheduleInfo
    CommonName = "StandardSchedule",
    ScheduleDurations = new ScheduleDurationItem[]
            new ScheduleDurationItem
                    DayMask = 62, // Day Mask for Monday through Friday (0111110) (Sat|Fri|Thurs|Wed|Tues|Mon|Sun) 
                    StartingAt = new TimeSpan(9,0,0), // Starting at 9 hours after the day begins (9AM)
                    Duration = TimeSpan.FromHours(8), // Sets end time 8 hours from StartingAt (5PM)
                    //Holiday = newHoliday //OPTIONAL, see HolidayInfo

Example in CURL

curl -X POST \ \
    -H 'Authorization: Bearer TOKEN_GOES_HERE' \
    -H 'Content-Type: application/json' \
    -D '{
            "$type":"Feenics.Keep.WebApi.Model.ScheduleInfo, Feenics.Keep.WebApi.Model",
                    "$type":"Feenics.Keep.WebApi.Model.ScheduleDurationItem, Feenics.Keep.WebApi.Model",