Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /endpoints/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'
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetEndpointAppConfig:
# @ApiMember(Description="The endpoint whose config you want to get (this must be a User)")
endpoint_id: Optional[str] = None
"""
The endpoint whose config you want to get (this must be a User)
"""
# @ApiMember(Description="The endpoint email address whose config you want to get (this must be a User) - EndpointId takes priority over this")
endpoint_email_address: Optional[str] = None
"""
The endpoint email address whose config you want to get (this must be a User) - EndpointId takes priority over this
"""
# @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.
"""
Python GetEndpointAppConfig DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /endpoints/app/config HTTP/1.1 Host: team.evovoice.io Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv 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, enableAssistants: 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 } } }