Evo Voice

<back to all web services

GetAppConfig

Gets the config for the app including webRTC token

Requires Authentication
Required role:User
The following routes are available for this service:
GET/app/config
namespace Voice.Api.App

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

    [<AllowNullLiteral>]
    type AppUserInfo() = 
        ///<summary>
        ///The user's first name
        ///</summary>
        [<ApiMember(Description="The user's first name")>]
        member val FirstName:String = null with get,set

        ///<summary>
        ///The user's last name
        ///</summary>
        [<ApiMember(Description="The user's last name")>]
        member val LastName:String = null with get,set

        ///<summary>
        ///Shortcut to the user's full name
        ///</summary>
        [<ApiMember(Description="Shortcut to the user's full name")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The URL to the user's avatar
        ///</summary>
        [<ApiMember(Description="The URL to the user's avatar")>]
        member val AvatarUrl:String = null with get,set

    type AgentStates =
        | Unknown = 0
        | Ready = 1
        | NotReady = 2
        | LoggedOut = 3
        | WrapUp = 4
        | Outgoing = 5
        | Other = 6

    type AgentStateReasons =
        | Unknown = 0
        | SetByUser = 1
        | MissedCall = 2
        | SetBySystem = 3

    [<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

    type ThirdPartyPhoneSystemTypes =
        | Demo = 0
        | Sip = 1

    type TransportTypes =
        | UDP = 0
        | TLS = 1
        | TCP = 2
        | PERS = 3

    type AudioCodecTypes =
        | PCMU = 0
        | GSM = 3
        | PCMA = 8
        | G722 = 9
        | G729 = 18
        | ILBC = 97
        | AMR = 98
        | AMRWB = 99
        | SPEEX = 100
        | DTMF = 101
        | SPEEXWB = 102
        | ISACWB = 103
        | ISACSWB = 104
        | OPUS = 105
        | G7221 = 121
        | NONE = -1

    type DtmfMethods =
        | RFC2833 = 0
        | INFO = 1

    [<AllowNullLiteral>]
    type ThirdPartySipAccountSettings() = 
        member val Number:String = null with get,set
        member val Agent:String = null with get,set
        member val AuthName:String = null with get,set
        member val UserName:String = null with get,set
        member val DisplayName:String = null with get,set
        member val Password:String = null with get,set
        member val UserDomain:String = null with get,set
        member val RegistrationExpires:Int32 = new Int32() with get,set
        member val TransportType:TransportTypes = new TransportTypes() with get,set
        member val LocalIP:String = null with get,set
        member val LocalPort:Int32 = new Int32() with get,set
        member val SipServer:String = null with get,set
        member val SipServerPort:Int32 = new Int32() with get,set
        member val OutboundServer:String = null with get,set
        member val OutboundServerPort:Int32 = new Int32() with get,set
        member val StunServer:String = null with get,set
        member val StunPort:Int32 = new Int32() with get,set
        member val AudioPlaybackDeviceName:String = null with get,set
        member val AudioRecordingDeviceName:String = null with get,set
        member val AudioCodecs:ResizeArray<AudioCodecTypes> = new ResizeArray<AudioCodecTypes>() with get,set
        member val DTMFMethod:DtmfMethods = new DtmfMethods() with get,set

    [<AllowNullLiteral>]
    type ThirdPartySipSettings() = 
        member val Accounts:ResizeArray<ThirdPartySipAccountSettings> = new ResizeArray<ThirdPartySipAccountSettings>() with get,set

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

    [<AllowNullLiteral>]
    type ThirdPartyPhoneSystemSettings() = 
        member val Type:ThirdPartyPhoneSystemTypes = new ThirdPartyPhoneSystemTypes() with get,set
        member val SipSettings:ThirdPartySipSettings = null with get,set
        member val DemoSettings:ThirdPartyDemoSettings = null with get,set

    [<AllowNullLiteral>]
    type AppConfig() = 
        ///<summary>
        ///The ID of this endpoint
        ///</summary>
        [<ApiMember(Description="The ID of this endpoint")>]
        member val EndpointId:String = null with get,set

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

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

        ///<summary>
        ///The access token for use with Twilio Voice
        ///</summary>
        [<ApiMember(Description="The access token for use with Twilio Voice")>]
        member val AccessToken:String = null with get,set

        ///<summary>
        ///The access token's identity
        ///</summary>
        [<ApiMember(Description="The access token's identity")>]
        member val Identity:String = null with get,set

        ///<summary>
        ///The email address of the user
        ///</summary>
        [<ApiMember(Description="The email address of the user")>]
        member val EmailAddress:String = null with get,set

        ///<summary>
        ///The user's information
        ///</summary>
        [<ApiMember(Description="The user's information")>]
        member val UserInfo:AppUserInfo = null with get,set

        ///<summary>
        ///The agent state (for call center users)
        ///</summary>
        [<ApiMember(Description="The agent state (for call center users)")>]
        member val AgentState:AgentStates = new AgentStates() with get,set

        ///<summary>
        ///The agent state reason
        ///</summary>
        [<ApiMember(Description="The agent state reason")>]
        member val AgentStateReason:AgentStateReasons = new AgentStateReasons() with get,set

        ///<summary>
        ///The tabs for the app
        ///</summary>
        [<ApiMember(Description="The tabs for the app")>]
        member val Tabs:ResizeArray<Object> = new ResizeArray<Object>() with get,set

        ///<summary>
        ///The app settings
        ///</summary>
        [<ApiMember(Description="The app settings")>]
        member val AppSettings:AppSettings = null with get,set

        ///<summary>
        ///The phone settings for third party connectivity
        ///</summary>
        [<ApiMember(Description="The phone settings for third party connectivity")>]
        member val ThirdPartyPhoneSystemSettings:ThirdPartyPhoneSystemSettings = null with get,set

    type DeviceTypes =
        | Web = 0
        | iOS = 1
        | Android = 2

    ///<summary>
    ///Gets the config for the app including webRTC token
    ///</summary>
    [<Api(Description="Gets the config for the app including webRTC token")>]
    [<AllowNullLiteral>]
    type GetAppConfig() = 
        interface IGet
        ///<summary>
        ///The type of device you are requesting config for
        ///</summary>
        [<ApiMember(Description="The type of device you are requesting config for")>]
        member val DeviceType:DeviceTypes = new DeviceTypes() with get,set

        ///<summary>
        ///Use a specific push credential SID
        ///</summary>
        [<ApiMember(Description="Use a specific push credential SID")>]
        member val PushCredentialSid:String = null with get,set

        ///<summary>
        ///Use a specific application SID
        ///</summary>
        [<ApiMember(Description="Use a specific application SID")>]
        member val ApplicationSid:String = null with get,set

        ///<summary>
        ///Is this device operating in a sandbox environment? IOS only.
        ///</summary>
        [<ApiMember(Description="Is this device operating in a sandbox environment? IOS only.")>]
        member val Sandbox:Boolean = new Boolean() with get,set

F# GetAppConfig 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.

GET /app/config HTTP/1.1 
Host: evovoice.io 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"endpointId":"String","accountId":"String","customerId":"String","accessToken":"String","identity":"String","emailAddress":"String","userInfo":{"firstName":"String","lastName":"String","name":"String","avatarUrl":"String"},"agentState":"Unknown","agentStateReason":"Unknown","tabs":[{}],"appSettings":{"enablePhoneNumberManagement":false,"enableDeviceManagement":false,"enableDialer":false,"enableCallHistory":false,"showFileNameInMessageCenter":false,"chakraTheme":"String","customCss":"String","pageTitle":"String","stringMappings":"String","logoutUrl":"String","portMyNumberUrl":"String"},"thirdPartyPhoneSystemSettings":{"type":"Demo","sipSettings":{"accounts":[{"number":"String","agent":"String","authName":"String","userName":"String","displayName":"String","password":"String","userDomain":"String","registrationExpires":0,"transportType":"UDP","localIP":"String","localPort":0,"sipServer":"String","sipServerPort":0,"outboundServer":"String","outboundServerPort":0,"stunServer":"String","stunPort":0,"audioPlaybackDeviceName":"String","audioRecordingDeviceName":"String","audioCodecs":["PCMU"],"dtmfMethod":"RFC2833"}]},"demoSettings":{"extension":"String"}}}