| 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 .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<LoginAddUserRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceInterface">
<DisplayName>String</DisplayName>
<Email>String</Email>
<FirstName>String</FirstName>
<LastName>String</LastName>
<Password>String</Password>
<Permissions xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Permissions>
<RequestUnixUTCTimeStamp>0</RequestUnixUTCTimeStamp>
<Roles xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:string>String</d2p1:string>
</Roles>
<Signature xmlns:d2p1="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<d2p1:Signature>String</d2p1:Signature>
<d2p1:SystemId>String</d2p1:SystemId>
<d2p1:SystemSecret>String</d2p1:SystemSecret>
</Signature>
<UserName>String</UserName>
</LoginAddUserRequest>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <LoginAddUserResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceInterface"> <ErrorMessage>String</ErrorMessage> <UserCreated>false</UserCreated> <UserId>String</UserId> </LoginAddUserResult>