Billy Cole
06/25/2020, 1:02 AMlet update = new StatusUpdate(
employeeName,
location,
jobTitle,
status,
// Omiited for brevity
);
log.debug("UPDATE: ", update);
let headerObj = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
let resp = <http://http.post|http.post>({
url: "<http://myserverurl>", // ommitted
header: headerObj,
body: update
});
log.debug("Sent update to studio api. Response code: ", resp.code);
Eric B
06/25/2020, 1:18 AMBilly Cole
06/25/2020, 1:19 AMBilly Cole
06/25/2020, 1:19 AMBilly Cole
06/25/2020, 1:21 AMBilly Cole
06/25/2020, 1:21 AMbattk
06/25/2020, 1:22 AMBilly Cole
06/25/2020, 1:23 AMclass StatusUpdate {
constructor(
employeeName,
location,
jobTitle,
status,
// Ommitted for brevity)
}
battk
06/25/2020, 1:24 AMBilly Cole
06/25/2020, 1:25 AMBilly Cole
06/25/2020, 1:25 AM{
"employeeName": "Billy Cole",
"location": "California",
"jobTitle": "Software Engineer",
"status": "Printed",
"printer": "",
"numberPrinted": 1,
"numberSublimated": 0,
"numberCut": 0,
"numberSewn": 0,
"numberFinished": 0,
"numberReprints": 0,
"sku": "Display-pm1",
"timeElapsed": 0,
"breakTimeElasped": 0,
"rollId": 0,
"rollSku": "N/A",
"sqftPrinted": 0,
"sqftSublimated": 0,
"sqftCut": 0,
"sqftSewn": 0,
"sqftFolded": 0,
"sqftReprinted": 0,
"sewnRequired": 1,
"orderNumber": "SO-523414",
"sewingTime": 0,
"material": "",
"shipDate": "01/01/2020"
}
Billy Cole
06/25/2020, 1:25 AMbattk
06/25/2020, 1:25 AMBilly Cole
06/25/2020, 1:25 AMbattk
06/25/2020, 1:27 AMBilly Cole
06/25/2020, 1:29 AMBilly Cole
06/25/2020, 1:29 AMbattk
06/25/2020, 1:29 AMrequire(["N/http"], function (http) {
var headerObj = {
"Content-Type": "application/json",
Accept: "application/json",
};
var update = {
employeeName: "Billy Cole",
location: "California",
jobTitle: "Software Engineer",
status: "Printed",
printer: "",
numberPrinted: 1,
numberSublimated: 0,
numberCut: 0,
numberSewn: 0,
numberFinished: 0,
numberReprints: 0,
sku: "Display-pm1",
timeElapsed: 0,
breakTimeElasped: 0,
rollId: 0,
rollSku: "N/A",
sqftPrinted: 0,
sqftSublimated: 0,
sqftCut: 0,
sqftSewn: 0,
sqftFolded: 0,
sqftReprinted: 0,
sewnRequired: 1,
orderNumber: "SO-523414",
sewingTime: 0,
material: "",
shipDate: "01/01/2020",
};
var response = <http://http.post|http.post>({
url: "<http://httpbin.org/post>",
header: headerObj,
body: JSON.stringify(update),
});
log.debug("response", response);
});
Billy Cole
06/25/2020, 1:34 AMBilly Cole
06/25/2020, 1:34 AMBilly Cole
06/25/2020, 1:34 AMBilly Cole
06/25/2020, 1:34 AM