| POST | /api/DeliveryTickets |
|---|
"use strict";
export class BaseRequest {
/** @param {{ApiKey?:string,OAuthToken?:string,DeviceId?:string,AppId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description This is your AIM API Key provided by Tri-Tech */
ApiKey;
/**
* @type {string}
* @description The OAuthToken token return by AeServices30 */
OAuthToken;
/**
* @type {string}
* @description The Device ID of the Mobile Device. Not used for non-mobile devices. */
DeviceId;
/**
* @type {string}
* @description An identifier for your integration */
AppId;
}
export class BaseSecureRequest extends BaseRequest {
/** @param {{Token?:string,ApiKey?:string,OAuthToken?:string,DeviceId?:string,AppId?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {string}
* @description The Login Token return by the Security API. Required for secured calls. */
Token;
}
export class BaseResponseResult {
/** @param {{StatusCode?:string,Login?:string,ErrorCode?:string,ErrorDisplayText?:string,ErrorMessage?:string,DomainName?:string,IpAddress?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
StatusCode;
/** @type {string} */
Login;
/** @type {string} */
ErrorCode;
/** @type {string} */
ErrorDisplayText;
/** @type {string} */
ErrorMessage;
/** @type {string} */
DomainName;
/** @type {string} */
IpAddress;
}
export class BaseResponse {
/** @param {{Status?:BaseResponseResult}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {BaseResponseResult} */
Status;
}
export class DependentAttribute {
/** @param {{Attribute?:string,AttributeValue?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Attribute;
/** @type {string} */
AttributeValue;
}
export class Base64Image {
/** @param {{Data?:string,FileName?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
Data;
/** @type {string} */
FileName;
}
export class DeliveryItem {
/** @param {{Quantity?:number,Item?:string,Description?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
Quantity;
/** @type {string} */
Item;
/** @type {string} */
Description;
}
export class DeliveryTicket {
/** @param {{RefNumber?:string,Date?:string,AccountNumber?:number,Name?:string,Address?:string,Address2?:string,City?:string,State?:string,ZipCode?:string,Student?:string,Contact?:string,Delivered?:boolean,District?:string,School?:string,DeliveryEmployee?:string,TimeFrame?:string,CreatedDate?:string,DependentAttributes?:DependentAttribute[],TicketType?:string,HasImages?:boolean,HasSignature?:boolean,Base64Signature?:string,Notes?:string,Images?:Base64Image[],DeliveryItems?:DeliveryItem[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
RefNumber;
/** @type {string} */
Date;
/** @type {number} */
AccountNumber;
/** @type {string} */
Name;
/** @type {string} */
Address;
/** @type {string} */
Address2;
/** @type {string} */
City;
/** @type {string} */
State;
/** @type {string} */
ZipCode;
/** @type {string} */
Student;
/** @type {string} */
Contact;
/** @type {boolean} */
Delivered;
/** @type {string} */
District;
/** @type {string} */
School;
/** @type {string} */
DeliveryEmployee;
/** @type {string} */
TimeFrame;
/** @type {string} */
CreatedDate;
/** @type {DependentAttribute[]} */
DependentAttributes;
/** @type {string} */
TicketType;
/** @type {boolean} */
HasImages;
/** @type {boolean} */
HasSignature;
/** @type {string} */
Base64Signature;
/** @type {string} */
Notes;
/** @type {Base64Image[]} */
Images;
/** @type {DeliveryItem[]} */
DeliveryItems;
}
export class DeliveryTicketsResponse extends BaseResponse {
/** @param {{Tickets?:DeliveryTicket[],Status?:BaseResponseResult}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {DeliveryTicket[]} */
Tickets;
}
export class DeliveryTicketItem {
/** @param {{RefNumber?:string,Delivered?:boolean,Images?:Base64Image[],Base64Signature?:string,ImagesToDelete?:string[],Notes?:string,Longitude?:number,Latitude?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
RefNumber;
/** @type {boolean} */
Delivered;
/** @type {Base64Image[]} */
Images;
/** @type {string} */
Base64Signature;
/** @type {string[]} */
ImagesToDelete;
/** @type {string} */
Notes;
/** @type {number} */
Longitude;
/** @type {number} */
Latitude;
}
export class DeliveryTicketsPostRequest extends BaseSecureRequest {
/** @param {{DeliveryTickets?:DeliveryTicketItem[],Token?:string,ApiKey?:string,OAuthToken?:string,DeviceId?:string,AppId?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/** @type {DeliveryTicketItem[]} */
DeliveryTickets;
}
JavaScript DeliveryTicketsPostRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /api/DeliveryTickets HTTP/1.1
Host: active-ewebservice.biz
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<DeliveryTicketsPostRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<ApiKey>String</ApiKey>
<AppId>String</AppId>
<DeviceId>String</DeviceId>
<OAuthToken>String</OAuthToken>
<Token>String</Token>
<DeliveryTickets>
<DeliveryTicketItem>
<Base64Signature>String</Base64Signature>
<Delivered>false</Delivered>
<Images>
<Base64Image>
<Data>String</Data>
<FileName>String</FileName>
</Base64Image>
</Images>
<ImagesToDelete xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d4p1:string>String</d4p1:string>
</ImagesToDelete>
<Latitude>0</Latitude>
<Longitude>0</Longitude>
<Notes>String</Notes>
<RefNumber>String</RefNumber>
</DeliveryTicketItem>
</DeliveryTickets>
</DeliveryTicketsPostRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DeliveryTicketsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/AIM.WebService">
<Status>
<DomainName>String</DomainName>
<ErrorCode>String</ErrorCode>
<ErrorDisplayText>String</ErrorDisplayText>
<ErrorMessage>String</ErrorMessage>
<IpAddress>String</IpAddress>
<Login>String</Login>
<StatusCode>String</StatusCode>
</Status>
<Tickets>
<DeliveryTicket>
<AccountNumber>0</AccountNumber>
<Address>String</Address>
<Address2>String</Address2>
<Base64Signature>String</Base64Signature>
<City>String</City>
<Contact>String</Contact>
<CreatedDate>0001-01-01T00:00:00</CreatedDate>
<Date>0001-01-01T00:00:00</Date>
<Delivered>false</Delivered>
<DeliveryEmployee>String</DeliveryEmployee>
<DeliveryItems>
<DeliveryItem>
<Description>String</Description>
<Item>String</Item>
<Quantity>0</Quantity>
</DeliveryItem>
</DeliveryItems>
<DependentAttributes>
<DependentAttribute>
<Attribute>String</Attribute>
<AttributeValue>String</AttributeValue>
</DependentAttribute>
</DependentAttributes>
<District>String</District>
<HasImages>false</HasImages>
<HasSignature>false</HasSignature>
<Images>
<Base64Image>
<Data>String</Data>
<FileName>String</FileName>
</Base64Image>
</Images>
<Name>String</Name>
<Notes>String</Notes>
<RefNumber>String</RefNumber>
<School>String</School>
<State>String</State>
<Student>String</Student>
<TicketType>String</TicketType>
<TimeFrame>String</TimeFrame>
<ZipCode>String</ZipCode>
</DeliveryTicket>
</Tickets>
</DeliveryTicketsResponse>