Request Interface Web Service methods are used to implement UPI requests within WebTMA. The service uses JSON-formatted request and response messages to exchange data. All of the methods shown below use POST process to send and/or receive data to/from WebTMA.
The following documentation assumes you know the existing rules for UPI. This is merely a new source / destination for the data. Otherwise all existing UPI rules apply.
In each call to either an Import or Export method, the correct Universal Interface Template Code for the corresponding transaction is required ("UISetupCode").
Authenticate JSON
This service method is used to generate an authentication token for use with the other service methods. The POST request must include a Content-Type header of “application/json”.
POST URL:
https://www.webtma.com/UIService/webservice/RequestInterface.svc/AuthenticateJson
REQUEST FORMAT:
{
"Username" : "user name",
"Password" : "password",
"Client" : "login client name"
}
RESPONSE Format:
{
"Success" : true,
"Message" : "User Authenticated.",
"Token" : "KU%2b7j2Lno92o%2bJ3J7IgvBKlnSzMpAuHh2NAqFWgnYytcyknP7ou5OP3O%2bxOVGEOV%2fkaE%2fqFvIM9cdXecfPeeu1%2broPnF",
"ExpDate" : "\/Date(1542814039490)\/"
}
Vendor Import JSON
This service method is used to import Vendors into WebTMA. The POST request must include a Content-Type header of “application/json” and a TMAAuth HTTP header with a valid authentication token from the Authenticate method.
UPI processes Vendor records and continues processing subsequent records even if it processes a record that generates an error.
POST URL:
https://www.webtma.com/UIService/webservice/RequestInterface.svc/UPIVendorImport
REQUEST FORMAT:
{
"UISetupCode" : "WSV",
"VendorList" : [
{
"Code" : "AAAA",
"Name" : "value",
"TypeCode" : "1010",
"URL" : "value",
"Email" : "value",
"Comment" : "value",
"Active" : "true",
"Term" : "value",
"ECRICode" : 150,
"IsContractor" : "false",
"IsVendor" : "true",
"IsManufacturer" : "false",
"IsBroker" : "false",
"PCardBlock" : "false",
"RepairCenterCode" : "AX1",
"CustomerNumber" : "value",
"DiscountDays" : "1",
"DiscountPercentage" : "0.0",
"InsuranceAmount" : "0.0",
"InsuranceExpiration" : "01/01/2010",
"Rating" : "value",
"SICCode" : "value",
"CompanySize" : "12",
"TaxCode" : "value",
"TaxID" : "value",
"AccountNumber" : "value",
"Address1" : "value",
"Address2" : "value",
"PhoneNumber" : "value",
"PhoneExtension" : "value",
"State" : "value",
"City" : "value",
"ZipCode" : "value",
"Contact" : "value",
"Fax" : "value",
"Category" : "value",
"LockedOut" : "false",
"TaxableOTP" : "false",
"CreditLimit" : "null",
"AlternateID" : "value",
"UdfValues" : "null",
}
]
}
RESPONSE FORMAT:
{
"ErrorCode" : null,
"ErrorMessage" : null,
"Success" : true
}
Vendor Import JSON (Examples)
Vendor Import
{
"UISetupCode" : "WSV",
"VendorList" : [
{
"Code" : "TJS-C0",
"Name" : "",
"TypeCode" : "1010",
"RepairCenterCode" : "AX1"
},
{
"Code" : "TJS-C0",
"Name" : "",
"TypeCode" : "1010",
"RepairCenterCode" : "AX1"
}
]
{
"Code" : "TJS-D0",
"Name" : "TJS-D0 Name",
"TypeCode" : "1010",
"RepairCenterCode" : "AX1"
}
]
}
Vendor Import Response
{
"ErrorCode":"UPI_DATA_ERROR",
"ErrorMessage":"VendorCode: TJS-C0 - Vendor Name is required to have a value",
"Success":false
}
In this example, the first Vendor did not import because of invalid data (no name); however, the second Vendor was imported.
The return message includes the Vendor Code indicating which record failed. The response also indicates a new ErrorCode (UPI_DATA_ERROR) indicating that the error has to do with value validation. The existing ErrorCode (UPI_PROCESS_ERROR) is returned for any non-value validation errors, such as invalid JSON formatting, connectivity issues, invalid authorization, etc.
An individual record stops processing as soon as it encounters the first error.
For example, if a vendor has an invalid name and an invalid type, the error message only indicates that the name is invalid. Once UI sees that the name is invalid, the record is rejected and the fact that the type is invalid is never tested.
If the Vendor Code is missing, there is no unique value to return to the error message.
Note: The process also applies to the PO Line Import mechanism.
Want to Know More?
Visit the WebTMA Help Page