EMDI provides the ability to download and set data using the http protocol. This is possible through the communication/maintenance program (tcpdevices.exe), that must be running.

To enable the option (Settings–>Communication/Maintenance):

 

Reports called via http are easily created using SQL language and saved with the .sql suffix in the reports folder (e.g. C:\Program Files (x86)\SBZ systems\EMDI\reports).

Variables that you can include in the code:

(used on the where of sql, only when we call a report)

:apo                                            Date from
:ews                                            Date to
:param1                                     General use
:param2                                    General use
:search                                      For search

Fields that we can send:

querysql                                    Here we write the file name of the report without the suffix .sql. Alternatively, we can put sql code directly.
key                                             Security code, must be the same as the one set in the settings.
searchtext                                For search corresponding to :search
param1                                     General use corresponding to :param1
param2                                     General use corresponding to :param2
from                                          Date corresponding to :apo
to                                               Date corresponding to :ews

Results – Data download

When we call sql code, we take as a result simple utf8 encoding text in csv format and separator “|”. Also in the first row are all the fields as in the database.

Examples

To call the “04.All customers” report via http:

To execute sql code directly through http:

We can also change data directly using the update command:

In this case we take the “ok” response when the code is successful.

 

Also the call can be made from anywhere on the internet using the EMDI cloud option:

Where LICENSE is your license and DATABASEID the unique database id found in tcpdevices: