| Required role: | SystemAdministrator |
| POST | /accounts |
|---|
namespace Voice.Api
open System
open System.IO
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 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
member val AIInsights:BillingItem = null with get,set
member val AILiveMinutes:BillingItem = null with get,set
member val AIMessages:BillingItem = null with get,set
[<AllowNullLiteral>]
type AccountInfo() =
inherit EntityInfo()
///<summary>
///The name of this account
///</summary>
[<ApiMember(Description="The name of this account")>]
member val Name:String = null with get,set
///<summary>
///The ID of this account's parent
///</summary>
[<ApiMember(Description="The ID of this account's parent")>]
member val ParentAccountId:String = null with get,set
///<summary>
///The twilio account SID
///</summary>
[<ApiMember(Description="The twilio account SID")>]
member val TwilioAccountSid:String = null with get,set
///<summary>
///The ancestors of this account. Useful for breadcrumbs
///</summary>
[<ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")>]
member val AncestorIds:ResizeArray<String> = null with get,set
///<summary>
///The max number of phone numbers this account can have
///</summary>
[<ApiMember(Description="The max number of phone numbers this account can have")>]
member val MaxPhoneNumbers:Int32 = new Int32() with get,set
///<summary>
///This account is BYOA
///</summary>
[<ApiMember(Description="This account is BYOA")>]
member val IsBYOA:Boolean = new Boolean() with get,set
///<summary>
///TrustHub Profile Sid
///</summary>
[<ApiMember(Description="TrustHub Profile Sid")>]
member val TrustHubProfileSid:String = null with get,set
///<summary>
///The ID of the logo file
///</summary>
[<ApiMember(Description="The ID of the logo file")>]
member val LogoId:String = null with get,set
///<summary>
///The URI of the logo file
///</summary>
[<ApiMember(Description="The URI of the logo file")>]
member val LogoUri:String = null with get,set
///<summary>
///The billing settings for this account
///</summary>
[<ApiMember(Description="The billing settings for this account")>]
member val BillingSettings:BillingSettings = null with get,set
///<summary>
///Creates a new account
///</summary>
[<Api(Description="Creates a new account")>]
[<AllowNullLiteral>]
type NewAccount() =
interface IPost
///<summary>
///The name of the new account
///</summary>
[<ApiMember(Description="The name of the new account")>]
member val Name:String = null with get,set
///<summary>
///The Twilio Account SID (for BYOA)
///</summary>
[<ApiMember(Description="The Twilio Account SID (for BYOA)")>]
member val TwilioAccountSid:String = null with get,set
///<summary>
///The Twilio Auth Token (for BYOA)
///</summary>
[<ApiMember(Description="The Twilio Auth Token (for BYOA)")>]
member val TwilioAuthToken:String = null with get,set
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 /accounts HTTP/1.1
Host: evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<NewAccount xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Accounts">
<Name>String</Name>
<TwilioAccountSid>String</TwilioAccountSid>
<TwilioAuthToken>String</TwilioAuthToken>
</NewAccount>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<AccountInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Accounts">
<CreatedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</CreatedBy>
<DateCreated xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateCreated>
<DateLastModified xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateLastModified>
<Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</Id>
<LastModifiedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</LastModifiedBy>
<AncestorIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</AncestorIds>
<BillingSettings>
<AIInsights>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</AIInsights>
<AILiveMinutes>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</AILiveMinutes>
<AIMessages>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</AIMessages>
<Base>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</Base>
<InboundFaxes>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</InboundFaxes>
<InboundSmsMessages>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</InboundSmsMessages>
<InboundVoiceCalls>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</InboundVoiceCalls>
<LocalNumbers>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</LocalNumbers>
<OutboundFaxes>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</OutboundFaxes>
<OutboundSmsMessages>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</OutboundSmsMessages>
<OutboundVoiceCalls>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</OutboundVoiceCalls>
<TollFreeNumbers>
<Allowance>0</Allowance>
<BaseCost>0</BaseCost>
<RawUnitMultiplier>0</RawUnitMultiplier>
<UnitCost>0</UnitCost>
</TollFreeNumbers>
</BillingSettings>
<IsBYOA>false</IsBYOA>
<LogoId>String</LogoId>
<LogoUri>String</LogoUri>
<MaxPhoneNumbers>0</MaxPhoneNumbers>
<Name>String</Name>
<ParentAccountId>String</ParentAccountId>
<TrustHubProfileSid>String</TrustHubProfileSid>
<TwilioAccountSid>String</TwilioAccountSid>
</AccountInfo>