Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /customers |
---|
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.Flows.Data;
using Voice.Api;
using Voice.Api.Settings;
using Voice.Api.Scheduling;
using Voice.Api.Integrations;
using Voice.Api.Accounts;
namespace Voice.Api
{
public partial class EntityInfo
{
///<summary>
///The ID of the object
///</summary>
[ApiMember(Description="The ID of the object")]
public virtual string Id { get; set; }
///<summary>
///The date the object was created
///</summary>
[ApiMember(Description="The date the object was created")]
public virtual string DateCreated { get; set; }
///<summary>
///The date the object was last modified
///</summary>
[ApiMember(Description="The date the object was last modified")]
public virtual string DateLastModified { get; set; }
///<summary>
///The user that created this object
///</summary>
[ApiMember(Description="The user that created this object")]
public virtual string CreatedBy { get; set; }
///<summary>
///The user that last modified this object
///</summary>
[ApiMember(Description="The user that last modified this object")]
public virtual string LastModifiedBy { get; set; }
}
}
namespace Voice.Api.Accounts
{
public partial class BillingItem
{
public virtual double BaseCost { get; set; }
public virtual double RawUnitMultiplier { get; set; }
public virtual double UnitCost { get; set; }
public virtual int Allowance { get; set; }
}
public partial class BillingSettings
{
public virtual BillingItem Base { get; set; }
public virtual BillingItem LocalNumbers { get; set; }
public virtual BillingItem TollFreeNumbers { get; set; }
public virtual BillingItem InboundVoiceCalls { get; set; }
public virtual BillingItem OutboundVoiceCalls { get; set; }
public virtual BillingItem InboundFaxes { get; set; }
public virtual BillingItem OutboundFaxes { get; set; }
public virtual BillingItem InboundSmsMessages { get; set; }
public virtual BillingItem OutboundSmsMessages { get; set; }
public virtual BillingItem AIInsights { get; set; }
public virtual BillingItem AILiveMinutes { get; set; }
}
}
namespace Voice.Api.Customers
{
public partial class AppSettings
{
public virtual bool EnablePhoneNumberManagement { get; set; }
public virtual bool EnableDeviceManagement { get; set; }
public virtual bool EnableDialer { get; set; }
public virtual bool EnableCallHistory { get; set; }
public virtual bool EnableAssistants { get; set; }
public virtual bool ShowFileNameInMessageCenter { get; set; }
public virtual string ChakraTheme { get; set; }
public virtual string CustomCss { get; set; }
public virtual string PageTitle { get; set; }
public virtual string StringMappings { get; set; }
public virtual string LogoutUrl { get; set; }
public virtual string PortMyNumberUrl { get; set; }
}
public partial class CustomerBreadcrumb
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
}
public partial class CustomerInfo
: EntityInfo
{
///<summary>
///The ID of the account associated with this customer
///</summary>
[ApiMember(Description="The ID of the account associated with this customer")]
public virtual string AccountId { get; set; }
///<summary>
///The parent customer ID for this customer
///</summary>
[ApiMember(Description="The parent customer ID for this customer")]
public virtual string ParentCustomerId { get; set; }
///<summary>
///The breadcrumb to this customer
///</summary>
[ApiMember(Description="The breadcrumb to this customer")]
public virtual List<CustomerBreadcrumb> Breadcrumb { get; set; }
///<summary>
///The name of the account associated with this customer
///</summary>
[ApiMember(Description="The name of the account associated with this customer")]
public virtual string AccountName { get; set; }
///<summary>
///Is this customer staging or production?
///</summary>
[ApiMember(Description="Is this customer staging or production?")]
public virtual bool IsStaging { get; set; }
///<summary>
///The name of the company
///</summary>
[ApiMember(Description="The name of the company")]
public virtual string Name { get; set; }
///<summary>
///The reference ID for this company
///</summary>
[ApiMember(Description="The reference ID for this company")]
public virtual string ReferenceId { get; set; }
///<summary>
///This customer's data values
///</summary>
[ApiMember(Description="This customer's data values")]
public virtual Struct Data { get; set; }
///<summary>
///The list of tags for this customer
///</summary>
[ApiMember(Description="The list of tags for this customer")]
public virtual List<Tag> Tags { get; set; }
///<summary>
///This customer's schedule
///</summary>
[ApiMember(Description="This customer's schedule")]
public virtual Schedule Schedule { get; set; }
///<summary>
///Integration data for this customer
///</summary>
[ApiMember(Description="Integration data for this customer")]
public virtual EntityIntegrationData IntegrationData { get; set; }
///<summary>
///Override this customer's billing settings? Otherwise inherits from parent
///</summary>
[ApiMember(Description="Override this customer's billing settings? Otherwise inherits from parent")]
public virtual bool OverrideBillingSettings { get; set; }
///<summary>
///Billing settings for this customer
///</summary>
[ApiMember(Description="Billing settings for this customer")]
public virtual BillingSettings BillingSettings { get; set; }
///<summary>
///Should this customer override the parent customer's app settings
///</summary>
[ApiMember(Description="Should this customer override the parent customer's app settings")]
public virtual bool OverrideAppSettings { get; set; }
///<summary>
///App / Portal settings for this customer
///</summary>
[ApiMember(Description="App / Portal settings for this customer")]
public virtual AppSettings AppSettings { get; set; }
}
///<summary>
///Creates a new customer
///</summary>
[Api(Description="Creates a new customer")]
public partial class NewCustomer
: IPost
{
///<summary>
///The account ID to associate this customer with
///</summary>
[ApiMember(Description="The account ID to associate this customer with")]
public virtual string AccountId { get; set; }
///<summary>
///The name of the customer
///</summary>
[ApiMember(Description="The name of the customer")]
public virtual string Name { get; set; }
///<summary>
///The parent customer for this customer
///</summary>
[ApiMember(Description="The parent customer for this customer")]
public virtual string ParentCustomerId { get; set; }
///<summary>
///The reference ID for this customer (e.g. in a third party system)
///</summary>
[ApiMember(Description="The reference ID for this customer (e.g. in a third party system)")]
public virtual string ReferenceId { get; set; }
///<summary>
///Data values for this customer
///</summary>
[ApiMember(Description="Data values for this customer")]
public virtual Struct Data { 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.Integrations
{
public partial class EntityIntegrationData
: Dictionary<string, IntegrationData>
{
}
public partial class IntegrationData
{
public virtual string ThirdPartyId { 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,
}
}
namespace Voice.Api.Settings
{
public partial class Tag
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
public virtual TagColors Color { get; set; }
}
public enum TagColors
{
Magenta,
Red,
Volcano,
Orange,
Gold,
Lime,
Green,
Cyan,
Blue,
GeekBlue,
Purple,
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /customers HTTP/1.1
Host: team.evovoice.io
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"accountId":"String","name":"String","parentCustomerId":"String","referenceId":"String"}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"accountId":"String","parentCustomerId":"String","breadcrumb":[{"id":"String","name":"String"}],"accountName":"String","isStaging":false,"name":"String","referenceId":"String","tags":[{"id":"String","name":"String","color":"Magenta"}],"schedule":{"timeZoneId":"String","inherit":false,"forceClosed":false,"rules":[{"id":"String","name":"String","priority":0,"state":"String","source":"String","condition":"String","simpleRuleType":"Always","customerState":"String","flowId":"String","isAllDay":false,"startDate":"String","startTime":"String","endTime":"String","bySetPosition":[0],"byMonth":[0],"byWeekNo":[0],"byYearDay":[0],"byMonthDay":[0],"byDay":[{"offset":0,"dayOfWeek":"Sunday"}],"byHour":[0],"byMinute":[0],"interval":0,"count":0,"untilDate":"String","frequency":"None"}],"defaultState":"String"},"integrationData":{"String":{"thirdPartyId":"String"}},"overrideBillingSettings":false,"billingSettings":{"base":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"localNumbers":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"tollFreeNumbers":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"inboundVoiceCalls":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"outboundVoiceCalls":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"inboundFaxes":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"outboundFaxes":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"inboundSmsMessages":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"outboundSmsMessages":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"aiInsights":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"aiLiveMinutes":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0}},"overrideAppSettings":false,"appSettings":{"enablePhoneNumberManagement":false,"enableDeviceManagement":false,"enableDialer":false,"enableCallHistory":false,"enableAssistants":false,"showFileNameInMessageCenter":false,"chakraTheme":"String","customCss":"String","pageTitle":"String","stringMappings":"String","logoutUrl":"String","portMyNumberUrl":"String"},"id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}