| POST | /users | Create a new External User |
|---|
import 'package:servicestack/servicestack.dart';
class CreateUserResponse implements IConvertible
{
/**
* Unique Identifier of the User created in Booster
*/
// @ApiMember(Description="Unique Identifier of the User created in Booster", IsRequired=true)
String? userId;
CreateUserResponse({this.userId});
CreateUserResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
userId = json['userId'];
return this;
}
Map<String, dynamic> toJson() => {
'userId': userId
};
getTypeName() => "CreateUserResponse";
TypeContext? context = _ctx;
}
class CreateUser implements IConvertible
{
/**
* User E-mail
*/
// @ApiMember(Description="User E-mail", IsRequired=true)
String? email;
/**
* User First Name
*/
// @ApiMember(Description="User First Name", IsRequired=true)
String? firstName;
/**
* User Last Name
*/
// @ApiMember(Description="User Last Name", IsRequired=true)
String? lastName;
/**
* User Culture
*/
// @ApiMember(Description="User Culture", IsRequired=true)
String? culture;
/**
* Country Id
*/
// @ApiMember(Description="Country Id", IsRequired=true)
String? countryId;
CreateUser({this.email,this.firstName,this.lastName,this.culture,this.countryId});
CreateUser.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
email = json['email'];
firstName = json['firstName'];
lastName = json['lastName'];
culture = json['culture'];
countryId = json['countryId'];
return this;
}
Map<String, dynamic> toJson() => {
'email': email,
'firstName': firstName,
'lastName': lastName,
'culture': culture,
'countryId': countryId
};
getTypeName() => "CreateUser";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'dev_api_booster.richemont.com', types: <String, TypeInfo> {
'CreateUserResponse': TypeInfo(TypeOf.Class, create:() => CreateUserResponse()),
'CreateUser': TypeInfo(TypeOf.Class, create:() => CreateUser()),
});
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: dev-api-booster.richemont.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateUser xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel">
<countryId>String</countryId>
<culture>String</culture>
<email>String</email>
<firstName>String</firstName>
<lastName>String</lastName>
</CreateUser>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <CreateUserResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Richemont.Booster2.PublicApi.Security.ServiceModel"> <UserId>00000000-0000-0000-0000-000000000000</UserId> </CreateUserResponse>