Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /customers/{customerId}/test-schedule | ||
---|---|---|---|
POST | /endpoints/{endpointId}/test-schedule |
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Voice.Api.Customers;
using Voice.Api.Scheduling;
using Voice.Api.Flows.Data;
namespace Voice.Api.Customers
{
///<summary>
///Test the customer's schedule
///</summary>
[Api(Description="Test the customer's schedule")]
public partial class TestSchedule
{
///<summary>
///The ID of the customer whose schedule you want to test
///</summary>
[ApiMember(Description="The ID of the customer whose schedule you want to test")]
public virtual string CustomerId { get; set; }
///<summary>
///The ID of the endpoint whose schedule you want to test.
///</summary>
[ApiMember(Description="The ID of the endpoint whose schedule you want to test.")]
public virtual string EndpointId { get; set; }
///<summary>
///The schedule to use (leave null to use the current saved schedule)
///</summary>
[ApiMember(Description="The schedule to use (leave null to use the current saved schedule)")]
public virtual Schedule Schedule { get; set; }
///<summary>
///The ISO string of the date and time you want to test
///</summary>
[ApiMember(Description="The ISO string of the date and time you want to test")]
public virtual string DateTime { get; set; }
}
public partial class TestScheduleResponse
{
public virtual string StateName { get; set; }
public virtual string TimeZoneId { get; set; }
}
}
namespace Voice.Api.Flows.Data
{
public partial class Struct
: Dictionary<string, Value>
{
}
public partial class Value
{
public virtual bool? BoolValue { get; set; }
public virtual string StringValue { get; set; }
public virtual double? NumberValue { get; set; }
public virtual List<Struct> ListValue { get; set; }
public virtual Struct StructValue { get; set; }
}
}
namespace Voice.Api.Scheduling
{
public partial class Schedule
{
public virtual string TimeZoneId { get; set; }
public virtual bool Inherit { get; set; }
public virtual bool ForceClosed { get; set; }
public virtual List<SchedulingRule> Rules { get; set; }
public virtual string DefaultState { get; set; }
}
public partial class ScheduleDay
{
public virtual int Offset { get; set; }
public virtual DayOfWeek DayOfWeek { get; set; }
}
public partial class SchedulingRule
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
public virtual int Priority { get; set; }
public virtual string State { get; set; }
public virtual string Source { get; set; }
public virtual string Condition { get; set; }
public virtual SimpleSchedulingRuleTypes SimpleRuleType { get; set; }
public virtual string CustomerState { get; set; }
public virtual string FlowId { get; set; }
public virtual Struct FlowParams { get; set; }
public virtual bool IsAllDay { get; set; }
public virtual string StartDate { get; set; }
public virtual string StartTime { get; set; }
public virtual string EndTime { get; set; }
public virtual List<int> BySetPosition { get; set; }
public virtual List<int> ByMonth { get; set; }
public virtual List<int> ByWeekNo { get; set; }
public virtual List<int> ByYearDay { get; set; }
public virtual List<int> ByMonthDay { get; set; }
public virtual List<ScheduleDay> ByDay { get; set; }
public virtual List<int> ByHour { get; set; }
public virtual List<int> ByMinute { get; set; }
public virtual int Interval { get; set; }
public virtual int Count { get; set; }
public virtual string UntilDate { get; set; }
public virtual SchedulingRuleFrequency Frequency { get; set; }
}
public enum SchedulingRuleFrequency
{
None,
Secondly,
Minutely,
Hourly,
Daily,
Weekly,
Monthly,
Yearly,
}
public enum SimpleSchedulingRuleTypes
{
Always,
CustomerState,
Time,
}
}
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>