Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /customers/{customerId}/test-schedule | ||
---|---|---|---|
POST | /endpoints/{endpointId}/test-schedule |
"use strict";
/** @typedef {'Always'|'CustomerState'|'Time'} */
export var SimpleSchedulingRuleTypes;
(function (SimpleSchedulingRuleTypes) {
SimpleSchedulingRuleTypes["Always"] = "Always"
SimpleSchedulingRuleTypes["CustomerState"] = "CustomerState"
SimpleSchedulingRuleTypes["Time"] = "Time"
})(SimpleSchedulingRuleTypes || (SimpleSchedulingRuleTypes = {}));
export class Value {
/** @param {{boolValue?:boolean,stringValue?:string,numberValue?:number,listValue?:Struct[],structValue?:Struct}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?boolean} */
boolValue;
/** @type {string} */
stringValue;
/** @type {?number} */
numberValue;
/** @type {Struct[]} */
listValue;
/** @type {Struct} */
structValue;
}
class Dictionary {}
export class Struct extends Dictionary {
constructor(init) { super(init); Object.assign(this, init) }
}
export class ScheduleDay {
/** @param {{offset?:number,dayOfWeek?:DayOfWeek}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
offset;
/** @type {DayOfWeek} */
dayOfWeek;
}
/** @typedef {'None'|'Secondly'|'Minutely'|'Hourly'|'Daily'|'Weekly'|'Monthly'|'Yearly'} */
export var SchedulingRuleFrequency;
(function (SchedulingRuleFrequency) {
SchedulingRuleFrequency["None"] = "None"
SchedulingRuleFrequency["Secondly"] = "Secondly"
SchedulingRuleFrequency["Minutely"] = "Minutely"
SchedulingRuleFrequency["Hourly"] = "Hourly"
SchedulingRuleFrequency["Daily"] = "Daily"
SchedulingRuleFrequency["Weekly"] = "Weekly"
SchedulingRuleFrequency["Monthly"] = "Monthly"
SchedulingRuleFrequency["Yearly"] = "Yearly"
})(SchedulingRuleFrequency || (SchedulingRuleFrequency = {}));
export class SchedulingRule {
/** @param {{id?:string,name?:string,priority?:number,state?:string,source?:string,condition?:string,simpleRuleType?:SimpleSchedulingRuleTypes,customerState?:string,flowId?:string,flowParams?:Struct,isAllDay?:boolean,startDate?:string,startTime?:string,endTime?:string,bySetPosition?:number[],byMonth?:number[],byWeekNo?:number[],byYearDay?:number[],byMonthDay?:number[],byDay?:ScheduleDay[],byHour?:number[],byMinute?:number[],interval?:number,count?:number,untilDate?:string,frequency?:SchedulingRuleFrequency}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
id;
/** @type {string} */
name;
/** @type {number} */
priority;
/** @type {string} */
state;
/** @type {string} */
source;
/** @type {string} */
condition;
/** @type {SimpleSchedulingRuleTypes} */
simpleRuleType;
/** @type {string} */
customerState;
/** @type {string} */
flowId;
/** @type {Struct} */
flowParams;
/** @type {boolean} */
isAllDay;
/** @type {string} */
startDate;
/** @type {string} */
startTime;
/** @type {string} */
endTime;
/** @type {number[]} */
bySetPosition;
/** @type {number[]} */
byMonth;
/** @type {number[]} */
byWeekNo;
/** @type {number[]} */
byYearDay;
/** @type {number[]} */
byMonthDay;
/** @type {ScheduleDay[]} */
byDay;
/** @type {number[]} */
byHour;
/** @type {number[]} */
byMinute;
/** @type {number} */
interval;
/** @type {number} */
count;
/** @type {string} */
untilDate;
/** @type {SchedulingRuleFrequency} */
frequency;
}
export class Schedule {
/** @param {{timeZoneId?:string,inherit?:boolean,forceClosed?:boolean,rules?:SchedulingRule[],defaultState?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
timeZoneId;
/** @type {boolean} */
inherit;
/** @type {boolean} */
forceClosed;
/** @type {SchedulingRule[]} */
rules;
/** @type {string} */
defaultState;
}
export class TestSchedule {
/** @param {{customerId?:string,endpointId?:string,schedule?:Schedule,dateTime?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description The ID of the customer whose schedule you want to test */
customerId;
/**
* @type {string}
* @description The ID of the endpoint whose schedule you want to test. */
endpointId;
/**
* @type {Schedule}
* @description The schedule to use (leave null to use the current saved schedule) */
schedule;
/**
* @type {string}
* @description The ISO string of the date and time you want to test */
dateTime;
}
export class TestScheduleResponse {
/** @param {{stateName?:string,timeZoneId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
stateName;
/** @type {string} */
timeZoneId;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /customers/{customerId}/test-schedule HTTP/1.1
Host: team.evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<TestSchedule xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Customers">
<CustomerId>String</CustomerId>
<DateTime>String</DateTime>
<EndpointId>String</EndpointId>
<Schedule xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Scheduling">
<d2p1:DefaultState>String</d2p1:DefaultState>
<d2p1:ForceClosed>false</d2p1:ForceClosed>
<d2p1:Inherit>false</d2p1:Inherit>
<d2p1:Rules>
<d2p1:SchedulingRule>
<d2p1:ByDay>
<d2p1:ScheduleDay>
<d2p1:DayOfWeek>Sunday</d2p1:DayOfWeek>
<d2p1:Offset>0</d2p1:Offset>
</d2p1:ScheduleDay>
</d2p1:ByDay>
<d2p1:ByHour xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:ByHour>
<d2p1:ByMinute xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:ByMinute>
<d2p1:ByMonth xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:ByMonth>
<d2p1:ByMonthDay xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:ByMonthDay>
<d2p1:BySetPosition xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:BySetPosition>
<d2p1:ByWeekNo xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:ByWeekNo>
<d2p1:ByYearDay xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:int>0</d5p1:int>
</d2p1:ByYearDay>
<d2p1:Condition>String</d2p1:Condition>
<d2p1:Count>0</d2p1:Count>
<d2p1:CustomerState>String</d2p1:CustomerState>
<d2p1:EndTime>String</d2p1:EndTime>
<d2p1:FlowId>String</d2p1:FlowId>
<d2p1:FlowParams xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" />
<d2p1:Frequency>None</d2p1:Frequency>
<d2p1:Id>String</d2p1:Id>
<d2p1:Interval>0</d2p1:Interval>
<d2p1:IsAllDay>false</d2p1:IsAllDay>
<d2p1:Name>String</d2p1:Name>
<d2p1:Priority>0</d2p1:Priority>
<d2p1:SimpleRuleType>Always</d2p1:SimpleRuleType>
<d2p1:Source>String</d2p1:Source>
<d2p1:StartDate>String</d2p1:StartDate>
<d2p1:StartTime>String</d2p1:StartTime>
<d2p1:State>String</d2p1:State>
<d2p1:UntilDate>String</d2p1:UntilDate>
</d2p1:SchedulingRule>
</d2p1:Rules>
<d2p1:TimeZoneId>String</d2p1:TimeZoneId>
</Schedule>
</TestSchedule>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <TestScheduleResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Customers"> <StateName>String</StateName> <TimeZoneId>String</TimeZoneId> </TestScheduleResponse>