Required role: | User |
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: bool = False
enable_device_management: bool = False
enable_dialer: bool = False
enable_call_history: bool = False
enable_assistants: bool = False
show_file_name_in_message_center: bool = False
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: int = 0
transport_type: Optional[TransportTypes] = None
local_i_p: Optional[str] = None
local_port: int = 0
sip_server: Optional[str] = None
sip_server_port: int = 0
outbound_server: Optional[str] = None
outbound_server_port: int = 0
stun_server: Optional[str] = None
stun_port: int = 0
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: bool = False
"""
Is this device operating in a sandbox environment? IOS only.
"""
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.
GET /app/config HTTP/1.1 Host: team.evovoice.io Accept: application/xml
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AppConfig xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.App"> <AccessToken>String</AccessToken> <AccountId>String</AccountId> <AgentState>Unknown</AgentState> <AgentStateReason>Unknown</AgentStateReason> <AppSettings xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Customers"> <d2p1:ChakraTheme>String</d2p1:ChakraTheme> <d2p1:CustomCss>String</d2p1:CustomCss> <d2p1:EnableAssistants>false</d2p1:EnableAssistants> <d2p1:EnableCallHistory>false</d2p1:EnableCallHistory> <d2p1:EnableDeviceManagement>false</d2p1:EnableDeviceManagement> <d2p1:EnableDialer>false</d2p1:EnableDialer> <d2p1:EnablePhoneNumberManagement>false</d2p1:EnablePhoneNumberManagement> <d2p1:LogoutUrl>String</d2p1:LogoutUrl> <d2p1:PageTitle>String</d2p1:PageTitle> <d2p1:PortMyNumberUrl>String</d2p1:PortMyNumberUrl> <d2p1:ShowFileNameInMessageCenter>false</d2p1:ShowFileNameInMessageCenter> <d2p1:StringMappings>String</d2p1:StringMappings> </AppSettings> <CustomerId>String</CustomerId> <EmailAddress>String</EmailAddress> <EndpointId>String</EndpointId> <Identity>String</Identity> <Tabs xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:anyType /> </Tabs> <ThirdPartyPhoneSystemSettings xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Endpoints"> <d2p1:DemoSettings> <d2p1:Extension>String</d2p1:Extension> </d2p1:DemoSettings> <d2p1:SipSettings> <d2p1:Accounts> <d2p1:ThirdPartyPhoneSystemSettings.ThirdPartySipSettings.ThirdPartySipAccountSettings> <d2p1:Agent>String</d2p1:Agent> <d2p1:AudioCodecs> <d2p1:ThirdPartyPhoneSystemSettings.ThirdPartySipSettings.AudioCodecTypes>PCMU</d2p1:ThirdPartyPhoneSystemSettings.ThirdPartySipSettings.AudioCodecTypes> </d2p1:AudioCodecs> <d2p1:AudioPlaybackDeviceName>String</d2p1:AudioPlaybackDeviceName> <d2p1:AudioRecordingDeviceName>String</d2p1:AudioRecordingDeviceName> <d2p1:AuthName>String</d2p1:AuthName> <d2p1:DTMFMethod>RFC2833</d2p1:DTMFMethod> <d2p1:DisplayName>String</d2p1:DisplayName> <d2p1:LocalIP>String</d2p1:LocalIP> <d2p1:LocalPort>0</d2p1:LocalPort> <d2p1:Number>String</d2p1:Number> <d2p1:OutboundServer>String</d2p1:OutboundServer> <d2p1:OutboundServerPort>0</d2p1:OutboundServerPort> <d2p1:Password>String</d2p1:Password> <d2p1:RegistrationExpires>0</d2p1:RegistrationExpires> <d2p1:SipServer>String</d2p1:SipServer> <d2p1:SipServerPort>0</d2p1:SipServerPort> <d2p1:StunPort>0</d2p1:StunPort> <d2p1:StunServer>String</d2p1:StunServer> <d2p1:TransportType>UDP</d2p1:TransportType> <d2p1:UserDomain>String</d2p1:UserDomain> <d2p1:UserName>String</d2p1:UserName> </d2p1:ThirdPartyPhoneSystemSettings.ThirdPartySipSettings.ThirdPartySipAccountSettings> </d2p1:Accounts> </d2p1:SipSettings> <d2p1:Type>Demo</d2p1:Type> </ThirdPartyPhoneSystemSettings> <UserInfo> <AvatarUrl>String</AvatarUrl> <FirstName>String</FirstName> <LastName>String</LastName> <Name>String</Name> </UserInfo> </AppConfig>