POST | /account/register | Create a new account |
---|
namespace SanctionsSearch.Api2.ServiceModel.Operations.Account
open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<DataContract>]
[<AllowNullLiteral>]
type ResponseError() =
[<DataMember(Order=1)>]
member val ErrorCode:String = null with get,set
[<DataMember(Order=2)>]
member val FieldName:String = null with get,set
[<DataMember(Order=3)>]
member val Message:String = null with get,set
[<DataMember(Order=4)>]
member val Meta:Dictionary<String, String> = new Dictionary<String, String>() with get,set
[<AllowNullLiteral>]
type ArrayOfResponseError() =
inherit ResizeArray<ResponseError>()
[<DataContract>]
[<AllowNullLiteral>]
type ResponseStatus() =
[<DataMember(Order=1)>]
member val ErrorCode:String = null with get,set
[<DataMember(Order=2)>]
member val Message:String = null with get,set
[<DataMember(Order=3)>]
member val StackTrace:String = null with get,set
[<DataMember(Order=4)>]
member val Errors:ArrayOfResponseError = null with get,set
[<DataMember(Order=5)>]
member val Meta:Dictionary<String, String> = new Dictionary<String, String>() with get,set
[<AllowNullLiteral>]
type BaseResponse() =
///<summary>
///The status of the response
///</summary>
[<ApiMember(Description="The status of the response")>]
member val ResponseStatus:ResponseStatus = null with get,set
[<AllowNullLiteral>]
type RegisterAccountData() =
inherit BaseResponse()
///<summary>
///A unique identifier for the users API access
///</summary>
[<ApiMember(Description="A unique identifier for the users API access")>]
member val ApiUserId:String = null with get,set
///<summary>
///A secure, randomly generated key used for API authentication
///</summary>
[<ApiMember(Description="A secure, randomly generated key used for API authentication")>]
member val ApiUserKey:String = null with get,set
[<DataContract>]
[<AllowNullLiteral>]
type RegisterAccountResponse() =
///<summary>
///The response data
///</summary>
[<DataMember>]
[<ApiMember(Description="The response data")>]
member val Data:RegisterAccountData = null with get,set
[<DataContract>]
[<AllowNullLiteral>]
type 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")>]
member val ApiUserId:String = null with 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")>]
member val ApiUserKey:String = null with get,set
[<DataContract>]
[<AllowNullLiteral>]
type BaseRequest() =
///<summary>
///The authentication credentials
///</summary>
[<DataMember>]
[<ApiMember(Description="The authentication credentials", IsRequired=true, ParameterType="header, body")>]
member val Authentication:Authentication = null with get,set
[<AllowNullLiteral>]
type RegisterAccountRequest() =
///<summary>
///The desired login username for the account
///</summary>
[<ApiMember(Description="The desired login username for the account", IsRequired=true)>]
member val Username:String = null with get,set
///<summary>
///The password for account login
///</summary>
[<ApiMember(Description="The password for account login", IsRequired=true)>]
member val Password:String = null with get,set
///<summary>
///The contact email address for the account holder
///</summary>
[<ApiMember(Description="The contact email address for the account holder", IsRequired=true)>]
member val Email:String = null with get,set
///<summary>
///The full legal name of the account holder
///</summary>
[<ApiMember(Description="The full legal name of the account holder", IsRequired=true)>]
member val FullName:String = null with 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)>]
member val CompanyName:String = null with get,set
///<summary>
///The primary contact phone number of the company
///</summary>
[<ApiMember(Description="The primary contact phone number of the company", IsRequired=true)>]
member val CompanyPhone:String = null with 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)>]
member val Address1:String = null with get,set
///<summary>
///The second line of the company’s address (optional)
///</summary>
[<ApiMember(Description="The second line of the company’s address (optional)")>]
member val Address2:String = null with get,set
///<summary>
///The third line of the company’s address (optional)
///</summary>
[<ApiMember(Description="The third line of the company’s address (optional)")>]
member val Address3:String = null with get,set
///<summary>
///The city where the company is located (optional)
///</summary>
[<ApiMember(Description="The city where the company is located (optional)")>]
member val City:String = null with 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)>]
member val Postcode:String = null with get,set
///<summary>
///The country where the company is registered
///</summary>
[<ApiMember(Description="The country where the company is registered", IsRequired=true)>]
member val Country:String = null with 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)>]
member val CompanyType:String = null with get,set
///<summary>
///The industry sector the company operates in
///</summary>
[<ApiMember(Description="The industry sector the company operates in", IsRequired=true)>]
member val CompanyIndustry:String = null with 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)")>]
member val CompanyNetwork:String = null with get,set
///<summary>
///Indicates agreement to the terms and conditions (required)
///</summary>
[<ApiMember(Description="Indicates agreement to the terms and conditions (required)", IsRequired=true)>]
member val AgreeToTerms:Boolean = new Boolean() with get,set
///<summary>
///Indicates agreement to the data protection statement (required)
///</summary>
[<ApiMember(Description="Indicates agreement to the data protection statement (required)", IsRequired=true)>]
member val AgreeToDataProtection:Boolean = new Boolean() with get,set
///<summary>
///Indicates consent to be contacted (optional)
///</summary>
[<ApiMember(Description="Indicates consent to be contacted (optional)")>]
member val AgreeToContact:Boolean = new Boolean() with get,set
///<summary>
///Indicates agreement to the privacy policy (required)
///</summary>
[<ApiMember(Description="Indicates agreement to the privacy policy (required)", IsRequired=true)>]
member val AgreeToPrivacy:Boolean = new Boolean() with get,set
///<summary>
///An optional voucher code for discounts or promotions
///</summary>
[<ApiMember(Description="An optional voucher code for discounts or promotions")>]
member val VoucherCode:String = null with 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")>]
member val AccountActivationCode:String = null with get,set
///<summary>
///The company's VAT registration number (if applicable)
///</summary>
[<ApiMember(Description="The company's VAT registration number (if applicable)")>]
member val VATNumber:String = null with get,set
///<summary>
///The country where the company is VAT-registered
///</summary>
[<ApiMember(Description="The country where the company is VAT-registered")>]
member val VATCountry:String = null with get,set
[<DataContract>]
[<AllowNullLiteral>]
type RegisterAccount() =
inherit BaseRequest()
[<DataMember>]
member val Request:RegisterAccountRequest = null with get,set
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
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"}}}}