Evo Voice

<back to all web services

GetDashboardHome

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, CallCenterDashboard
The following routes are available for this service:
All Verbs/dashboard/home
<?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 DashboardCustomerSpend implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $customerId=null,
        /** @var string|null */
        public ?string $customerName=null,
        /** @var float */
        public float $callSpend=0.0
    ) {
    }

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

class DashboardHomeData implements JsonSerializable
{
    public function __construct(
        /** @var array<DashboardCustomerSpend>|null */
        public ?array $customerSpends=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['customerSpends'])) $this->customerSpends = JsonConverters::fromArray('DashboardCustomerSpend', $o['customerSpends']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->customerSpends)) $o['customerSpends'] = JsonConverters::toArray('DashboardCustomerSpend', $this->customerSpends);
        return empty($o) ? new class(){} : $o;
    }
}

class GetDashboardHome implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $accountId=null,
        /** @var string|null */
        public ?string $startDate=null,
        /** @var string|null */
        public ?string $endDate=null
    ) {
    }

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

PHP GetDashboardHome DTOs

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

HTTP + OTHER

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

POST /dashboard/home HTTP/1.1 
Host: evovoice.io 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"accountId":"String","startDate":"String","endDate":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"customerSpends":[{"customerId":"String","customerName":"String","callSpend":0}]}