Evo Voice

<back to all web services

EndpointsReport

This report returns all of the endpoints broken down by type per tab

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/reports/endpoints
<?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;
    }
}

enum EndpointTypes : string
{
    case PhoneNumber = 'PhoneNumber';
    case User = 'User';
    case FaxNumber = 'FaxNumber';
    case EmailAddress = 'EmailAddress';
    case Unused_1 = 'Unused_1';
    case Unused_2 = 'Unused_2';
    case Unused_3 = 'Unused_3';
    case Unused_4 = 'Unused_4';
    case Unused_5 = 'Unused_5';
    case Team = 'Team';
    case Assistant = 'Assistant';
}

/** @description This report returns all of the endpoints broken down by type per tab */
// @Api(Description="This report returns all of the endpoints broken down by type per tab")
class EndpointsReport 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,
        /** @description The types of endpoints to return */
        // @ApiMember(Description="The types of endpoints to return")
        /** @var array<EndpointTypes>|null */
        public ?array $types=null,

        /** @description Filter by specific customer */
        // @ApiMember(Description="Filter by specific customer")
        /** @var string|null */
        public ?string $customerId=null
    ) {
        parent::__construct($accountId,$emailAddressToNotify,$webhookUrl);
    }

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

PHP EndpointsReport DTOs

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

HTTP + CSV

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

GET /reports/endpoints HTTP/1.1 
Host: team.evovoice.io 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

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