Please see below for information on how to connect to your ECGrid mailbox using our API service via the Command Line Tool.



All connectivity configuration and maintenance can be done by going to Mailboxes/My Connections to ECGrid:

After Navigating to the connections tab, you can choose your connection in the secondary navigation panel and edit the information as needed. The portal allows for full self-service configuration and management of your API access, SFTP/FTPS, AS2, and API via Command Line Tool. WalMart hosted connections can also be created and tested under the Trading Partner Connections to ECGrid tab. 

*Please Note: The My Connections to ECGrid tab provides options for connecting your network and mailboxes to the Loren Data network, not your trading partner.


Command Line Tool (via ECGridOS API)

The Windows Command Line Tool can also be accessed directly from your user interface. The ECGridOS Windows Command Line Tool uploads and downloads files using ECGridOS Web Services over an SSL encrypted channel on port 443 (just like HTTPs on your web browser). This application can be run on any Windows computer, XP or new, with .NET 3.5 or later installed.


Installation and Usage

Download the Zip file from the API/Command Line Tool tab.

Extract the files to the location you would like to run the Command Line Tool.  We usually recommend installing it in C:\ECGridOS so it is easy to find.  

In the extracted folder, you will see 2 files: ECGridOSMailboxIO.exe and transfer.cmd

Right click on the transfer.cmd and choose the edit option.  We recommend installing Notepad++ to edit batch scripts but any text editor will work.

This is the batch script you will want to run to execute the API executable to upload and download the files from ECGrid.  You will need to replace "<apikey>" with the API key of the user you want to use.  You can find the API key by going to your profile.  See this document for more information: Getting API Key.

By default, the script has C:\ecgridos\outbox and C:\ecgridos\outbox and the upload and download directories.  You can change these to the proper directories for your environment.  If you choose to use the default, you need to create these folders in the ECGridOS directory like this:

Once your API key and the proper directories are set, save the transfer.cmd file.

For files you want to SEND to ECGrid, you will place them in the outbox.  

For files you want to RECEIVE from ECGrid, you will place them in the inbox.

To run the script, all you need to do is double click on the transfer.cmd file once it is updated with your proper information.  

This will only upload and download files.  If you want to do additional steps, you will need to add additional batch script commands to the transfer.cmd.  Here are some additional items you may want to add to your script:

Basic log file: You can redirect the output from the command to a text file by adding a > and the full UNC path and name of the log file.  Please note that these will overwrite each time it is run, so you may want to put a date/time stamp to the end.  

To add a date and time stamp, you can add this as the file name: 

upload_results_%date:~10,4%-%date:~4,2%-%date:~7,2%_%HR%%time:~3,2%.txt


For additional basic batch script commands, you may want to check out this website:

Batch File Commands (A-Z) | Explanation and Examples (trytoprogram.com) 


Scheduling the batch script with Task Scheduler

To schedule the batch script to send and receive on specific intervals, you will want to setup a windows task scheduler.  In your windows search bar, type in "Task Scheduler".  It should open this window.


Right click on the "Task Scheduler Library" and select Create Task.

Give it a name and then make sure to select the Run whether user is logged on or not.  Next click the Triggers and New.  Set up your desired schedule.

After you select your desired schedule, click on the Actions tab.  Select New and make sure it says "Start a program" in the action.  This should be the default selection.  In the Program/Script, type in the name of the batch script.  Then you will want to put the root directory where the batch script is saved in the "Start in" field.  This will mimic running the batch script directly from the main directory where the executable and batch script are saved.  


Additional information about ECGridOS

Built to support high volume communications, ECGrid’s web services API supports over 150 functions, providing direct access to account creation, user administration, ID and partnership management, transaction visibility, and much more. 

ECGridOS supports SOAP and HTTP protocols to allow you to manage your mailbox and data or integrate it within your own systems for automation.

For more information on ECGridOS, please visit the Official ECGridOS Website on GitHub at: 

https://github.com/LorenData/ECGrid-API

To view the WSDL or HTTP formats and to try out the calls online, go to: 

https://os.ecgrid.io/v4.1/prod/ECGridOS.asmx