Evo Voice

<back to all web services

SearchPhoneNumbers

Search for phone numbers

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


/** @description Search for phone numbers */
// @Api(Description="Search for phone numbers")
class SearchPhoneNumbers implements IGet, JsonSerializable
{
    public function __construct(
        /** @description The account you are searching for */
        // @ApiMember(Description="The account you are searching for")
        /** @var string|null */
        public ?string $accountId=null,

        /** @description The area code */
        // @ApiMember(Description="The area code")
        /** @var string|null */
        public ?string $areaCode=null,

        /** @description The country code you are searching for */
        // @ApiMember(Description="The country code you are searching for")
        /** @var string|null */
        public ?string $countryCode=null,

        /** @description The postal code you are searching for */
        // @ApiMember(Description="The postal code you are searching for")
        /** @var string|null */
        public ?string $postalCode=null,

        /** @description The distance from the specified postal code (default is 100) */
        // @ApiMember(Description="The distance from the specified postal code (default is 100)")
        /** @var int|null */
        public ?int $distance=null,

        /** @description Search for fax numbers */
        // @ApiMember(Description="Search for fax numbers")
        /** @var bool|null */
        public ?bool $isFaxNumber=null,

        /** @description Contains specific digits */
        // @ApiMember(Description="Contains specific digits")
        /** @var string|null */
        public ?string $contains=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['accountId'])) $this->accountId = $o['accountId'];
        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['distance'])) $this->distance = $o['distance'];
        if (isset($o['isFaxNumber'])) $this->isFaxNumber = $o['isFaxNumber'];
        if (isset($o['contains'])) $this->contains = $o['contains'];
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->accountId)) $o['accountId'] = $this->accountId;
        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->distance)) $o['distance'] = $this->distance;
        if (isset($this->isFaxNumber)) $o['isFaxNumber'] = $this->isFaxNumber;
        if (isset($this->contains)) $o['contains'] = $this->contains;
        return empty($o) ? new class(){} : $o;
    }
}

PHP SearchPhoneNumbers DTOs

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

HTTP + JSV

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

GET /endpoints/phone-numbers/search HTTP/1.1 
Host: team.evovoice.io 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

[
	{
		phoneNumber: String
	}
]