Evo Voice

<back to all web services

CallCenterAbandonReport

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
All Verbs/reports/call-center-abandon
<?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 ReportRequest implements IPost, JsonSerializable
{
    public function __construct(
        /** @description The account ID this report should be run for */
        // @ApiMember(Description="The account ID this report should be run for")
        /** @var string|null */
        public ?string $accountId=null,

        /** @description The email address to notify after the report is run */
        // @ApiMember(Description="The email address to notify after the report is run")
        /** @var string|null */
        public ?string $emailAddressToNotify=null,

        /** @description The webhook to call after the report is complete with the data from the report */
        // @ApiMember(Description="The webhook to call after the report is complete with the data from the report")
        /** @var string|null */
        public ?string $webhookUrl=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['accountId'])) $this->accountId = $o['accountId'];
        if (isset($o['emailAddressToNotify'])) $this->emailAddressToNotify = $o['emailAddressToNotify'];
        if (isset($o['webhookUrl'])) $this->webhookUrl = $o['webhookUrl'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->accountId)) $o['accountId'] = $this->accountId;
        if (isset($this->emailAddressToNotify)) $o['emailAddressToNotify'] = $this->emailAddressToNotify;
        if (isset($this->webhookUrl)) $o['webhookUrl'] = $this->webhookUrl;
        return empty($o) ? new class(){} : $o;
    }
}

enum ReportStatuses : string
{
    case Queued = 'Queued';
    case Running = 'Running';
    case Completed = 'Completed';
    case Error = 'Error';
}

class ReportInfo implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var ReportStatuses|null */
        public ?ReportStatuses $status=null,
        /** @var string|null */
        public ?string $statusMessage=null,
        /** @var string|null */
        public ?string $dateCreated=null,
        /** @var string|null */
        public ?string $dateUpdated=null,
        /** @var string|null */
        public ?string $downloadLink=null,
        /** @var string|null */
        public ?string $jobId=null,
        /** @var string|null */
        public ?string $emailAddressToNotify=null,
        /** @var string|null */
        public ?string $server=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['status'])) $this->status = JsonConverters::from('ReportStatuses', $o['status']);
        if (isset($o['statusMessage'])) $this->statusMessage = $o['statusMessage'];
        if (isset($o['dateCreated'])) $this->dateCreated = $o['dateCreated'];
        if (isset($o['dateUpdated'])) $this->dateUpdated = $o['dateUpdated'];
        if (isset($o['downloadLink'])) $this->downloadLink = $o['downloadLink'];
        if (isset($o['jobId'])) $this->jobId = $o['jobId'];
        if (isset($o['emailAddressToNotify'])) $this->emailAddressToNotify = $o['emailAddressToNotify'];
        if (isset($o['server'])) $this->server = $o['server'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->status)) $o['status'] = JsonConverters::to('ReportStatuses', $this->status);
        if (isset($this->statusMessage)) $o['statusMessage'] = $this->statusMessage;
        if (isset($this->dateCreated)) $o['dateCreated'] = $this->dateCreated;
        if (isset($this->dateUpdated)) $o['dateUpdated'] = $this->dateUpdated;
        if (isset($this->downloadLink)) $o['downloadLink'] = $this->downloadLink;
        if (isset($this->jobId)) $o['jobId'] = $this->jobId;
        if (isset($this->emailAddressToNotify)) $o['emailAddressToNotify'] = $this->emailAddressToNotify;
        if (isset($this->server)) $o['server'] = $this->server;
        return empty($o) ? new class(){} : $o;
    }
}

class CallCenterAbandonReport extends ReportRequest implements JsonSerializable
{
    /**
     * @param string|null $accountId
     * @param string|null $emailAddressToNotify
     * @param string|null $webhookUrl
     */
    public function __construct(
        ?string $accountId=null,
        ?string $emailAddressToNotify=null,
        ?string $webhookUrl=null,
        /** @var string|null */
        public ?string $startDate=null,
        /** @var string|null */
        public ?string $endDate=null,
        /** @var string|null */
        public ?string $timeZoneId=null
    ) {
        parent::__construct($accountId,$emailAddressToNotify,$webhookUrl);
    }

    /** @throws Exception */
    public function fromMap($o): void {
        parent::fromMap($o);
        if (isset($o['startDate'])) $this->startDate = $o['startDate'];
        if (isset($o['endDate'])) $this->endDate = $o['endDate'];
        if (isset($o['timeZoneId'])) $this->timeZoneId = $o['timeZoneId'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = parent::jsonSerialize();
        if (isset($this->startDate)) $o['startDate'] = $this->startDate;
        if (isset($this->endDate)) $o['endDate'] = $this->endDate;
        if (isset($this->timeZoneId)) $o['timeZoneId'] = $this->timeZoneId;
        return empty($o) ? new class(){} : $o;
    }
}

PHP CallCenterAbandonReport DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /reports/call-center-abandon HTTP/1.1 
Host: team.evovoice.io 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"startDate":"String","endDate":"String","timeZoneId":"String","accountId":"String","emailAddressToNotify":"String","webhookUrl":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"String","name":"String","status":"Queued","statusMessage":"String","dateCreated":"String","dateUpdated":"String","downloadLink":"String","jobId":"String","emailAddressToNotify":"String","server":"String"}