Requires any of the roles: | SystemAdministrator, Manager |
GET | /calls/active |
---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class CallInfo implements IConvertible
{
String? accountSid;
String? answeredBy;
String? callerName;
String? dateCreated;
String? dateUpdated;
String? direction;
int? duration;
String? endTime;
String? forwardedFrom;
String? from;
String? fromFormatted;
String? parentCallSid;
String? phoneNumberSid;
double? price;
String? priceUnit;
String? sid;
String? startTime;
String? status;
String? to;
String? toFormatted;
String? uri;
CallInfo({this.accountSid,this.answeredBy,this.callerName,this.dateCreated,this.dateUpdated,this.direction,this.duration,this.endTime,this.forwardedFrom,this.from,this.fromFormatted,this.parentCallSid,this.phoneNumberSid,this.price,this.priceUnit,this.sid,this.startTime,this.status,this.to,this.toFormatted,this.uri});
CallInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
accountSid = json['accountSid'];
answeredBy = json['answeredBy'];
callerName = json['callerName'];
dateCreated = json['dateCreated'];
dateUpdated = json['dateUpdated'];
direction = json['direction'];
duration = json['duration'];
endTime = json['endTime'];
forwardedFrom = json['forwardedFrom'];
from = json['from'];
fromFormatted = json['fromFormatted'];
parentCallSid = json['parentCallSid'];
phoneNumberSid = json['phoneNumberSid'];
price = JsonConverters.toDouble(json['price']);
priceUnit = json['priceUnit'];
sid = json['sid'];
startTime = json['startTime'];
status = json['status'];
to = json['to'];
toFormatted = json['toFormatted'];
uri = json['uri'];
return this;
}
Map<String, dynamic> toJson() => {
'accountSid': accountSid,
'answeredBy': answeredBy,
'callerName': callerName,
'dateCreated': dateCreated,
'dateUpdated': dateUpdated,
'direction': direction,
'duration': duration,
'endTime': endTime,
'forwardedFrom': forwardedFrom,
'from': from,
'fromFormatted': fromFormatted,
'parentCallSid': parentCallSid,
'phoneNumberSid': phoneNumberSid,
'price': price,
'priceUnit': priceUnit,
'sid': sid,
'startTime': startTime,
'status': status,
'to': to,
'toFormatted': toFormatted,
'uri': uri
};
getTypeName() => "CallInfo";
TypeContext? context = _ctx;
}
class GetActiveCallsResponse implements IConvertible
{
List<CallInfo>? calls;
GetActiveCallsResponse({this.calls});
GetActiveCallsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
calls = JsonConverters.fromJson(json['calls'],'List<CallInfo>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'calls': JsonConverters.toJson(calls,'List<CallInfo>',context!)
};
getTypeName() => "GetActiveCallsResponse";
TypeContext? context = _ctx;
}
/**
* Gets all activecalls
*/
// @Api(Description="Gets all activecalls")
class GetActiveCalls implements IGet, IConvertible
{
/**
* The account ID to retrieve for
*/
// @ApiMember(Description="The account ID to retrieve for")
String? accountId;
GetActiveCalls({this.accountId});
GetActiveCalls.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
accountId = json['accountId'];
return this;
}
Map<String, dynamic> toJson() => {
'accountId': accountId
};
getTypeName() => "GetActiveCalls";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'team.evovoice.io', types: <String, TypeInfo> {
'CallInfo': TypeInfo(TypeOf.Class, create:() => CallInfo()),
'GetActiveCallsResponse': TypeInfo(TypeOf.Class, create:() => GetActiveCallsResponse()),
'List<CallInfo>': TypeInfo(TypeOf.Class, create:() => <CallInfo>[]),
'GetActiveCalls': TypeInfo(TypeOf.Class, create:() => GetActiveCalls()),
});
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>