Create a new account |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using SanctionsSearch.Api2.ServiceModel.Operations.Account;
using SanctionsSearch.Api2.ServiceModel.Operations.Base;
using SanctionsSearch.Api2.ServiceModel.Types;
namespace SanctionsSearch.Api2.ServiceModel.Operations.Account
{
[DataContract]
public partial class RegisterAccount
: BaseRequest
{
[DataMember]
public virtual RegisterAccountRequest Request { get; set; }
}
public partial class RegisterAccountData
: BaseResponse
{
///<summary>
///A unique identifier for the users API access
///</summary>
[ApiMember(Description="A unique identifier for the users API access")]
public virtual string ApiUserId { get; set; }
///<summary>
///A secure, randomly generated key used for API authentication
///</summary>
[ApiMember(Description="A secure, randomly generated key used for API authentication")]
public virtual string ApiUserKey { get; set; }
}
public partial class RegisterAccountRequest
{
///<summary>
///The desired login username for the account
///</summary>
[ApiMember(Description="The desired login username for the account", IsRequired=true)]
public virtual string Username { get; set; }
///<summary>
///The password for account login
///</summary>
[ApiMember(Description="The password for account login", IsRequired=true)]
public virtual string Password { get; set; }
///<summary>
///The contact email address for the account holder
///</summary>
[ApiMember(Description="The contact email address for the account holder", IsRequired=true)]
public virtual string Email { get; set; }
///<summary>
///The full legal name of the account holder
///</summary>
[ApiMember(Description="The full legal name of the account holder", IsRequired=true)]
public virtual string FullName { get; set; }
///<summary>
///The registered name of the company associated with this account
///</summary>
[ApiMember(Description="The registered name of the company associated with this account", IsRequired=true)]
public virtual string CompanyName { get; set; }
///<summary>
///The primary contact phone number of the company
///</summary>
[ApiMember(Description="The primary contact phone number of the company", IsRequired=true)]
public virtual string CompanyPhone { get; set; }
///<summary>
///The first line of the company’s address (e.g., street name and number)
///</summary>
[ApiMember(Description="The first line of the company’s address (e.g., street name and number)", IsRequired=true)]
public virtual string Address1 { get; set; }
///<summary>
///The second line of the company’s address (optional)
///</summary>
[ApiMember(Description="The second line of the company’s address (optional)")]
public virtual string Address2 { get; set; }
///<summary>
///The third line of the company’s address (optional)
///</summary>
[ApiMember(Description="The third line of the company’s address (optional)")]
public virtual string Address3 { get; set; }
///<summary>
///The city where the company is located (optional)
///</summary>
[ApiMember(Description="The city where the company is located (optional)")]
public virtual string City { get; set; }
///<summary>
///The postal or ZIP code of the company’s address
///</summary>
[ApiMember(Description="The postal or ZIP code of the company’s address", IsRequired=true)]
public virtual string Postcode { get; set; }
///<summary>
///The country where the company is registered
///</summary>
[ApiMember(Description="The country where the company is registered", IsRequired=true)]
public virtual string Country { get; set; }
///<summary>
///The classification of the company (e.g., LLC, Corporation, Sole Proprietorship)
///</summary>
[ApiMember(Description="The classification of the company (e.g., LLC, Corporation, Sole Proprietorship)", IsRequired=true)]
public virtual string CompanyType { get; set; }
///<summary>
///The industry sector the company operates in
///</summary>
[ApiMember(Description="The industry sector the company operates in", IsRequired=true)]
public virtual string CompanyIndustry { get; set; }
///<summary>
///The trade body, network, or affiliation the company is a member of (if applicable)
///</summary>
[ApiMember(Description="The trade body, network, or affiliation the company is a member of (if applicable)")]
public virtual string CompanyNetwork { get; set; }
///<summary>
///Indicates agreement to the terms and conditions (required)
///</summary>
[ApiMember(Description="Indicates agreement to the terms and conditions (required)", IsRequired=true)]
public virtual bool AgreeToTerms { get; set; }
///<summary>
///Indicates agreement to the data protection statement (required)
///</summary>
[ApiMember(Description="Indicates agreement to the data protection statement (required)", IsRequired=true)]
public virtual bool AgreeToDataProtection { get; set; }
///<summary>
///Indicates consent to be contacted (optional)
///</summary>
[ApiMember(Description="Indicates consent to be contacted (optional)")]
public virtual bool AgreeToContact { get; set; }
///<summary>
///Indicates agreement to the privacy policy (required)
///</summary>
[ApiMember(Description="Indicates agreement to the privacy policy (required)", IsRequired=true)]
public virtual bool AgreeToPrivacy { get; set; }
///<summary>
///An optional voucher code for discounts or promotions
///</summary>
[ApiMember(Description="An optional voucher code for discounts or promotions")]
public virtual string VoucherCode { get; set; }
///<summary>
///An optional code that grants access to certain features or subscriptions
///</summary>
[ApiMember(Description="An optional code that grants access to certain features or subscriptions")]
public virtual string AccountActivationCode { get; set; }
///<summary>
///The company's VAT registration number (if applicable)
///</summary>
[ApiMember(Description="The company's VAT registration number (if applicable)")]
public virtual string VATNumber { get; set; }
///<summary>
///The country where the company is VAT-registered
///</summary>
[ApiMember(Description="The country where the company is VAT-registered")]
public virtual string VATCountry { get; set; }
}
[DataContract]
public partial class RegisterAccountResponse
{
///<summary>
///The response data
///</summary>
[DataMember]
[ApiMember(Description="The response data")]
public virtual RegisterAccountData Data { get; set; }
}
}
namespace SanctionsSearch.Api2.ServiceModel.Operations.Base
{
public partial class ArrayOfResponseError
: List<ResponseError>
{
}
[DataContract]
public partial class BaseRequest
: IBaseRequest
{
///<summary>
///The authentication credentials
///</summary>
[DataMember]
[ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")]
public virtual Authentication Authentication { get; set; }
}
public partial class BaseResponse
: IBaseDataResponse, IHasResponseStatus
{
///<summary>
///The status of the response
///</summary>
[ApiMember(Description="The status of the response")]
public virtual ResponseStatus ResponseStatus { get; set; }
}
[DataContract]
public partial class ResponseError
{
public ResponseError()
{
Meta = new Dictionary<string, string>{};
}
[DataMember(Order=1)]
public virtual string ErrorCode { get; set; }
[DataMember(Order=2)]
public virtual string FieldName { get; set; }
[DataMember(Order=3)]
public virtual string Message { get; set; }
[DataMember(Order=4)]
public virtual Dictionary<string, string> Meta { get; set; }
}
[DataContract]
public partial class ResponseStatus
{
public ResponseStatus()
{
Meta = new Dictionary<string, string>{};
}
[DataMember(Order=1)]
public virtual string ErrorCode { get; set; }
[DataMember(Order=2)]
public virtual string Message { get; set; }
[DataMember(Order=3)]
public virtual string StackTrace { get; set; }
[DataMember(Order=4)]
public virtual ArrayOfResponseError Errors { get; set; }
[DataMember(Order=5)]
public virtual Dictionary<string, string> Meta { get; set; }
}
}
namespace SanctionsSearch.Api2.ServiceModel.Types
{
[DataContract]
public partial class Authentication
{
///<summary>
///The API User ID provided by us when you signed up to use our API
///</summary>
[DataMember]
[ApiMember(Description="The API User ID provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")]
public virtual string ApiUserId { get; set; }
///<summary>
///The API User Key provided by us when you signed up to use our API
///</summary>
[DataMember]
[ApiMember(Description="The API User Key provided by us when you signed up to use our API", IsRequired=true, ParameterType="header, body")]
public virtual string ApiUserKey { get; set; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .soap11 suffix or ?format=soap11
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /soap11 HTTP/1.1
Host: api.sanctionssearch.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: RegisterAccount
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap: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>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap: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> </soap:Body> </soap:Envelope>