Evo Voice

<back to all web services

GetAuthStatus

Gets the current authenticated status or null

The following routes are available for this service:
GET/auth/status
<?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};


enum DashboardPermissions : string
{
    case ViewFiles = 'ViewFiles';
    case ViewNotifications = 'ViewNotifications';
    case ViewSessions = 'ViewSessions';
    case ViewEndpoints = 'ViewEndpoints';
    case ViewReports = 'ViewReports';
    case ViewCustomers = 'ViewCustomers';
    case ViewFlows = 'ViewFlows';
}

class UserInfo implements JsonSerializable
{
    public function __construct(
        /** @var string|null */
        public ?string $id=null,
        /** @var bool|null */
        public ?bool $isAuthenticated=null,
        /** @var string|null */
        public ?string $firstName=null,
        /** @var string|null */
        public ?string $lastName=null,
        /** @var string|null */
        public ?string $name=null,
        /** @var string|null */
        public ?string $avatarUrl=null,
        /** @var string|null */
        public ?string $emailAddress=null,
        /** @var array<string>|null */
        public ?array $roles=null,
        /** @var array<string>|null */
        public ?array $accountIds=null,
        /** @var array<string>|null */
        public ?array $accountNames=null,
        /** @var array<DashboardPermissions>|null */
        public ?array $dashboardPermissions=null
    ) {
    }

    /** @throws Exception */
    public function fromMap($o): void {
        if (isset($o['id'])) $this->id = $o['id'];
        if (isset($o['isAuthenticated'])) $this->isAuthenticated = $o['isAuthenticated'];
        if (isset($o['firstName'])) $this->firstName = $o['firstName'];
        if (isset($o['lastName'])) $this->lastName = $o['lastName'];
        if (isset($o['name'])) $this->name = $o['name'];
        if (isset($o['avatarUrl'])) $this->avatarUrl = $o['avatarUrl'];
        if (isset($o['emailAddress'])) $this->emailAddress = $o['emailAddress'];
        if (isset($o['roles'])) $this->roles = JsonConverters::fromArray('string', $o['roles']);
        if (isset($o['accountIds'])) $this->accountIds = JsonConverters::fromArray('string', $o['accountIds']);
        if (isset($o['accountNames'])) $this->accountNames = JsonConverters::fromArray('string', $o['accountNames']);
        if (isset($o['dashboardPermissions'])) $this->dashboardPermissions = JsonConverters::fromArray('DashboardPermissions', $o['dashboardPermissions']);
    }
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        if (isset($this->id)) $o['id'] = $this->id;
        if (isset($this->isAuthenticated)) $o['isAuthenticated'] = $this->isAuthenticated;
        if (isset($this->firstName)) $o['firstName'] = $this->firstName;
        if (isset($this->lastName)) $o['lastName'] = $this->lastName;
        if (isset($this->name)) $o['name'] = $this->name;
        if (isset($this->avatarUrl)) $o['avatarUrl'] = $this->avatarUrl;
        if (isset($this->emailAddress)) $o['emailAddress'] = $this->emailAddress;
        if (isset($this->roles)) $o['roles'] = JsonConverters::toArray('string', $this->roles);
        if (isset($this->accountIds)) $o['accountIds'] = JsonConverters::toArray('string', $this->accountIds);
        if (isset($this->accountNames)) $o['accountNames'] = JsonConverters::toArray('string', $this->accountNames);
        if (isset($this->dashboardPermissions)) $o['dashboardPermissions'] = JsonConverters::toArray('DashboardPermissions', $this->dashboardPermissions);
        return empty($o) ? new class(){} : $o;
    }
}

/** @description Gets the current authenticated status or null */
// @Api(Description="Gets the current authenticated status or null")
class GetAuthStatus implements IGet, JsonSerializable
{
    
    /** @throws Exception */
    public function jsonSerialize(): mixed
    {
        $o = [];
        return empty($o) ? new class(){} : $o;
    }
}

PHP GetAuthStatus 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 /auth/status HTTP/1.1 
Host: team.evovoice.io 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"id":"String","isAuthenticated":false,"firstName":"String","lastName":"String","name":"String","avatarUrl":"String","emailAddress":"String","roles":["String"],"accountIds":["String"],"accountNames":["String"],"dashboardPermissions":["ViewFiles"]}