Create a new account |
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@DataContract
public static class RegisterAccount extends BaseRequest
{
@DataMember
public RegisterAccountRequest request = null;
public RegisterAccountRequest getRequest() { return request; }
public RegisterAccount setRequest(RegisterAccountRequest value) { this.request = value; return this; }
}
@DataContract
public static class BaseRequest implements IBaseRequest
{
/**
* The authentication credentials
*/
@DataMember
@ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")
public Authentication authentication = null;
public Authentication getAuthentication() { return authentication; }
public BaseRequest setAuthentication(Authentication value) { this.authentication = value; return this; }
}
@DataContract
public static class Authentication
{
/**
* 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")
public String apiUserId = null;
/**
* 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")
public String apiUserKey = null;
public String getApiUserId() { return apiUserId; }
public Authentication setApiUserId(String value) { this.apiUserId = value; return this; }
public String getApiUserKey() { return apiUserKey; }
public Authentication setApiUserKey(String value) { this.apiUserKey = value; return this; }
}
public static class RegisterAccountRequest
{
/**
* The desired login username for the account
*/
@ApiMember(Description="The desired login username for the account", IsRequired=true)
public String username = null;
/**
* The password for account login
*/
@ApiMember(Description="The password for account login", IsRequired=true)
public String password = null;
/**
* The contact email address for the account holder
*/
@ApiMember(Description="The contact email address for the account holder", IsRequired=true)
public String email = null;
/**
* The full legal name of the account holder
*/
@ApiMember(Description="The full legal name of the account holder", IsRequired=true)
public String fullName = null;
/**
* The registered name of the company associated with this account
*/
@ApiMember(Description="The registered name of the company associated with this account", IsRequired=true)
public String companyName = null;
/**
* The primary contact phone number of the company
*/
@ApiMember(Description="The primary contact phone number of the company", IsRequired=true)
public String companyPhone = null;
/**
* 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)
public String address1 = null;
/**
* The second line of the company’s address (optional)
*/
@ApiMember(Description="The second line of the company’s address (optional)")
public String address2 = null;
/**
* The third line of the company’s address (optional)
*/
@ApiMember(Description="The third line of the company’s address (optional)")
public String address3 = null;
/**
* The city where the company is located (optional)
*/
@ApiMember(Description="The city where the company is located (optional)")
public String city = null;
/**
* The postal or ZIP code of the company’s address
*/
@ApiMember(Description="The postal or ZIP code of the company’s address", IsRequired=true)
public String postcode = null;
/**
* The country where the company is registered
*/
@ApiMember(Description="The country where the company is registered", IsRequired=true)
public String country = null;
/**
* 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)
public String companyType = null;
/**
* The industry sector the company operates in
*/
@ApiMember(Description="The industry sector the company operates in", IsRequired=true)
public String companyIndustry = null;
/**
* 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)")
public String companyNetwork = null;
/**
* Indicates agreement to the terms and conditions (required)
*/
@ApiMember(Description="Indicates agreement to the terms and conditions (required)", IsRequired=true)
public Boolean agreeToTerms = null;
/**
* Indicates agreement to the data protection statement (required)
*/
@ApiMember(Description="Indicates agreement to the data protection statement (required)", IsRequired=true)
public Boolean agreeToDataProtection = null;
/**
* Indicates consent to be contacted (optional)
*/
@ApiMember(Description="Indicates consent to be contacted (optional)")
public Boolean agreeToContact = null;
/**
* Indicates agreement to the privacy policy (required)
*/
@ApiMember(Description="Indicates agreement to the privacy policy (required)", IsRequired=true)
public Boolean agreeToPrivacy = null;
/**
* An optional voucher code for discounts or promotions
*/
@ApiMember(Description="An optional voucher code for discounts or promotions")
public String voucherCode = null;
/**
* An optional code that grants access to certain features or subscriptions
*/
@ApiMember(Description="An optional code that grants access to certain features or subscriptions")
public String accountActivationCode = null;
/**
* The company's VAT registration number (if applicable)
*/
@ApiMember(Description="The company's VAT registration number (if applicable)")
public String vatNumber = null;
/**
* The country where the company is VAT-registered
*/
@ApiMember(Description="The country where the company is VAT-registered")
public String vatCountry = null;
public String getUsername() { return username; }
public RegisterAccountRequest setUsername(String value) { this.username = value; return this; }
public String getPassword() { return password; }
public RegisterAccountRequest setPassword(String value) { this.password = value; return this; }
public String getEmail() { return email; }
public RegisterAccountRequest setEmail(String value) { this.email = value; return this; }
public String getFullName() { return fullName; }
public RegisterAccountRequest setFullName(String value) { this.fullName = value; return this; }
public String getCompanyName() { return companyName; }
public RegisterAccountRequest setCompanyName(String value) { this.companyName = value; return this; }
public String getCompanyPhone() { return companyPhone; }
public RegisterAccountRequest setCompanyPhone(String value) { this.companyPhone = value; return this; }
public String getAddress1() { return address1; }
public RegisterAccountRequest setAddress1(String value) { this.address1 = value; return this; }
public String getAddress2() { return address2; }
public RegisterAccountRequest setAddress2(String value) { this.address2 = value; return this; }
public String getAddress3() { return address3; }
public RegisterAccountRequest setAddress3(String value) { this.address3 = value; return this; }
public String getCity() { return city; }
public RegisterAccountRequest setCity(String value) { this.city = value; return this; }
public String getPostcode() { return postcode; }
public RegisterAccountRequest setPostcode(String value) { this.postcode = value; return this; }
public String getCountry() { return country; }
public RegisterAccountRequest setCountry(String value) { this.country = value; return this; }
public String getCompanyType() { return companyType; }
public RegisterAccountRequest setCompanyType(String value) { this.companyType = value; return this; }
public String getCompanyIndustry() { return companyIndustry; }
public RegisterAccountRequest setCompanyIndustry(String value) { this.companyIndustry = value; return this; }
public String getCompanyNetwork() { return companyNetwork; }
public RegisterAccountRequest setCompanyNetwork(String value) { this.companyNetwork = value; return this; }
public Boolean isAgreeToTerms() { return agreeToTerms; }
public RegisterAccountRequest setAgreeToTerms(Boolean value) { this.agreeToTerms = value; return this; }
public Boolean isAgreeToDataProtection() { return agreeToDataProtection; }
public RegisterAccountRequest setAgreeToDataProtection(Boolean value) { this.agreeToDataProtection = value; return this; }
public Boolean isAgreeToContact() { return agreeToContact; }
public RegisterAccountRequest setAgreeToContact(Boolean value) { this.agreeToContact = value; return this; }
public Boolean isAgreeToPrivacy() { return agreeToPrivacy; }
public RegisterAccountRequest setAgreeToPrivacy(Boolean value) { this.agreeToPrivacy = value; return this; }
public String getVoucherCode() { return voucherCode; }
public RegisterAccountRequest setVoucherCode(String value) { this.voucherCode = value; return this; }
public String getAccountActivationCode() { return accountActivationCode; }
public RegisterAccountRequest setAccountActivationCode(String value) { this.accountActivationCode = value; return this; }
public String getVatNumber() { return vatNumber; }
public RegisterAccountRequest setVatNumber(String value) { this.vatNumber = value; return this; }
public String getVatCountry() { return vatCountry; }
public RegisterAccountRequest setVatCountry(String value) { this.vatCountry = value; return this; }
}
@DataContract
public static class RegisterAccountResponse
{
/**
* The response data
*/
@DataMember
@ApiMember(Description="The response data")
public RegisterAccountData data = null;
public RegisterAccountData getData() { return data; }
public RegisterAccountResponse setData(RegisterAccountData value) { this.data = value; return this; }
}
public static class RegisterAccountData extends BaseResponse
{
/**
* A unique identifier for the users API access
*/
@ApiMember(Description="A unique identifier for the users API access")
public String apiUserId = null;
/**
* A secure, randomly generated key used for API authentication
*/
@ApiMember(Description="A secure, randomly generated key used for API authentication")
public String apiUserKey = null;
public String getApiUserId() { return apiUserId; }
public RegisterAccountData setApiUserId(String value) { this.apiUserId = value; return this; }
public String getApiUserKey() { return apiUserKey; }
public RegisterAccountData setApiUserKey(String value) { this.apiUserKey = value; return this; }
}
public static class BaseResponse implements IBaseDataResponse, IHasResponseStatus
{
/**
* The status of the response
*/
@ApiMember(Description="The status of the response")
public ResponseStatus responseStatus = null;
public ResponseStatus getResponseStatus() { return responseStatus; }
public BaseResponse setResponseStatus(ResponseStatus value) { this.responseStatus = value; return this; }
}
public static class ArrayOfResponseError extends ArrayList<ResponseError>
{
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .soap12 suffix or ?format=soap12
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /soap12 HTTP/1.1
Host: api.sanctionssearch.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<RegisterAccount xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
<Authentication>
<ApiUserId>String</ApiUserId>
<ApiUserKey>String</ApiUserKey>
</Authentication>
<Request>
<AccountActivationCode>String</AccountActivationCode>
<Address1>String</Address1>
<Address2>String</Address2>
<Address3>String</Address3>
<AgreeToContact>false</AgreeToContact>
<AgreeToDataProtection>false</AgreeToDataProtection>
<AgreeToPrivacy>false</AgreeToPrivacy>
<AgreeToTerms>false</AgreeToTerms>
<City>String</City>
<CompanyIndustry>String</CompanyIndustry>
<CompanyName>String</CompanyName>
<CompanyNetwork>String</CompanyNetwork>
<CompanyPhone>String</CompanyPhone>
<CompanyType>String</CompanyType>
<Country>String</Country>
<Email>String</Email>
<FullName>String</FullName>
<Password>String</Password>
<Postcode>String</Postcode>
<Username>String</Username>
<VATCountry>String</VATCountry>
<VATNumber>String</VATNumber>
<VoucherCode>String</VoucherCode>
</Request>
</RegisterAccount>
</soap12:Body>
</soap12:Envelope>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <RegisterAccountResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types"> <Data> <ResponseStatus> <ErrorCode>String</ErrorCode> <Message>String</Message> <StackTrace>String</StackTrace> <Errors> <ResponseError> <ErrorCode>String</ErrorCode> <FieldName>String</FieldName> <Message>String</Message> <Meta xmlns:d6p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d6p1:KeyValueOfstringstring> <d6p1:Key>String</d6p1:Key> <d6p1:Value>String</d6p1:Value> </d6p1:KeyValueOfstringstring> </Meta> </ResponseError> </Errors> <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringstring> <d4p1:Key>String</d4p1:Key> <d4p1:Value>String</d4p1:Value> </d4p1:KeyValueOfstringstring> </Meta> </ResponseStatus> <ApiUserId>String</ApiUserId> <ApiUserKey>String</ApiUserKey> </Data> </RegisterAccountResponse> </soap12:Body> </soap12:Envelope>