POST | /api/Security | ||
---|---|---|---|
POST | /api/Security/{token} |
// @DataContract
export class BaseRequest
{
/** @description This is your AIM API Key provided by Tri-Tech */
// @DataMember
// @ApiMember(DataType="string", Description="This is your AIM API Key provided by Tri-Tech", IsRequired=true, Name="ApiKey", ParameterType="header")
public ApiKey: string;
// @DataMember
// @ApiMember(DataType="string", Name="OAuthToken", ParameterType="header")
public OAuthToken: string;
public constructor(init?: Partial<BaseRequest>) { (Object as any).assign(this, init); }
}
// @DataContract
export class BaseResponseResult
{
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="StatusCode", ParameterType="body")
public StatusCode: string;
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="Login", ParameterType="body")
public Login: string;
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorCode", ParameterType="body")
public ErrorCode: string;
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorDisplayText", ParameterType="body")
public ErrorDisplayText: string;
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", Name="ErrorMessage", ParameterType="body")
public ErrorMessage: string;
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="DomainName", ParameterType="body")
public DomainName: string;
/** @description */
// @DataMember
// @ApiMember(DataType="string", Description="", ExcludeInSchema=true, Name="IPAddress", ParameterType="body")
public IpAddress: string;
public constructor(init?: Partial<BaseResponseResult>) { (Object as any).assign(this, init); }
}
// @DataContract
export class BaseResponse
{
/** @description */
// @DataMember
// @ApiMember(DataType="BaseResponseResult", Description="", Name="Status", ParameterType="body")
public Status: BaseResponseResult;
public constructor(init?: Partial<BaseResponse>) { (Object as any).assign(this, init); }
}
// @DataContract
export class UserDetail
{
// @DataMember
public Firstname: string;
// @DataMember
public LastName: string;
// @DataMember
public Email: string;
// @DataMember
public Type: string;
// @DataMember
public Location: string;
// @DataMember
public LocationName: string;
// @DataMember
public AccountNumber?: number;
// @DataMember
public TaxAuthority: string;
// @DataMember
public TaxAuthorityName: string;
public constructor(init?: Partial<UserDetail>) { (Object as any).assign(this, init); }
}
// @DataContract
export class AccountDetail
{
// @DataMember
public Acct: number;
// @DataMember
public AcctType: string;
// @DataMember
public Name: string;
public constructor(init?: Partial<AccountDetail>) { (Object as any).assign(this, init); }
}
// @DataContract
export class SecurityResponse extends BaseResponse
{
// @DataMember
public Token: string;
// @DataMember
public OAuthToken: string;
// @DataMember
public Domain: string;
// @DataMember
public IsAdmin: boolean;
// @DataMember
public UserDetails: UserDetail;
// @DataMember
public AccountDetails: AccountDetail[];
public constructor(init?: Partial<SecurityResponse>) { super(init); (Object as any).assign(this, init); }
}
/** @description Login Service */
// @DataContract
export class SecurityRequest extends BaseRequest
{
/** @description Employee ID or Customer Email */
// @DataMember
// @ApiMember(DataType="string", Description="Employee ID or Customer Email", IsRequired=true, Name="Username", ParameterType="query")
public Username: string;
/** @description Existing Token */
// @DataMember
// @ApiMember(DataType="string", Description="Existing Token", Name="Token", ParameterType="query")
public Token: string;
/** @description Password of Employee or User */
// @DataMember
// @ApiMember(DataType="string", Description="Password of Employee or User", IsRequired=true, Name="Password", ParameterType="query")
public Password: string;
/** @description */
// @DataMember(Name="DeviceID")
// @ApiMember(DataType="string", Description="", IsRequired=true, Name="DeviceID", ParameterType="query")
public DeviceID: string;
/** @description */
// @DataMember(Name="AppID")
// @ApiMember(DataType="string", Description="", IsRequired=true, Name="AppID", ParameterType="query")
public AppID: string;
/** @description */
// @DataMember(Name="Acct")
// @ApiMember(DataType="int", Description="", Name="Acct", ParameterType="query")
public Acct?: number;
/** @description */
// @DataMember(Name="DeviceName")
// @ApiMember(DataType="string", Description="", Name="DeviceName", ParameterType="query")
public DeviceName: string;
public constructor(init?: Partial<SecurityRequest>) { super(init); (Object as any).assign(this, init); }
}
TypeScript SecurityRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/Security HTTP/1.1
Host: active-ewebservice.biz
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"Username":"String","Token":"String","Password":"String","DeviceID":"String","AppID":"String","Acct":0,"DeviceName":"String","ApiKey":"String","OAuthToken":"String"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"Token":"String","OAuthToken":"String","Domain":"String","IsAdmin":false,"UserDetails":{"Firstname":"String","LastName":"String","Email":"String","Type":"String","Location":"String","LocationName":"String","AccountNumber":0,"TaxAuthority":"String","TaxAuthorityName":"String"},"AccountDetails":[{"Acct":0,"AcctType":"String","Name":"String"}],"Status":{"StatusCode":"String","Login":"String","ErrorCode":"String","ErrorDisplayText":"String","ErrorMessage":"String","DomainName":"String","IpAddress":"String"}}