Upload Web Services (REST) Upload Web Services (REST)

For an automated upload process, it is often convenient to use XML data formats instead of Excel worksheets. XML documents provide a flexible and easy way of interchanging data over the internet.

The upload format that is understood by Optimize My Day is very similar to the format defined in the sample Excel document. The XML example below shows a Plan XML containing two sample tasks.

<?xml version="1.0" encoding="UTF-8"?>

<Plan>

  <Task territory="C2" id="12345-01" name="Customer A" skill="HP4100MFP" estimatedDuration="60.0" earliest="2011-04-03 15:43" latest="2011-04-04 15:13" status="20" remarks="Customer requests advice with adaption of LDAP address book" street="Koudekerkseweg 8" postalCode="4382 EE" city="VLISSINGEN" country="NL" contractType="01"/>

  <Task territory="C2" id="12344-02" name="Customer B" skill="KC7222" estimatedDuration="60.0" earliest="2011-04-01 00:00" latest="2011-05-01 00:00" status="30" remarks="Maintenance according to plan" street="Vierbundersweg 1" postalCode="5107 NL" city="DONGEN" country="NL" contractType="02" scheduled="2011-04-03 15:26" scheduledFor="Joe"/>

</Plan>

Note that the attribute names of the XML Task elements correspond to the column names as defined in the Task tab of the sample Excel file.

Optimize My Day provides a REST-based API, i.e. you can upload XML documents automatically by using the HTTP POST method. Posting an XML document to Optimize My Day actually uses the same mechanisms as uploading it through the configuration's menu option Planning -> Data Up-/Download -> Upload of Data. However, for automated processes, you may want to use the BASIC authentication mechanism.

Post XML documents programmatically Post XML documents programmatically

If you intend to post the XML programmatically, post the XML document to the URLhttps://www.optimizemyday.com/omdservices-basic/Configuration/<ConfigurationIdentifier>/Plan, where<ConfigurationIdentifier> is the number of your specific configuration.

To allow basic authentication, you will have to provide a Base64-encoded username/password header along with the HTTP request. If you intend to send a zipped XML document, add the zipped=true parameter to the URL.

Folder-based Gateway Folder-based Gateway

Alternatively, you may use the Folder-based Gateway. This program scans a specified file system folder for XML documents. As soon as a new file is added to the folder, the content is uploaded to Optimize My Day and the file is moved to an archive folder. The result of the upload is stored in either a success or failure folder, depending on the result of the upload.

The folder-based gateway must be installed on a server in your IT environment. It must have access to the public internet. It is your responsibility to store the relevant plan data as XML documents in the inbound folder of the Folder-based Gateway.

Download the Folder-based Gateway from here. Note that you must be logged on to be able to download the Folder-based Gateway.

You must have a local Java Runtime installed to run the Gateway. You can check the runtime by running "java.exe" on the command line.

After you have adapted the Gateway.properties file to your requirements, test the gateway by starting the test batch file in the wrapper/bin directory. To install the gateway as a Windows Service, run the install batch file. To remove the gateway from the Windows Services, run the uninstall batch file. Adapt the batches appropiately when running the Folder-based Gateway on a UNIX-based system.

Enterprise Server Bus (ESB) Enterprise Server Bus (ESB)

Contact us in case you require tight integration with your Enterprise Server Bus (ESB) or if you want to integrate with our JMS and SOAP facilities.