Requires any of the roles: | SystemAdministrator, Manager |
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 .jsv suffix or ?format=jsv
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: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { calls: [ { accountSid: String, answeredBy: String, callerName: String, dateCreated: String, dateUpdated: String, direction: String, duration: 0, endTime: String, forwardedFrom: String, from: String, fromFormatted: String, parentCallSid: String, phoneNumberSid: String, price: 0, priceUnit: String, sid: String, startTime: String, status: String, to: String, toFormatted: String, uri: String } ] }