The SixBit Application Programming Interface
Drop Folder Example

With Drop Folder Automation, API calls can be made simply by placing the calls in a file in XML format and dropping the files into a specific folder.  The following example demonstrates this process.  This example consists of 4 files.  These files can be found in the SixBit installed directory under SixBit API SDK\Examples\Drop Folder.

Sample Files

There are 4 files that perform the following actions.

File Name Actions Performed
FileA.xml This file uses the Items_AddUpdate call to create an item that includes item specifics, an initial purchase of 5 items and the supplier information.  It then uses the Inventory_Reconcile call to reconcile the inventory to 10.  Finally a Suppliers_AddUpdate is used to fix the spelling of the suppliers last name and add a web address on the supplier record.
FileB.xml (Note:  This is only for users of the Consignment Module) This file uses the Suppliers_AddUpdate call to set the supplier created in FileA.xml as a Consignor and then sets a default ConsignmentPlan to 50/50 Split.  It then performs an Items_AddUpdate to update the item created in FileA.xml to be a consigned item for the newly created consignor with a consignment plan of Straight 35%.
FileC.xml This file uses the Orders_Add call to create an order for the item that includes the buyer, shipment, sale and address information.  It then calls Buyers_AddUpdate to add a Sales Tax ID for the buyer.
FileD.xml This file uses the Sales_Update call to update the quantity sold to 2 on the sale for the order created in FileC.xml.  It then uses the Shipments_Update call to update the shipping service to USPS Priority Mail and sets a tracking number on the shipment.


Running the Sample

These files can be used to see the Drop Folder Automation in action.  We recommend that you make a backup of your database before running this example, then restore the backup when finished.

The sample can be run right from within SixBit, or by using the SixBit API Sample Application.   By running from within SixBit you can test the complete process, include the drop folder location, but you will need to wait on the Agent to perform the actions.  Using the Sample Application, you can make the actions run immediately.

To run the sample from within SixBit:

  1. Set up the Drop Folder Automation folders as described in Setting the Drop Folder in SixBit.
  2. On the computer hosting the database, drop FileA.xml into the Input Path.  Make sure the SixBit Agent is running on that computer.
  3. The agent will check for new files every 5 minutes.  After processing the files, they will disappear from the Input Path and appear in the Processed Path.  Logs and any requested output will appear in the Log Path and Output Path respectively.  Check periodically to see if the file has moved to the Processed Path and when it does, check the logs and output.
  4. Open SixBit and verify that the requested actions were performed.
  5. Repeat steps 3 and 4 for each file.

To run the sample from the Sample Application:

  1. Start the SixBit API Sample Application as described in Testing API Calls.
  2. Select Run the Calls in the API Drop Folder Automation File and then use the Browse button to navigate to FileA.xml.
  3. Click Execute.  The results will appear in the Results window.
  4. Open SixBit and verify that the requested actions were performed.
  5. Repeat steps 3 and 4 for each file.

See Also