Sanctions Search API: v2

<back to all web services

RegisterAccount

Account
The following routes are available for this service:
POST/account/registerCreate a new account
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

// @DataContract
class Authentication implements IConvertible
{
    /**
    * The API User ID provided by us when you signed up to use our API
    */
    // @DataMember
    // @ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
    String? apiUserId;

    /**
    * The API User Key provided by us when you signed up to use our API
    */
    // @DataMember
    // @ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")
    String? apiUserKey;

    Authentication({this.apiUserId,this.apiUserKey});
    Authentication.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        apiUserId = json['apiUserId'];
        apiUserKey = json['apiUserKey'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'apiUserId': apiUserId,
        'apiUserKey': apiUserKey
    };

    getTypeName() => "Authentication";
    TypeContext? context = _ctx;
}

// @DataContract
class BaseRequest implements IBaseRequest, IConvertible
{
    /**
    * The authentication credentials
    */
    // @DataMember
    // @ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
    Authentication? authentication;

    BaseRequest({this.authentication});
    BaseRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        authentication = JsonConverters.fromJson(json['authentication'],'Authentication',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'authentication': JsonConverters.toJson(authentication,'Authentication',context!)
    };

    getTypeName() => "BaseRequest";
    TypeContext? context = _ctx;
}

// @DataContract
class ResponseError implements IConvertible
{
    // @DataMember(Order=1)
    String? errorCode;

    // @DataMember(Order=2)
    String? fieldName;

    // @DataMember(Order=3)
    String? message;

    // @DataMember(Order=4)
    Map<String,String?>? meta;

    ResponseError({this.errorCode,this.fieldName,this.message,this.meta});
    ResponseError.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        errorCode = json['errorCode'];
        fieldName = json['fieldName'];
        message = json['message'];
        meta = JsonConverters.toStringMap(json['meta']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'errorCode': errorCode,
        'fieldName': fieldName,
        'message': message,
        'meta': meta
    };

    getTypeName() => "ResponseError";
    TypeContext? context = _ctx;
}

class ArrayOfResponseError extends ListBase<ResponseError> implements IConvertible
{
    final List<ResponseError> l = [];
    set length(int newLength) { l.length = newLength; }
    int get length => l.length;
    ResponseError operator [](int index) => l[index];
    void operator []=(int index, ResponseError value) { l[index] = value; }
    ArrayOfResponseError();
    ArrayOfResponseError.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "ArrayOfResponseError";
    TypeContext? context = _ctx;
}

// @DataContract
class ResponseStatus implements IConvertible
{
    // @DataMember(Order=1)
    String? errorCode;

    // @DataMember(Order=2)
    String? message;

    // @DataMember(Order=3)
    String? stackTrace;

    // @DataMember(Order=4)
    ArrayOfResponseError? errors;

    // @DataMember(Order=5)
    Map<String,String?>? meta;

    ResponseStatus({this.errorCode,this.message,this.stackTrace,this.errors,this.meta});
    ResponseStatus.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        errorCode = json['errorCode'];
        message = json['message'];
        stackTrace = json['stackTrace'];
        errors = JsonConverters.fromJson(json['errors'],'ArrayOfResponseError',context!);
        meta = JsonConverters.toStringMap(json['meta']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'errorCode': errorCode,
        'message': message,
        'stackTrace': stackTrace,
        'errors': JsonConverters.toJson(errors,'ArrayOfResponseError',context!),
        'meta': meta
    };

    getTypeName() => "ResponseStatus";
    TypeContext? context = _ctx;
}

class BaseResponse implements IBaseDataResponse, IHasResponseStatus, IConvertible
{
    /**
    * The status of the response
    */
    // @ApiMember(Description="The status of the response")
    ResponseStatus? responseStatus;

    BaseResponse({this.responseStatus});
    BaseResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "BaseResponse";
    TypeContext? context = _ctx;
}

class RegisterAccountData extends BaseResponse implements IConvertible
{
    /**
    * A unique identifier for the users API access
    */
    // @ApiMember(Description="A unique identifier for the users API access")
    String? apiUserId;

    /**
    * A secure, randomly generated key used for API authentication
    */
    // @ApiMember(Description="A secure, randomly generated key used for API authentication")
    String? apiUserKey;

    RegisterAccountData({this.apiUserId,this.apiUserKey});
    RegisterAccountData.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        apiUserId = json['apiUserId'];
        apiUserKey = json['apiUserKey'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'apiUserId': apiUserId,
        'apiUserKey': apiUserKey
    });

    getTypeName() => "RegisterAccountData";
    TypeContext? context = _ctx;
}

// @DataContract
class RegisterAccountResponse implements IConvertible
{
    /**
    * The response data
    */
    // @DataMember
    // @ApiMember(Description="The response data")
    RegisterAccountData? data;

    RegisterAccountResponse({this.data});
    RegisterAccountResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        data = JsonConverters.fromJson(json['data'],'RegisterAccountData',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'data': JsonConverters.toJson(data,'RegisterAccountData',context!)
    };

    getTypeName() => "RegisterAccountResponse";
    TypeContext? context = _ctx;
}

class RegisterAccountRequest implements IConvertible
{
    /**
    * The desired login username for the account
    */
    // @ApiMember(Description="The desired login username for the account", IsRequired=true)
    String? username;

    /**
    * The password for account login
    */
    // @ApiMember(Description="The password for account login", IsRequired=true)
    String? password;

    /**
    * The contact email address for the account holder
    */
    // @ApiMember(Description="The contact email address for the account holder", IsRequired=true)
    String? email;

    /**
    * The full legal name of the account holder
    */
    // @ApiMember(Description="The full legal name of the account holder", IsRequired=true)
    String? fullName;

    /**
    * The registered name of the company associated with this account
    */
    // @ApiMember(Description="The registered name of the company associated with this account", IsRequired=true)
    String? companyName;

    /**
    * The primary contact phone number of the company
    */
    // @ApiMember(Description="The primary contact phone number of the company", IsRequired=true)
    String? companyPhone;

    /**
    * The first line of the company’s address (e.g., street name and number)
    */
    // @ApiMember(Description="The first line of the company’s address (e.g., street name and number)", IsRequired=true)
    String? address1;

    /**
    * The second line of the company’s address (optional)
    */
    // @ApiMember(Description="The second line of the company’s address (optional)")
    String? address2;

    /**
    * The third line of the company’s address (optional)
    */
    // @ApiMember(Description="The third line of the company’s address (optional)")
    String? address3;

    /**
    * The city where the company is located (optional)
    */
    // @ApiMember(Description="The city where the company is located (optional)")
    String? city;

    /**
    * The postal or ZIP code of the company’s address
    */
    // @ApiMember(Description="The postal or ZIP code of the company’s address", IsRequired=true)
    String? postcode;

    /**
    * The country where the company is registered
    */
    // @ApiMember(Description="The country where the company is registered", IsRequired=true)
    String? country;

    /**
    * The classification of the company (e.g., LLC, Corporation, Sole Proprietorship)
    */
    // @ApiMember(Description="The classification of the company (e.g., LLC, Corporation, Sole Proprietorship)", IsRequired=true)
    String? companyType;

    /**
    * The industry sector the company operates in
    */
    // @ApiMember(Description="The industry sector the company operates in", IsRequired=true)
    String? companyIndustry;

    /**
    * The trade body, network, or affiliation the company is a member of (if applicable)
    */
    // @ApiMember(Description="The trade body, network, or affiliation the company is a member of (if applicable)")
    String? companyNetwork;

    /**
    * Indicates agreement to the terms and conditions (required)
    */
    // @ApiMember(Description="Indicates agreement to the terms and conditions (required)", IsRequired=true)
    bool? agreeToTerms;

    /**
    * Indicates agreement to the data protection statement (required)
    */
    // @ApiMember(Description="Indicates agreement to the data protection statement (required)", IsRequired=true)
    bool? agreeToDataProtection;

    /**
    * Indicates consent to be contacted (optional)
    */
    // @ApiMember(Description="Indicates consent to be contacted (optional)")
    bool? agreeToContact;

    /**
    * Indicates agreement to the privacy policy (required)
    */
    // @ApiMember(Description="Indicates agreement to the privacy policy (required)", IsRequired=true)
    bool? agreeToPrivacy;

    /**
    * An optional voucher code for discounts or promotions
    */
    // @ApiMember(Description="An optional voucher code for discounts or promotions")
    String? voucherCode;

    /**
    * An optional code that grants access to certain features or subscriptions
    */
    // @ApiMember(Description="An optional code that grants access to certain features or subscriptions")
    String? accountActivationCode;

    /**
    * The company's VAT registration number (if applicable)
    */
    // @ApiMember(Description="The company's VAT registration number (if applicable)")
    String? vatNumber;

    /**
    * The country where the company is VAT-registered
    */
    // @ApiMember(Description="The country where the company is VAT-registered")
    String? vatCountry;

    RegisterAccountRequest({this.username,this.password,this.email,this.fullName,this.companyName,this.companyPhone,this.address1,this.address2,this.address3,this.city,this.postcode,this.country,this.companyType,this.companyIndustry,this.companyNetwork,this.agreeToTerms,this.agreeToDataProtection,this.agreeToContact,this.agreeToPrivacy,this.voucherCode,this.accountActivationCode,this.vatNumber,this.vatCountry});
    RegisterAccountRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        username = json['username'];
        password = json['password'];
        email = json['email'];
        fullName = json['fullName'];
        companyName = json['companyName'];
        companyPhone = json['companyPhone'];
        address1 = json['address1'];
        address2 = json['address2'];
        address3 = json['address3'];
        city = json['city'];
        postcode = json['postcode'];
        country = json['country'];
        companyType = json['companyType'];
        companyIndustry = json['companyIndustry'];
        companyNetwork = json['companyNetwork'];
        agreeToTerms = json['agreeToTerms'];
        agreeToDataProtection = json['agreeToDataProtection'];
        agreeToContact = json['agreeToContact'];
        agreeToPrivacy = json['agreeToPrivacy'];
        voucherCode = json['voucherCode'];
        accountActivationCode = json['accountActivationCode'];
        vatNumber = json['vatNumber'];
        vatCountry = json['vatCountry'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'username': username,
        'password': password,
        'email': email,
        'fullName': fullName,
        'companyName': companyName,
        'companyPhone': companyPhone,
        'address1': address1,
        'address2': address2,
        'address3': address3,
        'city': city,
        'postcode': postcode,
        'country': country,
        'companyType': companyType,
        'companyIndustry': companyIndustry,
        'companyNetwork': companyNetwork,
        'agreeToTerms': agreeToTerms,
        'agreeToDataProtection': agreeToDataProtection,
        'agreeToContact': agreeToContact,
        'agreeToPrivacy': agreeToPrivacy,
        'voucherCode': voucherCode,
        'accountActivationCode': accountActivationCode,
        'vatNumber': vatNumber,
        'vatCountry': vatCountry
    };

    getTypeName() => "RegisterAccountRequest";
    TypeContext? context = _ctx;
}

// @DataContract
class RegisterAccount extends BaseRequest implements IConvertible
{
    // @DataMember
    RegisterAccountRequest? request;

    RegisterAccount({this.request});
    RegisterAccount.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        request = JsonConverters.fromJson(json['request'],'RegisterAccountRequest',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'request': JsonConverters.toJson(request,'RegisterAccountRequest',context!)
    });

    getTypeName() => "RegisterAccount";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.sanctionssearch.com', types: <String, TypeInfo> {
    'Authentication': TypeInfo(TypeOf.Class, create:() => Authentication()),
    'BaseRequest': TypeInfo(TypeOf.Class, create:() => BaseRequest()),
    'ArrayOfResponseError': TypeInfo(TypeOf.Class, create:() => ArrayOfResponseError()),
    'BaseResponse': TypeInfo(TypeOf.Class, create:() => BaseResponse()),
    'RegisterAccountData': TypeInfo(TypeOf.Class, create:() => RegisterAccountData()),
    'RegisterAccountResponse': TypeInfo(TypeOf.Class, create:() => RegisterAccountResponse()),
    'RegisterAccountRequest': TypeInfo(TypeOf.Class, create:() => RegisterAccountRequest()),
    'RegisterAccount': TypeInfo(TypeOf.Class, create:() => RegisterAccount()),
});

Dart RegisterAccount DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /account/register HTTP/1.1 
Host: api.sanctionssearch.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"request":{"username":"String","password":"String","email":"String","fullName":"String","companyName":"String","companyPhone":"String","address1":"String","address2":"String","address3":"String","city":"String","postcode":"String","country":"String","companyType":"String","companyIndustry":"String","companyNetwork":"String","agreeToTerms":false,"agreeToDataProtection":false,"agreeToContact":false,"agreeToPrivacy":false,"voucherCode":"String","accountActivationCode":"String","vatNumber":"String","vatCountry":"String"},"authentication":{"apiUserId":"String","apiUserKey":"String"}}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"data":{"apiUserId":"String","apiUserKey":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}}