Evo Voice

<back to all web services

AppSearchPhoneNumbers

Requires Authentication
The following routes are available for this service:
GET/portal/search-phone-numbers
<?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 AppSearchPhoneNumberInfo implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $phoneNumber=null
    ) {
    }

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

class AppSearchPhoneNumbersResponse implements JsonSerializable
{
    public function __construct(
        /** @var array<AppSearchPhoneNumberInfo>|null */
        public ?array $numbers=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['numbers'])) $this->numbers = JsonConverters::fromArray('AppSearchPhoneNumberInfo', $o['numbers']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->numbers)) $o['numbers'] = JsonConverters::toArray('AppSearchPhoneNumberInfo', $this->numbers);
        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';
}

class AppSearchPhoneNumbers implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $accountId=null,
        /** @var string|null */
        public ?string $customerId=null,
        /** @var string|null */
        public ?string $areaCode=null,
        /** @var string|null */
        public ?string $countryCode=null,
        /** @var string|null */
        public ?string $postalCode=null,
        /** @var string|null */
        public ?string $contains=null,
        /** @var int|null */
        public ?int $distance=null,
        /** @var EndpointTypes|null */
        public ?EndpointTypes $phoneNumberType=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['accountId'])) $this->accountId = $o['accountId'];
        if (isset($o['customerId'])) $this->customerId = $o['customerId'];
        if (isset($o['areaCode'])) $this->areaCode = $o['areaCode'];
        if (isset($o['countryCode'])) $this->countryCode = $o['countryCode'];
        if (isset($o['postalCode'])) $this->postalCode = $o['postalCode'];
        if (isset($o['contains'])) $this->contains = $o['contains'];
        if (isset($o['distance'])) $this->distance = $o['distance'];
        if (isset($o['phoneNumberType'])) $this->phoneNumberType = JsonConverters::from('EndpointTypes', $o['phoneNumberType']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->accountId)) $o['accountId'] = $this->accountId;
        if (isset($this->customerId)) $o['customerId'] = $this->customerId;
        if (isset($this->areaCode)) $o['areaCode'] = $this->areaCode;
        if (isset($this->countryCode)) $o['countryCode'] = $this->countryCode;
        if (isset($this->postalCode)) $o['postalCode'] = $this->postalCode;
        if (isset($this->contains)) $o['contains'] = $this->contains;
        if (isset($this->distance)) $o['distance'] = $this->distance;
        if (isset($this->phoneNumberType)) $o['phoneNumberType'] = JsonConverters::to('EndpointTypes', $this->phoneNumberType);
        return empty($o) ? new class(){} : $o;
    }
}

PHP AppSearchPhoneNumbers 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.

GET /portal/search-phone-numbers HTTP/1.1 
Host: team.evovoice.io 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"numbers":[{"phoneNumber":"String"}]}