Evo Voice

<back to all web services

GetActiveSessions

Get your active sessions. Will eventually replace GetMySessions

Requires Authentication
Required role:User
The following routes are available for this service:
GET/sessions/active
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Voice.Api.Sessions
Imports Voice.Api
Imports Voice.Api.Customers
Imports Voice.Api.Flows

Namespace Global

    Namespace Voice.Api

        Public Partial Class EntityInfo
            '''<Summary>
            '''The ID of the object
            '''</Summary>
            <ApiMember(Description:="The ID of the object")>
            Public Overridable Property Id As String

            '''<Summary>
            '''The date the object was created
            '''</Summary>
            <ApiMember(Description:="The date the object was created")>
            Public Overridable Property DateCreated As String

            '''<Summary>
            '''The date the object was last modified
            '''</Summary>
            <ApiMember(Description:="The date the object was last modified")>
            Public Overridable Property DateLastModified As String

            '''<Summary>
            '''The user that created this object
            '''</Summary>
            <ApiMember(Description:="The user that created this object")>
            Public Overridable Property CreatedBy As String

            '''<Summary>
            '''The user that last modified this object
            '''</Summary>
            <ApiMember(Description:="The user that last modified this object")>
            Public Overridable Property LastModifiedBy As String
        End Class
    End Namespace

    Namespace Voice.Api.Customers

        Public Partial Class CustomerBreadcrumb
            Public Overridable Property Id As String
            Public Overridable Property Name As String
        End Class
    End Namespace

    Namespace Voice.Api.Flows

        Public Enum FlowChannels
            Voice
            Chat
            Fax
        End Enum
    End Namespace

    Namespace Voice.Api.Sessions

        '''<Summary>
        '''Get your active sessions. Will eventually replace GetMySessions
        '''</Summary>
        <Api(Description:="Get your active sessions. Will eventually replace GetMySessions")>
        Public Partial Class GetActiveSessions
        End Class

        Public Partial Class GetActiveSessionsResponse
            Public Sub New()
                Sessions = New List(Of SessionInfo)
            End Sub

            Public Overridable Property Sessions As List(Of SessionInfo)
        End Class

        Public Enum SessionCallState
            Disconnected
            Ringing
            Connected
            Hold
            Passive
        End Enum

        Public Enum SessionDialState
            None
            Active
        End Enum

        Public Enum SessionDirections
            Incoming
            Outgoing
        End Enum

        Public Enum SessionHoldReasons
            None
            Transferring
        End Enum

        Public Partial Class SessionInfo
            Inherits EntityInfo
            Public Sub New()
                CustomerBreadcrumb = New List(Of CustomerBreadcrumb)
                Log = New List(Of SessionLogInfo)
                Members = New List(Of SessionMemberInfo)
            End Sub

            '''<Summary>
            '''The state of the session
            '''</Summary>
            <ApiMember(Description:="The state of the session")>
            Public Overridable Property DialState As SessionDialState

            '''<Summary>
            '''The call state of the session
            '''</Summary>
            <ApiMember(Description:="The call state of the session")>
            Public Overridable Property CallState As SessionCallState

            '''<Summary>
            '''The queue state of the session
            '''</Summary>
            <ApiMember(Description:="The queue state of the session")>
            Public Overridable Property QueueState As SessionQueueStates

            '''<Summary>
            '''The ID of the account associated with the flow
            '''</Summary>
            <ApiMember(Description:="The ID of the account associated with the flow")>
            Public Overridable Property AccountId As String

            '''<Summary>
            '''The name of the account associated with the session
            '''</Summary>
            <ApiMember(Description:="The name of the account associated with the session")>
            Public Overridable Property AccountName As String

            '''<Summary>
            '''The ID of the customer this session is associated with
            '''</Summary>
            <ApiMember(Description:="The ID of the customer this session is associated with")>
            Public Overridable Property CustomerId As String

            '''<Summary>
            '''The customer breadcrumb this session is associated with
            '''</Summary>
            <ApiMember(Description:="The customer breadcrumb this session is associated with")>
            Public Overridable Property CustomerBreadcrumb As List(Of CustomerBreadcrumb)

            '''<Summary>
            '''The name of the customer this session is associated with
            '''</Summary>
            <ApiMember(Description:="The name of the customer this session is associated with")>
            Public Overridable Property CustomerName As String

            '''<Summary>
            '''The ID of the endpoint associated with this session
            '''</Summary>
            <ApiMember(Description:="The ID of the endpoint associated with this session")>
            Public Overridable Property EndpointId As String

            '''<Summary>
            '''The name of the endpoint associated with this session
            '''</Summary>
            <ApiMember(Description:="The name of the endpoint associated with this session")>
            Public Overridable Property EndpointName As String

            '''<Summary>
            '''The date the call completed
            '''</Summary>
            <ApiMember(Description:="The date the call completed")>
            Public Overridable Property DateCompleted As String

            '''<Summary>
            '''The destination of the session (e.g. what was entered into the Dial box)
            '''</Summary>
            <ApiMember(Description:="The destination of the session (e.g. what was entered into the Dial box)")>
            Public Overridable Property Destination As String

            '''<Summary>
            '''The to address if any
            '''</Summary>
            <ApiMember(Description:="The to address if any")>
            Public Overridable Property ToAddress As String

            '''<Summary>
            '''The from address if any
            '''</Summary>
            <ApiMember(Description:="The from address if any")>
            Public Overridable Property FromAddress As String

            '''<Summary>
            '''The from name if any
            '''</Summary>
            <ApiMember(Description:="The from name if any")>
            Public Overridable Property FromName As String

            '''<Summary>
            '''Answered by name (if any)
            '''</Summary>
            <ApiMember(Description:="Answered by name (if any)")>
            Public Overridable Property AnsweredByName As String

            '''<Summary>
            '''The ID of the queue member assigned to this call
            '''</Summary>
            <ApiMember(Description:="The ID of the queue member assigned to this call")>
            Public Overridable Property QueueMemberId As String

            '''<Summary>
            '''The flow channel
            '''</Summary>
            <ApiMember(Description:="The flow channel")>
            Public Overridable Property Channel As FlowChannels

            '''<Summary>
            '''Has the session ended
            '''</Summary>
            <ApiMember(Description:="Has the session ended")>
            Public Overridable Property Ended As Boolean

            '''<Summary>
            '''The outcome of the call
            '''</Summary>
            <ApiMember(Description:="The outcome of the call")>
            Public Overridable Property Outcome As String

            '''<Summary>
            '''The twilio Call SID of this session
            '''</Summary>
            <ApiMember(Description:="The twilio Call SID of this session")>
            Public Overridable Property CallSid As String

            '''<Summary>
            '''Any console data for this session
            '''</Summary>
            <ApiMember(Description:="Any console data for this session")>
            Public Overridable Property ConsoleData As String

            '''<Summary>
            '''The name of the hold queue for this call
            '''</Summary>
            <ApiMember(Description:="The name of the hold queue for this call")>
            Public Overridable Property HoldQueueName As String

            '''<Summary>
            '''The user ID who put this call on hold
            '''</Summary>
            <ApiMember(Description:="The user ID who put this call on hold")>
            Public Overridable Property HeldByUserId As String

            '''<Summary>
            '''The reason for the hold
            '''</Summary>
            <ApiMember(Description:="The reason for the hold")>
            Public Overridable Property HoldReason As SessionHoldReasons

            '''<Summary>
            '''The SID of the conference if in a conference call
            '''</Summary>
            <ApiMember(Description:="The SID of the conference if in a conference call")>
            Public Overridable Property ConferenceSid As String

            '''<Summary>
            '''The display name for this session
            '''</Summary>
            <ApiMember(Description:="The display name for this session")>
            Public Overridable Property DisplayName As String

            '''<Summary>
            '''The log entries for this session
            '''</Summary>
            <ApiMember(Description:="The log entries for this session")>
            Public Overridable Property Log As List(Of SessionLogInfo)

            '''<Summary>
            '''The members of this session
            '''</Summary>
            <ApiMember(Description:="The members of this session")>
            Public Overridable Property Members As List(Of SessionMemberInfo)

            '''<Summary>
            '''The callback number (typically used for SIP to User calls)
            '''</Summary>
            <ApiMember(Description:="The callback number (typically used for SIP to User calls)")>
            Public Overridable Property CallbackNumber As String

            '''<Summary>
            '''The ID of the endpoint that answered
            '''</Summary>
            <ApiMember(Description:="The ID of the endpoint that answered")>
            Public Overridable Property AnsweredById As String

            '''<Summary>
            '''Is this session incoming or outgoing?
            '''</Summary>
            <ApiMember(Description:="Is this session incoming or outgoing?")>
            Public Overridable Property Direction As SessionDirections

            '''<Summary>
            '''The phone number that this session is coming from (used with SMS chats)
            '''</Summary>
            <ApiMember(Description:="The phone number that this session is coming from (used with SMS chats)")>
            Public Overridable Property FromPhoneNumber As String

            '''<Summary>
            '''The Call SID of the most recently added conference participant
            '''</Summary>
            <ApiMember(Description:="The Call SID of the most recently added conference participant")>
            Public Overridable Property MostRecentParticipantCallSid As String

            '''<Summary>
            '''Was this session missed?
            '''</Summary>
            <ApiMember(Description:="Was this session missed?")>
            Public Overridable Property WasMissed As Boolean

            '''<Summary>
            '''The ring queue that the call is currently in
            '''</Summary>
            <ApiMember(Description:="The ring queue that the call is currently in")>
            Public Overridable Property RingQueueId As String
        End Class

        Public Partial Class SessionLogInfo
            Public Overridable Property [Date] As String
            Public Overridable Property Message As String
        End Class

        Public Enum SessionMemberCallState
            None
            Ringing
            Connected
            Hold
        End Enum

        Public Partial Class SessionMemberInfo
            Public Sub New()
                ApplicationData = New Dictionary(Of String, String)
            End Sub

            Public Overridable Property Identity As String
            Public Overridable Property EndpointId As String
            Public Overridable Property DisplayName As String
            Public Overridable Property IsOriginalMember As Boolean
            Public Overridable Property AvatarUrl As String
            Public Overridable Property ApplicationData As Dictionary(Of String, String)
            Public Overridable Property CallState As SessionMemberCallState
            Public Overridable Property Role As SessionMemberRoles
            Public Overridable Property CallSid As String
            Public Overridable Property Muted As Boolean
        End Class

        Public Enum SessionMemberRoles
            None
            Caller
            Agent
            Transfer
        End Enum

        Public Enum SessionQueueStates
            None
            Queued
            Ringing
            Connected
            Hold
            Disconnected
        End Enum
    End Namespace
End Namespace

VB.NET GetActiveSessions DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /sessions/active HTTP/1.1 
Host: evovoice.io 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetActiveSessionsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Sessions">
  <Sessions>
    <SessionInfo>
      <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</CreatedBy>
      <DateCreated xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateCreated>
      <DateLastModified xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateLastModified>
      <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</Id>
      <LastModifiedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</LastModifiedBy>
      <AccountId>String</AccountId>
      <AccountName>String</AccountName>
      <AnsweredById>String</AnsweredById>
      <AnsweredByName>String</AnsweredByName>
      <CallSid>String</CallSid>
      <CallState>Disconnected</CallState>
      <CallbackNumber>String</CallbackNumber>
      <Channel>Voice</Channel>
      <ConferenceSid>String</ConferenceSid>
      <ConsoleData>String</ConsoleData>
      <CustomerBreadcrumb xmlns:d4p1="http://schemas.datacontract.org/2004/07/Voice.Api.Customers">
        <d4p1:CustomerBreadcrumb>
          <d4p1:Id>String</d4p1:Id>
          <d4p1:Name>String</d4p1:Name>
        </d4p1:CustomerBreadcrumb>
      </CustomerBreadcrumb>
      <CustomerId>String</CustomerId>
      <CustomerName>String</CustomerName>
      <DateCompleted>String</DateCompleted>
      <Destination>String</Destination>
      <DialState>None</DialState>
      <Direction>Incoming</Direction>
      <DisplayName>String</DisplayName>
      <Ended>false</Ended>
      <EndpointId>String</EndpointId>
      <EndpointName>String</EndpointName>
      <FromAddress>String</FromAddress>
      <FromName>String</FromName>
      <FromPhoneNumber>String</FromPhoneNumber>
      <HeldByUserId>String</HeldByUserId>
      <HoldQueueName>String</HoldQueueName>
      <HoldReason>None</HoldReason>
      <Log>
        <SessionLogInfo>
          <Date>String</Date>
          <Message>String</Message>
        </SessionLogInfo>
      </Log>
      <Members>
        <SessionMemberInfo>
          <ApplicationData xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
            <d6p1:KeyValueOfstringstring>
              <d6p1:Key>String</d6p1:Key>
              <d6p1:Value>String</d6p1:Value>
            </d6p1:KeyValueOfstringstring>
          </ApplicationData>
          <AvatarUrl>String</AvatarUrl>
          <CallSid>String</CallSid>
          <CallState>None</CallState>
          <DisplayName>String</DisplayName>
          <EndpointId>String</EndpointId>
          <Identity>String</Identity>
          <IsOriginalMember>false</IsOriginalMember>
          <Muted>false</Muted>
          <Role>None</Role>
        </SessionMemberInfo>
      </Members>
      <MostRecentParticipantCallSid>String</MostRecentParticipantCallSid>
      <Outcome>String</Outcome>
      <QueueMemberId>String</QueueMemberId>
      <QueueState>None</QueueState>
      <RingQueueId>String</RingQueueId>
      <ToAddress>String</ToAddress>
      <WasMissed>false</WasMissed>
    </SessionInfo>
  </Sessions>
</GetActiveSessionsResponse>