Agent.SetSchedule
  • 14 May 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Agent.SetSchedule

  • Dark
    Light
  • PDF

Article summary

Description

Updates or creates a new schedule for the specified agent.

URL parameters

URL parameter ordering

The URL parameters below are listed in the order they should be entered in the API URL.

NameRequiredTypeDescription
AgentIDTruenumericUnique identifier of the agent.
FrequencyTruestringNone, Once, Interval, Daily, EveryWeekday, Weekly, or Monthly

Once

Frequency = Once

NameRequiredTypeDescription
StartsTruedatetimeyyyy-MM-dd hh:mm:ss

Interval

Frequency = Interval

NameRequiredTypeDescription
StartsTruedatetimeyyyy-MM-dd hh:mm:ss
RepeatIntervalTruenumericThe interval to repeat the schedule at expressed as number of minutes. Must be one of the following: 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440.
EndsFalsedateLeave blank for never. yyyy-MM-dd

Daily

Frequency = Daily

NameRequiredTypeDescription
StartsTruedatetimeyyyy-MM-dd hh:mm:ss
RepeatEveryTruenumericRepeat every _ day. How often do you want to repeat?
RepeatIntervalFalsenumericLeave blank for none. The interval to repeat the schedule at expressed as number of minutes. Must be one of the following: 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440.
RepeatIntervalHourFalsenumericNumber of hours the RepeatInterval will continue for. Number between 1 and 24 and has to be a multiple of RepeatInterval.
EndsFalsedateLeave blank for never. yyyy-MM-dd

EveryWeekday

Frequency = EveryWeekday

NameRequiredTypeDescription
StartsTruedatetimeyyyy-MM-dd hh:mm:ss
RepeatEveryTruenumericRepeat every _ week. How often do you want to repeat?
RepeatIntervalFalsenumericLeave blank for none. The interval to repeat the schedule at expressed as number of minutes. Must be one of the following: 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440.
RepeatIntervalHourFalsenumericNumber of hours the RepeatInterval will continue for. Number between 1 and 24 and has to be a multiple of RepeatInterval.
EndsFalsedateLeave blank for never. yyyy-MM-dd

Weekly

Frequency = Weekly

NameRequiredTypeDescription
StartsTruedatetimeyyyy-MM-dd hh:mm:ss
RepeatEveryTruenumericRepeat every _ day. How often do you want to repeat?
RunOnTruestringComma delimited list of which weekdays for the schedule to run on. (Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday)
RepeatIntervalFalsenumericLeave blank for none. The interval to repeat the schedule at expressed as number of minutes. Must be one of the following: 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440.
RepeatIntervalHourFalsenumericNumber of hours the RepeatInterval will continue for. Number between 1 and 24 and has to be a multiple of RepeatInterval.
EndsFalsedateLeave blank for never. yyyy-MM-dd

Monthly

Frequency = Monthly

NameRequiredTypeDescription
StartsTruedatetimeyyyy-MM-dd hh:mm:ss
RepeatEveryTruenumericRepeat every _ day. How often do you want to repeat?
RepeatByTruestringSpecify either DayOfWeek or DayOfMonth
RepeatIntervalFalsenumericLeave blank for none. The interval to repeat the schedule at expressed as number of minutes. Must be one of the following: 15, 20, 30, 60, 120, 180, 240, 360, 720, 1440.
RepeatIntervalHourFalsenumericNumber of hours the RepeatInterval will continue for. Number between 1 and 24 and has to be a multiple of RepeatInterval.
EndsFalsedateLeave blank for never. yyyy-MM-dd

Returns

NameTypeDescription
ResultstringSuccess if the operation was successful.

Sample request

curl -X GET 'https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=Agent.SetSchedule&AgentID=1099&Frequency=Weekly&Starts=2020-07-28 12:00:00&RepeatEvery=2&RunOn=Sat,Sun'

Sample responses

XML

<?xml version="1.0" encoding="utf-8" ?>
<SetPublisherResponse
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
</SetPublisherResponse>

JSON (add &ResponseFormat=JSON)

{
    "JsonResult": {
        "Command": "Agent.SetSchedule",
        "AutoLoggedIn": false,
        "WebConsoleKey": "",
        "Result": "Success",
        "ErrorCode": "",
        "ErrorDescription": "",
        "ErrorList": [],
        "ExecutionTime": {
            "Ticks": 0,
            "Days": 0,
            "Hours": 0,
            "Milliseconds": 0,
            "Minutes": 0,
            "Seconds": 0,
            "TotalDays": 0,
            "TotalHours": 0,
            "TotalMilliseconds": 0,
            "TotalMinutes": 0,
            "TotalSeconds": 0
        }
    }
}

Was this article helpful?