Required role: | User |
GET | /app/config |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
/**
* Gets the config for the app including webRTC token
*/
@Api(Description="Gets the config for the app including webRTC token")
open class GetAppConfig : IGet
{
/**
* The type of device you are requesting config for
*/
@ApiMember(Description="The type of device you are requesting config for")
var deviceType:DeviceTypes? = null
/**
* Use a specific push credential SID
*/
@ApiMember(Description="Use a specific push credential SID")
var pushCredentialSid:String? = null
/**
* Use a specific application SID
*/
@ApiMember(Description="Use a specific application SID")
var applicationSid:String? = null
/**
* Is this device operating in a sandbox environment? IOS only.
*/
@ApiMember(Description="Is this device operating in a sandbox environment? IOS only.")
var sandbox:Boolean? = null
}
enum class DeviceTypes
{
Web,
IOS,
Android,
}
open class AppConfig
{
/**
* The ID of this endpoint
*/
@ApiMember(Description="The ID of this endpoint")
var endpointId:String? = null
/**
* The ID of the account
*/
@ApiMember(Description="The ID of the account")
var accountId:String? = null
/**
* The customer ID associated with this user
*/
@ApiMember(Description="The customer ID associated with this user")
var customerId:String? = null
/**
* The access token for use with Twilio Voice
*/
@ApiMember(Description="The access token for use with Twilio Voice")
var accessToken:String? = null
/**
* The access token's identity
*/
@ApiMember(Description="The access token's identity")
var identity:String? = null
/**
* The email address of the user
*/
@ApiMember(Description="The email address of the user")
var emailAddress:String? = null
/**
* The user's information
*/
@ApiMember(Description="The user's information")
var userInfo:AppUserInfo? = null
/**
* The agent state (for call center users)
*/
@ApiMember(Description="The agent state (for call center users)")
var agentState:AgentStates? = null
/**
* The agent state reason
*/
@ApiMember(Description="The agent state reason")
var agentStateReason:AgentStateReasons? = null
/**
* The tabs for the app
*/
@ApiMember(Description="The tabs for the app")
var tabs:ArrayList<Object> = ArrayList<Object>()
/**
* The app settings
*/
@ApiMember(Description="The app settings")
var appSettings:AppSettings? = null
/**
* The phone settings for third party connectivity
*/
@ApiMember(Description="The phone settings for third party connectivity")
var thirdPartyPhoneSystemSettings:ThirdPartyPhoneSystemSettings? = null
}
open class AppUserInfo
{
/**
* The user's first name
*/
@ApiMember(Description="The user's first name")
var firstName:String? = null
/**
* The user's last name
*/
@ApiMember(Description="The user's last name")
var lastName:String? = null
/**
* Shortcut to the user's full name
*/
@ApiMember(Description="Shortcut to the user's full name")
var name:String? = null
/**
* The URL to the user's avatar
*/
@ApiMember(Description="The URL to the user's avatar")
var avatarUrl:String? = null
}
enum class AgentStates
{
Unknown,
Ready,
NotReady,
LoggedOut,
WrapUp,
Outgoing,
Other,
}
enum class AgentStateReasons
{
Unknown,
SetByUser,
MissedCall,
SetBySystem,
}
open class AppSettings
{
var enablePhoneNumberManagement:Boolean? = null
var enableDeviceManagement:Boolean? = null
var enableDialer:Boolean? = null
var enableCallHistory:Boolean? = null
var showFileNameInMessageCenter:Boolean? = null
var chakraTheme:String? = null
var customCss:String? = null
var pageTitle:String? = null
var stringMappings:String? = null
var logoutUrl:String? = null
var portMyNumberUrl:String? = null
}
open class ThirdPartyPhoneSystemSettings
{
@SerializedName("type") var Type:ThirdPartyPhoneSystemTypes? = null
var sipSettings:ThirdPartySipSettings? = null
var demoSettings:ThirdPartyDemoSettings? = null
}
enum class ThirdPartyPhoneSystemTypes
{
Demo,
Sip,
}
open class ThirdPartySipSettings
{
var accounts:ArrayList<ThirdPartySipAccountSettings> = ArrayList<ThirdPartySipAccountSettings>()
}
open class ThirdPartySipAccountSettings
{
var number:String? = null
var agent:String? = null
var authName:String? = null
var userName:String? = null
var displayName:String? = null
var password:String? = null
var userDomain:String? = null
var registrationExpires:Int? = null
var transportType:TransportTypes? = null
var localIP:String? = null
var localPort:Int? = null
var sipServer:String? = null
var sipServerPort:Int? = null
var outboundServer:String? = null
var outboundServerPort:Int? = null
var stunServer:String? = null
var stunPort:Int? = null
var audioPlaybackDeviceName:String? = null
var audioRecordingDeviceName:String? = null
var audioCodecs:ArrayList<AudioCodecTypes> = ArrayList<AudioCodecTypes>()
var dtmfMethod:DtmfMethods? = null
}
enum class TransportTypes
{
Udp,
Tls,
Tcp,
Pers,
}
enum class AudioCodecTypes(val value:Int)
{
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),
}
enum class DtmfMethods
{
RfC2833,
Info,
}
open class ThirdPartyDemoSettings
{
var extension:String? = null
}
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: 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: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>