Requires any of the roles: | SystemAdministrator, Manager |
POST | /users |
---|
import 'package:servicestack/servicestack.dart';
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;
}
/**
* Creates a new login with the specified email address and password. Note: Any given email address can only exist once in the entire Evo Voice system.
*/
// @Api(Description="Creates a new login with the specified email address and password. Note: Any given email address can only exist once in the entire Evo Voice system.")
class NewUser implements IPost, IConvertible
{
/**
* The account ID you want to create this user under
*/
// @ApiMember(Description="The account ID you want to create this user under")
String? accountId;
/**
* The email address of the new user
*/
// @ApiMember(Description="The email address of the new user")
String? emailAddress;
/**
* The user's first name
*/
// @ApiMember(Description="The user's first name")
String? firstName;
/**
* The user's last name
*/
// @ApiMember(Description="The user's last name")
String? lastName;
/**
* The password for the new user
*/
// @ApiMember(Description="The password for the new user")
String? password;
NewUser({this.accountId,this.emailAddress,this.firstName,this.lastName,this.password});
NewUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
accountId = json['accountId'];
emailAddress = json['emailAddress'];
firstName = json['firstName'];
lastName = json['lastName'];
password = json['password'];
return this;
}
Map<String, dynamic> toJson() => {
'accountId': accountId,
'emailAddress': emailAddress,
'firstName': firstName,
'lastName': lastName,
'password': password
};
getTypeName() => "NewUser";
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>[]),
'NewUser': TypeInfo(TypeOf.Class, create:() => NewUser()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users HTTP/1.1
Host: evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<NewUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Authentication">
<AccountId>String</AccountId>
<EmailAddress>String</EmailAddress>
<FirstName>String</FirstName>
<LastName>String</LastName>
<Password>String</Password>
</NewUser>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <UserInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Authentication"> <AccountIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </AccountIds> <AccountNames xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </AccountNames> <AvatarUrl>String</AvatarUrl> <DashboardPermissions> <DashboardPermissions>ViewFiles</DashboardPermissions> </DashboardPermissions> <EmailAddress>String</EmailAddress> <FirstName>String</FirstName> <Id>String</Id> <IsAuthenticated>false</IsAuthenticated> <LastName>String</LastName> <Name>String</Name> <Roles xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d2p1:string>String</d2p1:string> </Roles> </UserInfo>