Requires any of the roles: | SystemAdministrator, Manager |
GET | /calls/active |
---|
<?php namespace dtos;
use DateTime;
use Exception;
use DateInterval;
use JsonSerializable;
use ServiceStack\{IReturn,IReturnVoid,IGet,IPost,IPut,IDelete,IPatch,IMeta,IHasSessionId,IHasBearerToken,IHasVersion};
use ServiceStack\{ICrud,ICreateDb,IUpdateDb,IPatchDb,IDeleteDb,ISaveDb,AuditBase,QueryDb,QueryDb2,QueryData,QueryData2,QueryResponse};
use ServiceStack\{ResponseStatus,ResponseError,EmptyResponse,IdResponse,ArrayList,KeyValuePair2,StringResponse,StringsResponse,Tuple2,Tuple3,ByteArray};
use ServiceStack\{JsonConverters,Returns,TypeContext};
class CallInfo implements JsonSerializable
{
public function __construct(
/** @var string|null */
public ?string $accountSid=null,
/** @var string|null */
public ?string $answeredBy=null,
/** @var string|null */
public ?string $callerName=null,
/** @var string|null */
public ?string $dateCreated=null,
/** @var string|null */
public ?string $dateUpdated=null,
/** @var string|null */
public ?string $direction=null,
/** @var int */
public int $duration=0,
/** @var string|null */
public ?string $endTime=null,
/** @var string|null */
public ?string $forwardedFrom=null,
/** @var string|null */
public ?string $from=null,
/** @var string|null */
public ?string $fromFormatted=null,
/** @var string|null */
public ?string $parentCallSid=null,
/** @var string|null */
public ?string $phoneNumberSid=null,
/** @var float */
public float $price=0.0,
/** @var string|null */
public ?string $priceUnit=null,
/** @var string|null */
public ?string $sid=null,
/** @var string|null */
public ?string $startTime=null,
/** @var string|null */
public ?string $status=null,
/** @var string|null */
public ?string $to=null,
/** @var string|null */
public ?string $toFormatted=null,
/** @var string|null */
public ?string $uri=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['accountSid'])) $this->accountSid = $o['accountSid'];
if (isset($o['answeredBy'])) $this->answeredBy = $o['answeredBy'];
if (isset($o['callerName'])) $this->callerName = $o['callerName'];
if (isset($o['dateCreated'])) $this->dateCreated = $o['dateCreated'];
if (isset($o['dateUpdated'])) $this->dateUpdated = $o['dateUpdated'];
if (isset($o['direction'])) $this->direction = $o['direction'];
if (isset($o['duration'])) $this->duration = $o['duration'];
if (isset($o['endTime'])) $this->endTime = $o['endTime'];
if (isset($o['forwardedFrom'])) $this->forwardedFrom = $o['forwardedFrom'];
if (isset($o['from'])) $this->from = $o['from'];
if (isset($o['fromFormatted'])) $this->fromFormatted = $o['fromFormatted'];
if (isset($o['parentCallSid'])) $this->parentCallSid = $o['parentCallSid'];
if (isset($o['phoneNumberSid'])) $this->phoneNumberSid = $o['phoneNumberSid'];
if (isset($o['price'])) $this->price = $o['price'];
if (isset($o['priceUnit'])) $this->priceUnit = $o['priceUnit'];
if (isset($o['sid'])) $this->sid = $o['sid'];
if (isset($o['startTime'])) $this->startTime = $o['startTime'];
if (isset($o['status'])) $this->status = $o['status'];
if (isset($o['to'])) $this->to = $o['to'];
if (isset($o['toFormatted'])) $this->toFormatted = $o['toFormatted'];
if (isset($o['uri'])) $this->uri = $o['uri'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->accountSid)) $o['accountSid'] = $this->accountSid;
if (isset($this->answeredBy)) $o['answeredBy'] = $this->answeredBy;
if (isset($this->callerName)) $o['callerName'] = $this->callerName;
if (isset($this->dateCreated)) $o['dateCreated'] = $this->dateCreated;
if (isset($this->dateUpdated)) $o['dateUpdated'] = $this->dateUpdated;
if (isset($this->direction)) $o['direction'] = $this->direction;
if (isset($this->duration)) $o['duration'] = $this->duration;
if (isset($this->endTime)) $o['endTime'] = $this->endTime;
if (isset($this->forwardedFrom)) $o['forwardedFrom'] = $this->forwardedFrom;
if (isset($this->from)) $o['from'] = $this->from;
if (isset($this->fromFormatted)) $o['fromFormatted'] = $this->fromFormatted;
if (isset($this->parentCallSid)) $o['parentCallSid'] = $this->parentCallSid;
if (isset($this->phoneNumberSid)) $o['phoneNumberSid'] = $this->phoneNumberSid;
if (isset($this->price)) $o['price'] = $this->price;
if (isset($this->priceUnit)) $o['priceUnit'] = $this->priceUnit;
if (isset($this->sid)) $o['sid'] = $this->sid;
if (isset($this->startTime)) $o['startTime'] = $this->startTime;
if (isset($this->status)) $o['status'] = $this->status;
if (isset($this->to)) $o['to'] = $this->to;
if (isset($this->toFormatted)) $o['toFormatted'] = $this->toFormatted;
if (isset($this->uri)) $o['uri'] = $this->uri;
return empty($o) ? new class(){} : $o;
}
}
class GetActiveCallsResponse implements JsonSerializable
{
public function __construct(
/** @var array<CallInfo>|null */
public ?array $calls=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['calls'])) $this->calls = JsonConverters::fromArray('CallInfo', $o['calls']);
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->calls)) $o['calls'] = JsonConverters::toArray('CallInfo', $this->calls);
return empty($o) ? new class(){} : $o;
}
}
/** @description Gets all activecalls */
// @Api(Description="Gets all activecalls")
class GetActiveCalls implements IGet, JsonSerializable
{
public function __construct(
/** @description The account ID to retrieve for */
// @ApiMember(Description="The account ID to retrieve for")
/** @var string|null */
public ?string $accountId=null
) {
}
/** @throws Exception */
public function fromMap($o): void {
if (isset($o['accountId'])) $this->accountId = $o['accountId'];
}
/** @throws Exception */
public function jsonSerialize(): mixed
{
$o = [];
if (isset($this->accountId)) $o['accountId'] = $this->accountId;
return empty($o) ? new class(){} : $o;
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
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/jsonl
HTTP/1.1 200 OK Content-Type: text/jsonl 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"}]}