Fortinet white logo
Fortinet white logo

ScheduleObject

ScheduleObject

View or change schedules.

Permissions required include Camera configuration.

HTTP Methods
  • GET

  • POST

  • PUT

  • DELETE

URL

For HTTP GET, use either:

  • https://HOST_OR_IP/api/v1/ScheduleObject/

  • https://HOST_OR_IP/api/v1/ScheduleObject/SCHEDULE_NAME

For HTTP POST, PUT, or DELETE, use:

  • https://HOST_OR_IP/api/v1/ScheduleObject/SCHEDULE_NAME

where variables are:

  • SCHEDULE_NAME — Unique identifier of a specific resource, such as the schedule Away. The schedules must be of type Assistant.

Request JSON

For HTTP GET or DELETE, leave the request body empty.

For HTTP PUT or POST, configure only settings that you want to change. Omit others. For a list of available settings, use HTTP GET.

Response JSON

For HTTP PUT, responses vary by which settings you changed.

For HTTP GET, responses vary by URL (collection vs. individual resource). For example, if you get an individual schedule, you may receive a response like this:

{
    "objectID": "ScheduleObject:BusinessHours",
    "reqAction": 1,
    "nodePermission": 3,
    "mkey": "BusinessHours",
    "description": "Typical business hours.",
    "management_mode": 0,
    "type": 0,
    "assist_active": false,
    "all_day": false,
    "date_start": "",
    "start_time_type": 0,
    "time_start": "09-00",
    "date_end": "",
    "end_time_type": 0,
    "time_end": "17-00",
    "days": 62,
    "zenith": 0,
    "sunrise_offset": 0,
    "sunset_offset": 0
}

where attributes are often self-explanatory, except:

  • type — Frequency of the schedule.

    • 0 — Recurring on multiple days of the week.

    • 1 — One date or time range only.

    • 2 — Used by the default schedule named Away.

  • days — Which days of the week to apply a recurring schedule to. Total of the following numbers, depending on which days you choose:

    • 1 — Sunday.

    • 2 — Monday.

    • 4 — Tuesday.

    • 8 — Wednesday.

    • 16 — Thursday.

    • 32 — Friday.

    • 64 — Saturday.

    • 62 — Monday through Friday.

    • 127 — All days.

  • all_day — .Whether or not the schedule applies to the entire day:

    • true — All day.

    • false — Part of the day, defined by time_start and time_end, or times defined by the sunrise and sunset on each date.

  • start_time_type — Either:

    • 0 — Time specified in time_start.

    • 1 — Sunrise on that date.

    • 2 — Sunset on that date.

  • end_time_type — Either:

    • 0 — Time specified in time_end.

    • 1 — Sunrise on that date.

    • 2 — Sunset on that date

  • date_start — Which date to start a one-time schedule. Format is "YYYY-MM-DD" (year, month, day). This setting applies if type is 1.

  • date_end — Which date to stop a one-time schedule. Format is "YYYY-MM-DD". This setting applies if type or is 1.

  • time_start — Which time to begin the schedule. Format is "HH-MM" (hour, minute) according to a 24-hour clock. This setting applies if start_time_type is 0.

  • time_end — Which time to stop the schedule. Format is "HH-MM". This setting applies if end_time_type is 0.

  • sunrise_offset — .Minutes of offset from the sunrise time . This setting applies if start_time_type or end_time_type is 1.

  • sunset_offset — Minutes of offset from the sunset time. This setting applies if start_time_type or end_time_type is 2.

Example: Change schedule time range to all day

curl -X PUT -H "Content-Type: application/json" -d "{\"all_day\":true}" -b cookie.txt https://HOST_OR_IP/api/v1/ScheduleObject/SCHEDULE_NAME

After you configure the schedule, you can use it in another part of the configuration. See CameraProfile.

Tooltip

On Microsoft Windows with Command Prompt, inside the JSON data, you must put a backslash before each double straight quote ( \" ). For example (highlighted in bold):

-d "{\"all_day\":true}"

Alternatively, you can input a JSON stream from another command.

If you do not, the command line may interpret each JSON attribute as CLI commands or arguments, resulting in various error messages depending on the sequential order of arguments and attributes.

Reserved characters and escape sequences vary by operating system and command line environment; Linux and Mac terminals often do not require this, and Microsoft PowerShell uses different escape sequences.

ScheduleObject

ScheduleObject

View or change schedules.

Permissions required include Camera configuration.

HTTP Methods
  • GET

  • POST

  • PUT

  • DELETE

URL

For HTTP GET, use either:

  • https://HOST_OR_IP/api/v1/ScheduleObject/

  • https://HOST_OR_IP/api/v1/ScheduleObject/SCHEDULE_NAME

For HTTP POST, PUT, or DELETE, use:

  • https://HOST_OR_IP/api/v1/ScheduleObject/SCHEDULE_NAME

where variables are:

  • SCHEDULE_NAME — Unique identifier of a specific resource, such as the schedule Away. The schedules must be of type Assistant.

Request JSON

For HTTP GET or DELETE, leave the request body empty.

For HTTP PUT or POST, configure only settings that you want to change. Omit others. For a list of available settings, use HTTP GET.

Response JSON

For HTTP PUT, responses vary by which settings you changed.

For HTTP GET, responses vary by URL (collection vs. individual resource). For example, if you get an individual schedule, you may receive a response like this:

{
    "objectID": "ScheduleObject:BusinessHours",
    "reqAction": 1,
    "nodePermission": 3,
    "mkey": "BusinessHours",
    "description": "Typical business hours.",
    "management_mode": 0,
    "type": 0,
    "assist_active": false,
    "all_day": false,
    "date_start": "",
    "start_time_type": 0,
    "time_start": "09-00",
    "date_end": "",
    "end_time_type": 0,
    "time_end": "17-00",
    "days": 62,
    "zenith": 0,
    "sunrise_offset": 0,
    "sunset_offset": 0
}

where attributes are often self-explanatory, except:

  • type — Frequency of the schedule.

    • 0 — Recurring on multiple days of the week.

    • 1 — One date or time range only.

    • 2 — Used by the default schedule named Away.

  • days — Which days of the week to apply a recurring schedule to. Total of the following numbers, depending on which days you choose:

    • 1 — Sunday.

    • 2 — Monday.

    • 4 — Tuesday.

    • 8 — Wednesday.

    • 16 — Thursday.

    • 32 — Friday.

    • 64 — Saturday.

    • 62 — Monday through Friday.

    • 127 — All days.

  • all_day — .Whether or not the schedule applies to the entire day:

    • true — All day.

    • false — Part of the day, defined by time_start and time_end, or times defined by the sunrise and sunset on each date.

  • start_time_type — Either:

    • 0 — Time specified in time_start.

    • 1 — Sunrise on that date.

    • 2 — Sunset on that date.

  • end_time_type — Either:

    • 0 — Time specified in time_end.

    • 1 — Sunrise on that date.

    • 2 — Sunset on that date

  • date_start — Which date to start a one-time schedule. Format is "YYYY-MM-DD" (year, month, day). This setting applies if type is 1.

  • date_end — Which date to stop a one-time schedule. Format is "YYYY-MM-DD". This setting applies if type or is 1.

  • time_start — Which time to begin the schedule. Format is "HH-MM" (hour, minute) according to a 24-hour clock. This setting applies if start_time_type is 0.

  • time_end — Which time to stop the schedule. Format is "HH-MM". This setting applies if end_time_type is 0.

  • sunrise_offset — .Minutes of offset from the sunrise time . This setting applies if start_time_type or end_time_type is 1.

  • sunset_offset — Minutes of offset from the sunset time. This setting applies if start_time_type or end_time_type is 2.

Example: Change schedule time range to all day

curl -X PUT -H "Content-Type: application/json" -d "{\"all_day\":true}" -b cookie.txt https://HOST_OR_IP/api/v1/ScheduleObject/SCHEDULE_NAME

After you configure the schedule, you can use it in another part of the configuration. See CameraProfile.

Tooltip

On Microsoft Windows with Command Prompt, inside the JSON data, you must put a backslash before each double straight quote ( \" ). For example (highlighted in bold):

-d "{\"all_day\":true}"

Alternatively, you can input a JSON stream from another command.

If you do not, the command line may interpret each JSON attribute as CLI commands or arguments, resulting in various error messages depending on the sequential order of arguments and attributes.

Reserved characters and escape sequences vary by operating system and command line environment; Linux and Mac terminals often do not require this, and Microsoft PowerShell uses different escape sequences.