Schedule the agent

This API can schedule an agent to run on particular time, frequency or recurring.

Code

var config = {"cron_expression":"0 0 9 1/1 * ? *","schedule_type":"Daily"};

$http.post("https://api.agenty.com/2.0/agents/{AgentId}/schedule?key={ApiKey}", config)
            .success(function (response) {
               console.log(response)
            }).error(function (response) {
               console.log(response) 
            });

Note : The schedule frequency cannot be less then 15 minutes, so be sure to use the CRON expression with 15 minute interval for 2nd next schedule.

The schedule API required the CRON expression to create a schedule successfully. Here are some example of CRON expressions with their meanings, or you can generate your own by logging in your Agenty account.

CRON Expression Meaning
0 0/15 * 1/1 * ? * Run every 15 minutes
0 50 8 1/1 * ? * At 08:50 AM, every day
0 0 0/1 1/1 * ? * Every hour, every day
0 30 5 1/1 * ?  At 05:30 AM, every day
0 5 11 ? * MON-FRI * At 11:05 AM, Monday through Friday
0 15 10 ? * MON,THU,SAT * At 10:15 AM, only on Monday, Thursday, and Saturday
0 0 20 ? 1/1 MON#1 *

At 08:00 PM, on the first Monday of every month

0 0 20 5 1/1 ? * At 08:00 PM, on day 5 of every month

Note : By default all scheduled jobs on Agenty are executed on (UTC)Coordinated Universal Time, you may use the timezone conversion feature in Agenty if you are using the cloud.agenty.com portal.