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
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

enum DashboardPermissions
{
    ViewFiles,
    ViewNotifications,
    ViewSessions,
    ViewEndpoints,
    ViewReports,
    ViewCustomers,
    ViewFlows,
}

class UserInfo implements IConvertible
{
    String? id;
    bool? isAuthenticated;
    String? firstName;
    String? lastName;
    String? name;
    String? avatarUrl;
    String? emailAddress;
    List<String>? roles;
    List<String>? accountIds;
    List<String>? accountNames;
    List<DashboardPermissions>? dashboardPermissions;

    UserInfo({this.id,this.isAuthenticated,this.firstName,this.lastName,this.name,this.avatarUrl,this.emailAddress,this.roles,this.accountIds,this.accountNames,this.dashboardPermissions});
    UserInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        isAuthenticated = json['isAuthenticated'];
        firstName = json['firstName'];
        lastName = json['lastName'];
        name = json['name'];
        avatarUrl = json['avatarUrl'];
        emailAddress = json['emailAddress'];
        roles = JsonConverters.fromJson(json['roles'],'List<String>',context!);
        accountIds = JsonConverters.fromJson(json['accountIds'],'List<String>',context!);
        accountNames = JsonConverters.fromJson(json['accountNames'],'List<String>',context!);
        dashboardPermissions = JsonConverters.fromJson(json['dashboardPermissions'],'List<DashboardPermissions>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'isAuthenticated': isAuthenticated,
        'firstName': firstName,
        'lastName': lastName,
        'name': name,
        'avatarUrl': avatarUrl,
        'emailAddress': emailAddress,
        'roles': JsonConverters.toJson(roles,'List<String>',context!),
        'accountIds': JsonConverters.toJson(accountIds,'List<String>',context!),
        'accountNames': JsonConverters.toJson(accountNames,'List<String>',context!),
        'dashboardPermissions': JsonConverters.toJson(dashboardPermissions,'List<DashboardPermissions>',context!)
    };

    getTypeName() => "UserInfo";
    TypeContext? context = _ctx;
}

/**
* Gets the current authenticated status or null
*/
// @Api(Description="Gets the current authenticated status or null")
class GetAuthStatus implements IGet, IConvertible
{
    GetAuthStatus();
    GetAuthStatus.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "GetAuthStatus";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'DashboardPermissions': TypeInfo(TypeOf.Enum, enumValues:DashboardPermissions.values),
    'UserInfo': TypeInfo(TypeOf.Class, create:() => UserInfo()),
    'List<DashboardPermissions>': TypeInfo(TypeOf.Class, create:() => <DashboardPermissions>[]),
    'GetAuthStatus': TypeInfo(TypeOf.Class, create:() => GetAuthStatus()),
});

Dart GetAuthStatus 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 /auth/status HTTP/1.1 
Host: evovoice.io 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
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"]}