| Requires the role: | Admin | Requires the permission: | CreateUsers |
| POST | /login/create |
|---|
import 'package:servicestack/servicestack.dart';
class RequestSignature implements IConvertible
{
String? systemId;
String? systemSecret;
String? signature;
RequestSignature({this.systemId,this.systemSecret,this.signature});
RequestSignature.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
systemId = json['systemId'];
systemSecret = json['systemSecret'];
signature = json['signature'];
return this;
}
Map<String, dynamic> toJson() => {
'systemId': systemId,
'systemSecret': systemSecret,
'signature': signature
};
getTypeName() => "RequestSignature";
TypeContext? context = _ctx;
}
class LoginAddUserRequest implements IConvertible
{
String? userName;
String? firstName;
String? lastName;
String? displayName;
String? email;
List<String>? roles;
List<String>? permissions;
String? password;
int? requestUnixUTCTimeStamp;
RequestSignature? signature;
LoginAddUserRequest({this.userName,this.firstName,this.lastName,this.displayName,this.email,this.roles,this.permissions,this.password,this.requestUnixUTCTimeStamp,this.signature});
LoginAddUserRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userName = json['userName'];
firstName = json['firstName'];
lastName = json['lastName'];
displayName = json['displayName'];
email = json['email'];
roles = JsonConverters.fromJson(json['roles'],'List<String>',context!);
permissions = JsonConverters.fromJson(json['permissions'],'List<String>',context!);
password = json['password'];
requestUnixUTCTimeStamp = json['requestUnixUTCTimeStamp'];
signature = JsonConverters.fromJson(json['signature'],'RequestSignature',context!);
return this;
}
Map<String, dynamic> toJson() => {
'userName': userName,
'firstName': firstName,
'lastName': lastName,
'displayName': displayName,
'email': email,
'roles': JsonConverters.toJson(roles,'List<String>',context!),
'permissions': JsonConverters.toJson(permissions,'List<String>',context!),
'password': password,
'requestUnixUTCTimeStamp': requestUnixUTCTimeStamp,
'signature': JsonConverters.toJson(signature,'RequestSignature',context!)
};
getTypeName() => "LoginAddUserRequest";
TypeContext? context = _ctx;
}
class LoginAddUserResult implements IConvertible
{
bool? userCreated;
String? userId;
String? errorMessage;
LoginAddUserResult({this.userCreated,this.userId,this.errorMessage});
LoginAddUserResult.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userCreated = json['userCreated'];
userId = json['userId'];
errorMessage = json['errorMessage'];
return this;
}
Map<String, dynamic> toJson() => {
'userCreated': userCreated,
'userId': userId,
'errorMessage': errorMessage
};
getTypeName() => "LoginAddUserResult";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'stubbur_app.azurewebsites.net', types: <String, TypeInfo> {
'RequestSignature': TypeInfo(TypeOf.Class, create:() => RequestSignature()),
'LoginAddUserRequest': TypeInfo(TypeOf.Class, create:() => LoginAddUserRequest()),
'LoginAddUserResult': TypeInfo(TypeOf.Class, create:() => LoginAddUserResult()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /login/create HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
userName: String,
firstName: String,
lastName: String,
displayName: String,
email: String,
roles:
[
String
],
permissions:
[
String
],
password: String,
requestUnixUTCTimeStamp: 0,
signature:
{
systemId: String,
systemSecret: String,
signature: String
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
userCreated: False,
userId: String,
errorMessage: String
}