| POST | /v1/signup |
|---|
import 'package:servicestack/servicestack.dart';
// @DataContract
class SignUpResponse implements IConvertible
{
// @DataMember(Name="success")
bool? success;
// @DataMember(Name="hasAccount")
bool? hasAccount;
// @DataMember(Name="accountConfirmed")
bool? accountConfirmed;
// @DataMember(Name="responseStatus")
ResponseStatus? responseStatus;
SignUpResponse({this.success,this.hasAccount,this.accountConfirmed,this.responseStatus});
SignUpResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
success = json['success'];
hasAccount = json['hasAccount'];
accountConfirmed = json['accountConfirmed'];
responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
return this;
}
Map<String, dynamic> toJson() => {
'success': success,
'hasAccount': hasAccount,
'accountConfirmed': accountConfirmed,
'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
};
getTypeName() => "SignUpResponse";
TypeContext? context = _ctx;
}
// @DataContract
class SignUpRequest implements IConvertible
{
// @DataMember(Name="email")
// @ApiMember(IsRequired=true, Name="email")
String? email;
// @DataMember(Name="url")
// @ApiMember(IsRequired=true, Name="url")
String? url;
// @DataMember(Name="domain")
String? domain;
// @DataMember(Name="code")
String? code;
// @DataMember(Name="affiliateProgramGuid")
String? affiliateProgramGuid;
// @DataMember(Name="affiliateParameters")
Map<String,String?>? affiliateParameters;
SignUpRequest({this.email,this.url,this.domain,this.code,this.affiliateProgramGuid,this.affiliateParameters});
SignUpRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
email = json['email'];
url = json['url'];
domain = json['domain'];
code = json['code'];
affiliateProgramGuid = json['affiliateProgramGuid'];
affiliateParameters = JsonConverters.toStringMap(json['affiliateParameters']);
return this;
}
Map<String, dynamic> toJson() => {
'email': email,
'url': url,
'domain': domain,
'code': code,
'affiliateProgramGuid': affiliateProgramGuid,
'affiliateParameters': affiliateParameters
};
getTypeName() => "SignUpRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.booklinker.com', types: <String, TypeInfo> {
'SignUpResponse': TypeInfo(TypeOf.Class, create:() => SignUpResponse()),
'SignUpRequest': TypeInfo(TypeOf.Class, create:() => SignUpRequest()),
});
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 /v1/signup HTTP/1.1
Host: api.booklinker.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
email: String,
url: String,
domain: String,
code: String,
affiliateParameters:
{
String: String
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
success: False,
hasAccount: False,
accountConfirmed: False,
responseStatus:
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}
}