API calls can also be used to get information out of the system. Some examples include:
All this information is available through the console app but cannot be compiled in a simple list.
Getting started with scripts
Before you can start to use the API script you will need the COM API installed onto the machine where the script will be executed.
Finally, you will need to enable COM access for an Admin user (managed through the EFT console via the Administration tab of the server).
Although the syntax of commands may alter between scripting languages, every script needs to declare connection information via a COM object. For example, a typical opening section of a VB Script may include the following lines:
CRLF = (Chr(13)& Chr(10))
txtPort = “1111”
txtAdminUserName = “API”
txtPassword = “A1bC3d$E5”
<- Put your Admin port here
<- This is the user name
<- This is the user password
Set objFSO=CreateObject(“Scripting.FileSystemObject”)
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write “There are a maximum of ” & SFTPServer.WSSeatsMax & ” seats available.” & vbCrLf
objFile.Write “There are ” & SFTPServer.WSSeatsUsed & ” seats in use” & vbCrLf
objFile.Write “That leaves ” & Seatsleft & ” seats unused” & vbCrLf
objFile.Close
This will output a string to a file which would look similar to this.
There are a maximum of 25 seats available
There are 8 seats in use
That leaves 17 seats unused
Our definition of the cScript command in our EFT looks like this and allows a filename to be passed to the script as well.
In our Event rule, the output file is emailed to a user as an attachment.