Document toolboxDocument toolbox

Burti Rest API setup

After Burti Rest API package has been added to your HW client this page will show you basics how to set up and use this functionality.

Step-by-step guide

  1. Preparing for the use of package
  2. Setting up the API register definitions
  3. Writing and reading the registers

Preparing

First you need to go to main API register - module: Burti - JSON API> Registers> API Register definitions

From there for the first time using this register use "Create" button to create new entry in register (shown below).

After this you should see a new register entry:

Setting up the API register definitions

There are basically two main ways how to set up the register entry:

  1. Adding the entries manually
  2. Adding the entries using module: Burti - JSON API> Routines> Imports> Export/Import format file

Next steps are shown using the method with Import through: Burti - JSON API> Routines> Imports> Export/Import format file

Choosing the register to use, defining them and setting up register entry

Go to: module: Technics> Reports> Export/Import format and launch the report (no additional specification needed)

Report will open all the information about the all register. You need to write in search bar the register you are looking for to use (in this example "Stock Movement") and find its registers name

Once this been found copy the registers name. Launch again the report Technics> Reports> Export/Import format but this time in specification set the report for this register and choose the media as "File" this will save the registers information in txt file.

After that open the file in file editor that opens these kind of files to check the file. What you should look in this file is for "taxmatrix" that can disrupt the API register entries work. This matrix and its associated data should be deleted before importing it in API register. If this matrix is not present you can proceed.

Sidenote with example:

For example in exported Goods receipt register "PUVc" the "taxmatrix" could be looked up as a phrase in document and then deleted with all its associated data. For example in "PUVc" register:

 find the matrix and delete it  

in places where it is in register  until it is no longer present  . 

After this you can import the register information using module: Burti - JSON API> Routines> Imports> Export/Import format file and the entry should show in register.

 

 

Main API register definitions fields

  • Vc Code - Shows the register you are making entry for
  • Main key - (warning) should be obligatory set (if not there can be problems when writing/ reading files later - this can affect server and cause it to not start properly) - this value (index name) unfortunately can be seen in code by HAL programmer to set.
  • Block - allows to use information from blocks if such information is used when importing registers information;
  • View attachments - allows to download and see attachments;
  • Add attachment - allows to add attachments;
  • Export attachments - allows to export attachments;
  • Delete attachments - allows to delete attachments;

Usually above set checkboxes are set by default without checkmarks.

 

  • Name - Shows the name of the field;
  • Type - Type of the field;
  • Location - Can be set if needed Matrix or Header;
  • In list - Lets to include or exclude the information from the full list regime;
  • In full - Lets to include or exclude the information from the short list regime;
  • Filter by - Lets filter by specific field (include=allowed, exclude=not allowed). For example to filter items with specific class.
  • Index names - is something usually set by HAL programmers - needed for faster filtering

(warning) Important to also set the Main key code in appropriate main key row for column "Index names" as in examples:

 


Writing and reading the registers

Before these operations you should create on your HW server in folder halcust/json new folder called "generated-interfaces" in this folder generated entries will be created

Once the Burti - JSON API> Registers> API Register definitions entry is saved it can be written or red.

 use this entry to read/ write and make main entry records (for the first time saving register entry).

  • Generate JSON read API - can be used for reading the data from HW and setting them in JSON file;
  • Generate JSON write API - can be used for wring the data in HW and reading them from JSON file; 
  • Generate JSON main API - Should be used when new entry in register is made;

    All in all all three buttons can be pressed if you are not sure for the register to work - since the button pressed in one registers entry works also on all other registers entries at the same time.

When pressing these buttons you should get message like this:

 

After these operations the Server should be restarted.

After restart the entries will be generated in the folder halcust/json/generated-interfaces  

Since for example is used local server this looks like this: