Evo Voice

<back to all web services

NewCustomer

Creates a new customer

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
POST/customers
namespace Voice.Api

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type EntityInfo() = 
        ///<summary>
        ///The ID of the object
        ///</summary>
        [<ApiMember(Description="The ID of the object")>]
        member val Id:String = null with get,set

        ///<summary>
        ///The date the object was created
        ///</summary>
        [<ApiMember(Description="The date the object was created")>]
        member val DateCreated:String = null with get,set

        ///<summary>
        ///The date the object was last modified
        ///</summary>
        [<ApiMember(Description="The date the object was last modified")>]
        member val DateLastModified:String = null with get,set

        ///<summary>
        ///The user that created this object
        ///</summary>
        [<ApiMember(Description="The user that created this object")>]
        member val CreatedBy:String = null with get,set

        ///<summary>
        ///The user that last modified this object
        ///</summary>
        [<ApiMember(Description="The user that last modified this object")>]
        member val LastModifiedBy:String = null with get,set

    [<AllowNullLiteral>]
    type CustomerBreadcrumb() = 
        member val Id:String = null with get,set
        member val Name:String = null with get,set

    [<AllowNullLiteral>]
    type Value() = 
        member val BoolValue:Nullable<Boolean> = new Nullable<Boolean>() with get,set
        member val StringValue:String = null with get,set
        member val NumberValue:Nullable<Double> = new Nullable<Double>() with get,set
        member val ListValue:ResizeArray<Struct> = new ResizeArray<Struct>() with get,set
        member val StructValue:Struct = null with get,set

    [<AllowNullLiteral>]
    type Struct() = 
        inherit Dictionary<String, Value>()

    type TagColors =
        | Magenta = 0
        | Red = 1
        | Volcano = 2
        | Orange = 3
        | Gold = 4
        | Lime = 5
        | Green = 6
        | Cyan = 7
        | Blue = 8
        | GeekBlue = 9
        | Purple = 10

    [<AllowNullLiteral>]
    type Tag() = 
        member val Id:String = null with get,set
        member val Name:String = null with get,set
        member val Color:TagColors = new TagColors() with get,set

    type SimpleSchedulingRuleTypes =
        | Always = 0
        | CustomerState = 1
        | Time = 2

    [<AllowNullLiteral>]
    type ScheduleDay() = 
        member val Offset:Int32 = new Int32() with get,set
        member val DayOfWeek:DayOfWeek = new DayOfWeek() with get,set

    type SchedulingRuleFrequency =
        | None = 0
        | Secondly = 1
        | Minutely = 2
        | Hourly = 3
        | Daily = 4
        | Weekly = 5
        | Monthly = 6
        | Yearly = 7

    [<AllowNullLiteral>]
    type SchedulingRule() = 
        member val Id:String = null with get,set
        member val Name:String = null with get,set
        member val Priority:Int32 = new Int32() with get,set
        member val State:String = null with get,set
        member val Source:String = null with get,set
        member val Condition:String = null with get,set
        member val SimpleRuleType:SimpleSchedulingRuleTypes = new SimpleSchedulingRuleTypes() with get,set
        member val CustomerState:String = null with get,set
        member val FlowId:String = null with get,set
        member val FlowParams:Struct = null with get,set
        member val IsAllDay:Boolean = new Boolean() with get,set
        member val StartDate:String = null with get,set
        member val StartTime:String = null with get,set
        member val EndTime:String = null with get,set
        member val BySetPosition:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByMonth:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByWeekNo:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByYearDay:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByMonthDay:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByDay:ResizeArray<ScheduleDay> = new ResizeArray<ScheduleDay>() with get,set
        member val ByHour:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByMinute:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val Interval:Int32 = new Int32() with get,set
        member val Count:Int32 = new Int32() with get,set
        member val UntilDate:String = null with get,set
        member val Frequency:SchedulingRuleFrequency = new SchedulingRuleFrequency() with get,set

    [<AllowNullLiteral>]
    type Schedule() = 
        member val TimeZoneId:String = null with get,set
        member val Inherit:Boolean = new Boolean() with get,set
        member val ForceClosed:Boolean = new Boolean() with get,set
        member val Rules:ResizeArray<SchedulingRule> = new ResizeArray<SchedulingRule>() with get,set
        member val DefaultState:String = null with get,set

    [<AllowNullLiteral>]
    type IntegrationData() = 
        member val ThirdPartyId:String = null with get,set

    [<AllowNullLiteral>]
    type EntityIntegrationData() = 
        inherit Dictionary<String, IntegrationData>()

    [<AllowNullLiteral>]
    type BillingItem() = 
        member val BaseCost:Double = new Double() with get,set
        member val RawUnitMultiplier:Double = new Double() with get,set
        member val UnitCost:Double = new Double() with get,set
        member val Allowance:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type BillingSettings() = 
        member val Base:BillingItem = null with get,set
        member val LocalNumbers:BillingItem = null with get,set
        member val TollFreeNumbers:BillingItem = null with get,set
        member val InboundVoiceCalls:BillingItem = null with get,set
        member val OutboundVoiceCalls:BillingItem = null with get,set
        member val InboundFaxes:BillingItem = null with get,set
        member val OutboundFaxes:BillingItem = null with get,set
        member val InboundSmsMessages:BillingItem = null with get,set
        member val OutboundSmsMessages:BillingItem = null with get,set

    [<AllowNullLiteral>]
    type AppSettings() = 
        member val EnablePhoneNumberManagement:Boolean = new Boolean() with get,set
        member val EnableDeviceManagement:Boolean = new Boolean() with get,set
        member val EnableDialer:Boolean = new Boolean() with get,set
        member val EnableCallHistory:Boolean = new Boolean() with get,set
        member val ShowFileNameInMessageCenter:Boolean = new Boolean() with get,set
        member val ChakraTheme:String = null with get,set
        member val CustomCss:String = null with get,set
        member val PageTitle:String = null with get,set
        member val StringMappings:String = null with get,set
        member val LogoutUrl:String = null with get,set
        member val PortMyNumberUrl:String = null with get,set

    [<AllowNullLiteral>]
    type CustomerInfo() = 
        inherit EntityInfo()
        ///<summary>
        ///The ID of the account associated with this customer
        ///</summary>
        [<ApiMember(Description="The ID of the account associated with this customer")>]
        member val AccountId:String = null with get,set

        ///<summary>
        ///The parent customer ID for this customer
        ///</summary>
        [<ApiMember(Description="The parent customer ID for this customer")>]
        member val ParentCustomerId:String = null with get,set

        ///<summary>
        ///The breadcrumb to this customer
        ///</summary>
        [<ApiMember(Description="The breadcrumb to this customer")>]
        member val Breadcrumb:ResizeArray<CustomerBreadcrumb> = new ResizeArray<CustomerBreadcrumb>() with get,set

        ///<summary>
        ///The name of the account associated with this customer
        ///</summary>
        [<ApiMember(Description="The name of the account associated with this customer")>]
        member val AccountName:String = null with get,set

        ///<summary>
        ///Is this customer staging or production?
        ///</summary>
        [<ApiMember(Description="Is this customer staging or production?")>]
        member val IsStaging:Boolean = new Boolean() with get,set

        ///<summary>
        ///The name of the company
        ///</summary>
        [<ApiMember(Description="The name of the company")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The reference ID for this company
        ///</summary>
        [<ApiMember(Description="The reference ID for this company")>]
        member val ReferenceId:String = null with get,set

        ///<summary>
        ///This customer's data values
        ///</summary>
        [<ApiMember(Description="This customer's data values")>]
        member val Data:Struct = null with get,set

        ///<summary>
        ///The list of tags for this customer
        ///</summary>
        [<ApiMember(Description="The list of tags for this customer")>]
        member val Tags:ResizeArray<Tag> = new ResizeArray<Tag>() with get,set

        ///<summary>
        ///This customer's schedule
        ///</summary>
        [<ApiMember(Description="This customer's schedule")>]
        member val Schedule:Schedule = null with get,set

        ///<summary>
        ///Integration data for this customer
        ///</summary>
        [<ApiMember(Description="Integration data for this customer")>]
        member val IntegrationData:EntityIntegrationData = null with 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")>]
        member val OverrideBillingSettings:Boolean = new Boolean() with get,set

        ///<summary>
        ///Billing settings for this customer
        ///</summary>
        [<ApiMember(Description="Billing settings for this customer")>]
        member val BillingSettings:BillingSettings = null with 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")>]
        member val OverrideAppSettings:Boolean = new Boolean() with get,set

        ///<summary>
        ///App / Portal settings for this customer
        ///</summary>
        [<ApiMember(Description="App / Portal settings for this customer")>]
        member val AppSettings:AppSettings = null with get,set

    ///<summary>
    ///Creates a new customer
    ///</summary>
    [<Api(Description="Creates a new customer")>]
    [<AllowNullLiteral>]
    type NewCustomer() = 
        interface IPost
        ///<summary>
        ///The account ID to associate this customer with
        ///</summary>
        [<ApiMember(Description="The account ID to associate this customer with")>]
        member val AccountId:String = null with get,set

        ///<summary>
        ///The name of the customer
        ///</summary>
        [<ApiMember(Description="The name of the customer")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The parent customer for this customer
        ///</summary>
        [<ApiMember(Description="The parent customer for this customer")>]
        member val ParentCustomerId:String = null with 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)")>]
        member val ReferenceId:String = null with get,set

        ///<summary>
        ///Data values for this customer
        ///</summary>
        [<ApiMember(Description="Data values for this customer")>]
        member val Data:Struct = null with get,set

F# NewCustomer DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /customers HTTP/1.1 
Host: evovoice.io 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"accountId":"String","name":"String","parentCustomerId":"String","referenceId":"String","data":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}}}}}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"accountId":"String","parentCustomerId":"String","breadcrumb":[{"id":"String","name":"String"}],"accountName":"String","isStaging":false,"name":"String","referenceId":"String","data":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}}}}},"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","flowParams":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}],"structValue":{"String":{"boolValue":false,"stringValue":"String","numberValue":0,"listValue":[null]}}}}}},"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}},"overrideAppSettings":false,"appSettings":{"enablePhoneNumberManagement":false,"enableDeviceManagement":false,"enableDialer":false,"enableCallHistory":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"}