Loading...

POST   https://api.3seventy.com/api/v2.1/account/{accountId}/action/{actionId}/schedule

Description

Creates the new schedule on the action

Path Parameters

accountId integer The account which holds the action and the schedule required
actionId integer The action to set schedule to required

Request Properties application/json

ScheduleTypeId integer Schedule Type Id: Daily, Weekly, Monthly. required
RunAt string Time of day to start run at. The schedule will run once a scheduled period (daily, weekly, monthly) at a given time. required
StartFrom string Date and time from which schedule will start. required
EndAfter string Date and time after which schedule will stop. optional
WeekDay string Day(s) of week to run action on. [REQUIRED FOR WEEKLY SCHEDULE TYPE] optional
MonthDay string Day(s) of month to run action on. [REQUIRED FOR MONTHLY SCHEDULE TYPE] optional


                    

Response Properties application/json

Id integer Unique schedule ID.
Created string When this schedule was first created.
Modified string When this schedule was last modified.
CreatedBy string Who initially created this schedule.
ModifiedBy string Who last modified this schedule.
AccountId integer Account this schedule belongs to.
ActionId integer Action id this schedule belongs to.
ScheduleTypeId number Schedule Type Id: Daily, Weekly, Monthly.
RunAt string Time of day to start run at. The schedule will run once a scheduled period (daily, weekly, monthly) at a given time.
StartFrom string Date and time from which schedule will start.
EndAfter string Date and time after which schedule will stop.
WeekDay string Day(s) of week to run action on. [REQUIRED FOR WEEKLY SCHEDULE TYPE]
MonthDay string Day(s) of month to run action on. [REQUIRED FOR MONTHLY SCHEDULE TYPE]
Logs array[object] Log records associated with this run


                    

C#


using System;
using System.Collections.Generic;
using System.Linq;
using ThreeSeventy.Vector.Client;
using ThreeSeventy.Vector.Client.Enums;
using ThreeSeventy.Vector.Client.Models;

public class Program
{

private static void Main(string[] args)
{

const int accountId = XXXX;

const int actionId = XXXXX;

var context = new T70Context();

var actionPushRepo = context.Repository<ActionSchedule>(new { AccountId = accountId, ActionId = actionId });

var item = new ActionSchedule()

{
AccountId = accountId,

ActionId = actionId,

RunAt = "12:20:00",

ScheduleType = ScheduleType.OneTime,

StartFrom = DateTime.Now

};

actionPushRepo.Add(item);

}

}