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
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AppUserInfo:
    # @ApiMember(Description="The user's first name")
    first_name: Optional[str] = None
    """
    The user's first name
    """


    # @ApiMember(Description="The user's last name")
    last_name: Optional[str] = None
    """
    The user's last name
    """


    # @ApiMember(Description="Shortcut to the user's full name")
    name: Optional[str] = None
    """
    Shortcut to the user's full name
    """


    # @ApiMember(Description="The URL to the user's avatar")
    avatar_url: Optional[str] = None
    """
    The URL to the user's avatar
    """


class AgentStates(str, Enum):
    UNKNOWN = 'Unknown'
    READY = 'Ready'
    NOT_READY = 'NotReady'
    LOGGED_OUT = 'LoggedOut'
    WRAP_UP = 'WrapUp'
    OUTGOING = 'Outgoing'
    OTHER = 'Other'


class AgentStateReasons(str, Enum):
    UNKNOWN = 'Unknown'
    SET_BY_USER = 'SetByUser'
    MISSED_CALL = 'MissedCall'
    SET_BY_SYSTEM = 'SetBySystem'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AppSettings:
    enable_phone_number_management: Optional[bool] = None
    enable_device_management: Optional[bool] = None
    enable_dialer: Optional[bool] = None
    enable_call_history: Optional[bool] = None
    show_file_name_in_message_center: Optional[bool] = None
    chakra_theme: Optional[str] = None
    custom_css: Optional[str] = None
    page_title: Optional[str] = None
    string_mappings: Optional[str] = None
    logout_url: Optional[str] = None
    port_my_number_url: Optional[str] = None


class ThirdPartyPhoneSystemTypes(str, Enum):
    DEMO = 'Demo'
    SIP = 'Sip'


class TransportTypes(str, Enum):
    UDP = 'UDP'
    TLS = 'TLS'
    TCP = 'TCP'
    PERS = 'PERS'


class AudioCodecTypes(IntEnum):
    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


class DtmfMethods(str, Enum):
    RF_C2833 = 'RFC2833'
    INFO = 'INFO'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ThirdPartySipAccountSettings:
    number: Optional[str] = None
    agent: Optional[str] = None
    auth_name: Optional[str] = None
    user_name: Optional[str] = None
    display_name: Optional[str] = None
    password: Optional[str] = None
    user_domain: Optional[str] = None
    registration_expires: Optional[int] = None
    transport_type: Optional[TransportTypes] = None
    local_i_p: Optional[str] = None
    local_port: Optional[int] = None
    sip_server: Optional[str] = None
    sip_server_port: Optional[int] = None
    outbound_server: Optional[str] = None
    outbound_server_port: Optional[int] = None
    stun_server: Optional[str] = None
    stun_port: Optional[int] = None
    audio_playback_device_name: Optional[str] = None
    audio_recording_device_name: Optional[str] = None
    audio_codecs: Optional[List[AudioCodecTypes]] = None
    dtmf_method: Optional[DtmfMethods] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ThirdPartySipSettings:
    accounts: Optional[List[ThirdPartySipAccountSettings]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ThirdPartyDemoSettings:
    extension: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ThirdPartyPhoneSystemSettings:
    type: Optional[ThirdPartyPhoneSystemTypes] = None
    sip_settings: Optional[ThirdPartySipSettings] = None
    demo_settings: Optional[ThirdPartyDemoSettings] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AppConfig:
    # @ApiMember(Description="The ID of this endpoint")
    endpoint_id: Optional[str] = None
    """
    The ID of this endpoint
    """


    # @ApiMember(Description="The ID of the account")
    account_id: Optional[str] = None
    """
    The ID of the account
    """


    # @ApiMember(Description="The customer ID associated with this user")
    customer_id: Optional[str] = None
    """
    The customer ID associated with this user
    """


    # @ApiMember(Description="The access token for use with Twilio Voice")
    access_token: Optional[str] = None
    """
    The access token for use with Twilio Voice
    """


    # @ApiMember(Description="The access token's identity")
    identity: Optional[str] = None
    """
    The access token's identity
    """


    # @ApiMember(Description="The email address of the user")
    email_address: Optional[str] = None
    """
    The email address of the user
    """


    # @ApiMember(Description="The user's information")
    user_info: Optional[AppUserInfo] = None
    """
    The user's information
    """


    # @ApiMember(Description="The agent state (for call center users)")
    agent_state: Optional[AgentStates] = None
    """
    The agent state (for call center users)
    """


    # @ApiMember(Description="The agent state reason")
    agent_state_reason: Optional[AgentStateReasons] = None
    """
    The agent state reason
    """


    # @ApiMember(Description="The tabs for the app")
    tabs: Optional[List[Object]] = None
    """
    The tabs for the app
    """


    # @ApiMember(Description="The app settings")
    app_settings: Optional[AppSettings] = None
    """
    The app settings
    """


    # @ApiMember(Description="The phone settings for third party connectivity")
    third_party_phone_system_settings: Optional[ThirdPartyPhoneSystemSettings] = None
    """
    The phone settings for third party connectivity
    """


class DeviceTypes(str, Enum):
    WEB = 'Web'
    I_O_S = 'iOS'
    ANDROID = 'Android'


# @Api(Description="Gets the config for the app including webRTC token")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAppConfig(IGet):
    """
    Gets the config for the app including webRTC token
    """

    # @ApiMember(Description="The type of device you are requesting config for")
    device_type: Optional[DeviceTypes] = None
    """
    The type of device you are requesting config for
    """


    # @ApiMember(Description="Use a specific push credential SID")
    push_credential_sid: Optional[str] = None
    """
    Use a specific push credential SID
    """


    # @ApiMember(Description="Use a specific application SID")
    application_sid: Optional[str] = None
    """
    Use a specific application SID
    """


    # @ApiMember(Description="Is this device operating in a sandbox environment? IOS only.")
    sandbox: Optional[bool] = None
    """
    Is this device operating in a sandbox environment? IOS only.
    """

Python 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"}}}