Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

Section


Column
width30%

Retrieving the database structure of a register

To generate the various end-points Burti API relies on the database structure that Standard ERP exposes via the Export/import Format report in its' Technics module.

When the report is run without specifying a register code, it will dump the database definitions of all the registers in the database. These are for example Invoices, Sales Orders, Deliveries and such.

You will need to look up the register(-s) that you wish to expose via the API in this report and then separately export these to a text file.

Example

In this example we show how to retrieve the database structure of the Orders register to use for creating its' API end-point.

Step 1: Enter the keyword "Orders" in the search field of the report

Step 2: Cycling through the search results pin-point the correct register and take note of its' code (ORVc).

Step 3: Reopen to the Report Specification window using the cogwheel menu available in the upper-left hand corner of the window.

Step 4: Enter the register code (ORVc in this example) in the field labeled "Vc (View Code)", set Media to File and press Run to save the definition in a file.


Column
width70%


...

Section


Column
width30%

Importing the register's database structure as an API Register Definition record

To start configuring the end-point, you need to create an API Register Definition record for it in the Burti - JSON API  module. For this you can use a database structure definition file.

In Burti - JSON API module open Imports and select "Export/Import Format file" and pick the file.

Info

In prior versions of the Burti API it was necessary to edit files exported in this manner to remove blocks that follow M4PackedMatrix fields up to and including double <CR> lines, but this is now automatically detected and ignored upon import.

Example

In the example we'll use the file created in the previous section to generate an API Register Definition record for the Orders register.

Navigate to Burti - JSON API module Imports, select "Export/Import Format file", pick your file and run the Import.

If all goes well, a new record should now be created in the API Register Definitions register for Orders (register code ORVc).

Congrats, you are now ready to start configuring!


Column
width70%


...

FieldExplanation
Vc codeThis is the register code, this specifies which data the end-point is serving and updating.
ImportTagThis currently has no effect on anything

MainKey

This is the name of the main key (primary key) for this register. You will need to know this, to configure the end-point properly. Most of the time you can guess this name by the "main" field in the register. For registers with numbered records this will typically be "SerNr", for records with a Code field it's typically "Code", but can sometimes also be called "MainKey" or something else. To be safe, you will need to consult with a HAL programmer, if you are not one yourself.
Import date and timeThese are informative fields and show when the definition was imported.

Support variable fields light-on (on)

These are used in more advanced use cases of the API. These support variables ar maintained throughout the lifecycle of each API request and are available in all HAL hook functions. You can store temporary data (e.g. implementing a cache of some data you do not wish to be re-read from the database for each record in a record set).

You can specify multiple variables or even arrays or vectors of a variable type, depending on your need.

BlockChecked when the end-point is made for a block not register.
Export AttachmentsWhen checked, information about attached files will be included in the JSON data for records accessed via this end-point.
View AttachmentsWhen checked, an additional interface will be generated for attachment retrieval.
Add AttachmentsWhen checked, an additional interface will be generated for adding attachments to records accessed via this end-point.
Delete AttachmentsWhen checked, an additional interface will be generated for deleting attachments to records accessed via this end-point.
Do not use SequenceNumbers (lightbulb)

No longer necessary, used in older versions of the API - the usage of SequenceNumbers for registers is detected automatically.

Field configuration
ColumnExplanation
Name, Type, Length, LocationThese describe the field's parameters in the database structure.
In listThis determines whether the field is included when requesting the short/list version of the data. Typically used for retrieving record list with general data of the record (for displaying in record lists or other similar data overviews).
In fullThis determines whether the field is included in the full set of record's data.
Filter byWhether to enable filtering by this field when making API requests.
Index names (3 columns) (lightbulb)These all serve the same purpose - for listing comma-separated index names in which the field is included. This then enables proper sorting by these indexes.




Read API


Write API


Section


Column
width30%



Column
width70%



...