| Requires any of the roles: | SystemAdministrator, Manager, CallCenterDashboard |
| GET | /calls/active |
|---|
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 CallInfo:
account_sid: Optional[str] = None
answered_by: Optional[str] = None
caller_name: Optional[str] = None
date_created: Optional[str] = None
date_updated: Optional[str] = None
direction: Optional[str] = None
duration: int = 0
end_time: Optional[str] = None
forwarded_from: Optional[str] = None
from_: Optional[str] = field(metadata=config(field_name='from'), default=None)
from_formatted: Optional[str] = None
parent_call_sid: Optional[str] = None
phone_number_sid: Optional[str] = None
price: Decimal = decimal.Decimal(0)
price_unit: Optional[str] = None
sid: Optional[str] = None
start_time: Optional[str] = None
status: Optional[str] = None
to: Optional[str] = None
to_formatted: Optional[str] = None
uri: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetActiveCallsResponse:
calls: Optional[List[CallInfo]] = None
# @Api(Description="Gets all activecalls")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetActiveCalls(IGet):
"""
Gets all activecalls
"""
# @ApiMember(Description="The account ID to retrieve for")
account_id: Optional[str] = None
"""
The account ID to retrieve for
"""
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 /calls/active HTTP/1.1 Host: team.evovoice.io Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<GetActiveCallsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Dashboard">
<Calls>
<CallInfo>
<AccountSid>String</AccountSid>
<AnsweredBy>String</AnsweredBy>
<CallerName>String</CallerName>
<DateCreated>String</DateCreated>
<DateUpdated>String</DateUpdated>
<Direction>String</Direction>
<Duration>0</Duration>
<EndTime>String</EndTime>
<ForwardedFrom>String</ForwardedFrom>
<From>String</From>
<FromFormatted>String</FromFormatted>
<ParentCallSid>String</ParentCallSid>
<PhoneNumberSid>String</PhoneNumberSid>
<Price>0</Price>
<PriceUnit>String</PriceUnit>
<Sid>String</Sid>
<StartTime>String</StartTime>
<Status>String</Status>
<To>String</To>
<ToFormatted>String</ToFormatted>
<Uri>String</Uri>
</CallInfo>
</Calls>
</GetActiveCallsResponse>