Evo Voice

<back to all web services

GetActiveCalls

Gets all activecalls

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager
The following routes are available for this service:
GET/calls/active
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class CallInfo implements IConvertible
{
    String? accountSid;
    String? annotation;
    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.annotation,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'];
        annotation = json['annotation'];
        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,
        'annotation': annotation,
        '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: '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()),
});

Dart GetActiveCalls DTOs

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

HTTP + 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: evovoice.io 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	calls: 
	[
		{
			accountSid: String,
			annotation: 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
		}
	]
}