Work Orders (GJZJ18J)
The GJZJ18J function creates new Work Orders and exports existing Work Order data. Incoming rows are sent via WO_WorkOrders_tbl; customers, sites and technicians are all referenced by their Jonas codes.
WebMethod
GJZJ18JOptions overview
| Option | Purpose |
|---|---|
schema | The JSON schema returned by Option: schema for Work Orders. |
template | An empty Work Order template you can populate and send back with Option: update. |
download | An existing Work Order exported via Option: download. |
scan | Validate a Work Order payload before committing. The error response lists which rows and fields failed. |
import | Once the scan is clean, switch Option to import (the Work Order equivalent of update) to create or update the records. |
Schema
The JSON schema returned by Option: schema for Work Orders.
Work Order SchemaSOAP envelope
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<JonasAPIResponse xmlns="jonas.jonasportal.com/">
<JonasAPIResult>{"isAuthenticated":true,"isValid":true,"Data: {"$schema":"http://json-schema.org/draft-04/schema#","name":"Work Order Upload","type":"object","additionalProperties":false,"required":["WebMethod","Option","CompanyCode","ARSubledgerCode"],"properties":{"WebMethod":{"enum":["GJZJ18J"]},"Option":{"enum":["scan","update","schema","template","download"]},"CompanyCode":{"type":"string","pattern":"^[^a-z]*$","maxLength":2},"WO_Headers_tbl":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["WorkOrderNumber","OrderDate","CustomerCode"],"properties":{"WorkOrderNumber":{"type":"string","minLength":1,"maxLength":10,"pattern":"^[^a-z]*$"},"OrderDate":{"type":"string","format":"date-time"},"CustomerCode":{"type":"string","minLength":1,"maxLength":10,"pattern":"^[^a-z]*$"},"WorkOrderCategory":{"type":"string","enum":["1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},"ReferenceNumber":{"type":"string","maxLength":13,"pattern":"^[^a-z]*$"},"BillType":{"type":"string","enum":["B","C","P","J","F"]},"JobAddressLine1":{"type":"string","maxLength":30},"JobAddressLine2":{"type":"string","maxLength":30},"JobAddressLine3":{"type":"string","maxLength":30},"ContactName":{"type":"string","maxLength":15},"TerritoryMap":{"type":"string","maxLength":10,"pattern":"^[^a-z]*$"},"TechnicianID":{"type":"string","maxLength":5,"pattern":"^[^a-z]*$"},"SalesCategoryCode":{"type":"string","maxLength":10,"pattern":"^[^a-z]*$"},"WOStatusCode":{"type":"string","maxLength":4,"pattern":"^[^a-z]*$"},"CompletelyBilled":{"type":"string","enum":["Y","N"]},"QuotedPrice":{"type":"number","multipleOf":0.01,"minimum":-999999.99,"maximum":999999.99},"ScheduledDate":{"type":"string","format":"date-time"},"BillingDate":{"type":"string","format":"date-time"},"InvoiceNumber":{"type":"string","maxLength":10},"ServiceContractNumber":{"type":"string","maxLength":10,"pattern":"^[^a-z]*$"},"DispatchPriority":{"type":"string","maxLength":2,"pattern":"^[^a-z]*$"},"DispatchEstimatedHours":{"type":"number","multipleOf":0.01,"maximum":999.99},"NewPurchaseOrderNumber":{"type":"string","maxLength":15},"WO_DescriptionOfWork_tbl":{"type":"array","maxItems":6,"items":{"type":"object","additionalProperties":false,"properties":{"WorkDescription":{"type":"string","maxLength":60}}}}}}},"ARSubledgerCode":{"type":"string","pattern":"^[^a-z]*$","maxLength":5}}}
</JonasAPIResult>
</JonasAPIResponse>
</soap:Body></soap:Envelope>Template
An empty Work Order template you can populate and send back with Option: update.
Work Order TemplateSOAP envelope
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body><JonasAPIResponse xmlns="jonas.jonasportal.com/">
<JonasAPIResult>{"isAuthenticated":true,"isValid":true,"Data: {"$schema":"http://json-schema.org/draft-04/schema#","name":"Work Order Upload","type":"object","additionalProperties":false,"required":["WebMethod","Option","CompanyCode","ARSubledgerCode"],"properties":{"WebMethod":{"enum":["GJZJ18J"]},"Option":{"enum":["scan","update","schema","template","download"]},"CompanyCode":{"type":"string","pattern":"^[^a-z]*$","maxLength":2},"WO_Headers_tbl":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["WorkOrderNumber","OrderDate","CustomerCode"],"properties":{"WorkOrderNumber":{"type":"string","minLength":1,"maxLength":10,"pattern":"^[^a-z]*$"},"OrderDate":{"type":"string","format":"date-time"},"CustomerCode":{"type":"string","minLength":1,"maxLength":10,"pattern":"^[^a-z]*$"},"WorkOrderCategory":{"type":"string","enum":["1","2","3","4","5","6","7","8","9","0","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]},"ReferenceNumber":{"type":"string","maxLength":13,"pattern":"^[^a-z]*$"},"BillType":{"type":"string","enum":["B","C","P","J","F"]},"JobAddressLine1":{"type":"string","maxLength":30},"JobAddressLine2":{"type":"string","maxLength":30},"JobAddressLine3":{"type":"string","maxLength":30},"ContactName":{"type":"string","maxLength":15},"TerritoryMap":{"type":"string","maxLength":10,"pattern":"^[^a-z]*$"},"TechnicianID":{"type":"string","maxLength":5,"pattern":"^[^a-z]*$"},"SalesCategoryCode":{"type":"string","maxLength":10,"pattern":"^[^a-z]*$"},"WOStatusCode":{"type":"string","maxLength":4,"pattern":"^[^a-z]*$"},"CompletelyBilled":{"type":"string","enum":["Y","N"]},"QuotedPrice":{"type":"number","multipleOf":0.01,"minimum":-999999.99,"maximum":999999.99},"ScheduledDate":{"type":"string","format":"date-time"},"BillingDate":{"type":"string","format":"date-time"},"InvoiceNumber":{"type":"string","maxLength":10},"ServiceContractNumber":{"type":"string","maxLength":10,"pattern":"^[^a-z]*$"},"DispatchPriority":{"type":"string","maxLength":2,"pattern":"^[^a-z]*$"},"DispatchEstimatedHours":{"type":"number","multipleOf":0.01,"maximum":999.99},"NewPurchaseOrderNumber":{"type":"string","maxLength":15},"WO_DescriptionOfWork_tbl":{"type":"array","maxItems":6,"items":{"type":"object","additionalProperties":false,"properties":{"WorkDescription":{"type":"string","maxLength":60}}}}}}},"ARSubledgerCode":{"type":"string","pattern":"^[^a-z]*$","maxLength":5}}}
</JonasAPIResult></JonasAPIResponse></soap:Body></soap:Envelope>Download
An existing Work Order exported via Option: download.
Work Order DownloadSOAP envelope
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><JonasAPIResponse xmlns="jonas.jonasportal.com/"><JonasAPIResult>{"isAuthenticated":true,"isValid":true,"Data: {"WebMethod":"GJZJ18J","Option":"download","CompanyCode":"JC","ARSubledgerCode":"G1","WO_Headers_tbl":[{"WorkOrderNumber":"0000000005","CustomerCode":"TESTCUST02","WorkOrderCategory":"1","SalesCategoryCode":"","BillType":"B","WO_DescriptionOfWork_tbl":[{"WorkDescription":"Testing"},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""}],"DispatchPriority":" 5","WOStatusCode":"O","NewPurchaseOrderNumber":"","PREFIX_WO":"W/O","JobAddressLine1":"123 Fourth Street","JobAddressLine2":"Suite 5","JobAddressLine3":" M4R7Y6","ScheduledDate":"2014-07-14T00:00:00Z","OrderDate":"2014-07-14T00:00:00Z","ContactName":"jonas","TechnicianID":"","ReferenceNumber":"","DispatchEstimatedHours":0.00,"ServiceContractNumber":"","CompletelyBilled":"","BillingDate":"N/A","InvoiceNumber":"","QuotedPrice":0,"TerritoryMap":"CENTRAL"}]}</JonasAPIResult></JonasAPIResponse></soap:Body></soap:Envelope>Scan
Validate a Work Order payload before committing. The error response lists which rows and fields failed.
Work Order Scan CallSOAP envelope
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jon="jonas.jonasportal.com/">
<soapenv:Header/>
<soapenv:Body>
<jon:JonasAPI>
<!--Optional:-->
<jon:securityToken>fe02f84b459a4a317dd6080678bd8140</jon:securityToken>
<!--Optional:-->
<jon:username>****</jon:username>
<!--Optional:-->
<jon:password>****</jon:password>
<!--Optional:-->
<jon:apiParams>
{"WebMethod":"GJZJ18J","Option":"scan","CompanyCode":"ET","ARSubledgerCode":"G1","WO_Headers_tbl":[{"WorkOrderNumber":"0000000005","CustomerCode":"TESTCUST02","WorkOrderCategory":"1","SalesCategoryCode":"","BillType":"B","WO_DescriptionOfWork_tbl":[{"WorkDescription":"Testing"},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""}],"DispatchPriority":" 5","WOStatusCode":"O","NewPurchaseOrderNumber":"","PREFIX_WO":"W/O","JobAddressLine1":"123 Fourth Street","JobAddressLine2":"Suite 5","JobAddressLine3":" M4R7Y6","ScheduledDate":"2014-07-14T00:00:00Z","OrderDate":"2014-07-14T00:00:00Z","ContactName":"jonas","TechnicianID":"","ReferenceNumber":"","DispatchEstimatedHours":0.00,"ServiceContractNumber":"","CompletelyBilled":"","BillingDate":"N/A","InvoiceNumber":"","QuotedPrice":0,"TerritoryMap":"CENTRAL"}]}
</jon:apiParams>
</jon:JonasAPI>
</soapenv:Body>
</soapenv:Envelope>Work Order Scan Call Error ResponseSOAP envelope
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><JonasAPIResponse xmlns="jonas.jonasportal.com/"><JonasAPIResult>{"isAuthenticated":true,"isValid":true,"Data: {"WebMethod":"GJZJ18J","Option":"scan","CompanyCode":"ET","ARSubledgerCode":"G1","errors":["Invalid CompanyCode"]}</JonasAPIResult></JonasAPIResponse></soap:Body></soap:Envelope>Import
Once the scan is clean, switch Option to import (the Work Order equivalent of update) to create or update the records.
Work Order ImportSOAP envelope
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:jon="jonas.jonasportal.com/">
<soapenv:Header/>
<soapenv:Body>
<jon:JonasAPI>
<!--Optional:-->
<jon:securityToken>fe02f84b459a4a317dd6080678bd8140</jon:securityToken>
<!--Optional:-->
<jon:username>****</jon:username>
<!--Optional:-->
<jon:password>****</jon:password>
<!--Optional:-->
<jon:apiParams>
{"WebMethod":"GJZJ18J","Option":"update","CompanyCode":"JC","ARSubledgerCode":"G1","WO_Headers_tbl":[{"WorkOrderNumber":"0000000099","CustomerCode":"TESTCUST02","WorkOrderCategory":"1","SalesCategoryCode":"1","BillType":"B","WO_DescriptionOfWork_tbl":[{"WorkDescription":"Testing"},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""},{"WorkDescription":""}],"DispatchPriority":" 5","WOStatusCode":"O","NewPurchaseOrderNumber":"","PREFIX_WO":"W/O","JobAddressLine1":"123 Fourth Street","JobAddressLine2":"Suite 5","JobAddressLine3":" M4R7Y6","ScheduledDate":"2014-07-14T00:00:00Z","OrderDate":"2014-07-14T00:00:00Z","ContactName":"jonas","TechnicianID":"","ReferenceNumber":"","DispatchEstimatedHours":0.00,"ServiceContractNumber":"","CompletelyBilled":"","BillingDate":"N/A","InvoiceNumber":"","QuotedPrice":0,"TerritoryMap":"CENTRAL"}]}
</jon:apiParams>
</jon:JonasAPI>
</soapenv:Body>
</soapenv:Envelope>Work Order Import ResponseSOAP envelope
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<JonasAPIResponse xmlns="jonas.jonasportal.com/">
<JonasAPIResult>{"message":"Login Successful : UserID GJSYSTEM (User 7/10) ","data":"{\"WebMethod\":\"GJZJ18J\",\"Option\":\"update\",\"CompanyCode\":\"JC\",\"ARSubledgerCode\":\"G1\",\"RecordsProcessed\":\"1\",\"ErrorsFound\":\"0\"}","isValid":true,"isAuthenticated":true}
</JonasAPIResult>
</JonasAPIResponse>
</soap:Body>
</soap:Envelope>