Export Report

The report will be generated according to the settings of the fields set. The search parameters are the same as in the load_objects method. The HTTP method used is POST.

POST /report_generate.fcgi

Parameters

  • object (string): This field is mandatory and defines the object type that will compose the report to be generated, for example, "users". See the topic List of Objects for a complete list of available object types.
  • file_name (string): This field defines the name of the output file (optional).
  • delimiter (string): This field defines the field delimiter, similar to the structure of a .csv file. For example: ";" or "," (optional).
  • header (string): This field defines the report header (optional).
  • line_break (string): This field defines the line break, such as "\n" or "\r\n" (optional).
  • columns (JSON object): This field defines the columns that will be displayed in the report, similar to the fields field in the load_objects method. This field is an array of objects, which contain the following fields:
  • field (string): This field belongs to the objects in the columns array and represents the name of the field that will be generated.
  • type (string): This field belongs to the objects in the columns array and determines the column type. It can be: "object_field" (Normal column field), "counter" (Record counter) and "fixed" (Fixed field):
    • object_field (string): This is a normal column attribute. It has two fields: field and object, both of type string, which represent, respectively, the column and the table.
    • counter (string): This attribute has two optional integer fields: offset (represents the counter's initial value, default: 0) and step (represents the counter's step, default: 1).
    • fixed (string): This attribute contains a mandatory string field that represents the fixed value of the column.
  • format (JSON object) : This field belongs to the columns object and defines how the column will be formatted and displayed (optional). This object has the following fields:
    • adjustment (string): This field defines the column alignment: "1" (left-aligned), "2" (right-aligned), or "0" (no adjustment) (optional).
    • fill (string): This field defines the value to fill the empty spaces. For example: "0" or " " (space) (optional).
    • format (string): This field defines the column format, for example: "%d" for day, "%m" for month, "%Y" for year, "%H" for hours, "%M" for minutes, and "%S" for seconds (optional).
    • width (int): This field defines the width of the column (optional).

Request example

Generating report:

$.ajax({
  url: "/report_generate.fcgi?session=" + session,
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({
      order:["ascending","name"],
        "where":{
              "users":{},
              "groups":{},
              "time_zones":{}
          },
          object:"users",
          delimiter:";",
          line_break:"\\r\\n",
          header:"Name (User); Id (User)",
          file_name:"",
          join:"LEFT",
          columns:[
            {
                type:"object_field",
                object:"users",
                field:"name",
                format:{
                    adjustment:1,
                    width:50,
                    fill:" ",
                    format:"%s"
                }
              },
              {
                type:"object_field",
                object:"users",
                field:"id",
                format:{
                    adjustment:2,
                    width:5,
                    fill:"0",
                    format:"%s"
                }
              }
          ]
  })
});

POST /export_afd.fcgi

Allows the extraction of a report in AFD format. The report can be used as an attendance management tool, providing all the authorized access records that are stored in the device. The AFD report can also be generated from the WEB Interface and the GUI of the device.

It is possible to filter the generation of the report in AFD format from an initial date or through an initial NSR.

Request example

Parameters

  • initial_date (JSON object) : Contains information about the initial date from which the AFD format report will be generated.
    • day (int) : Numerical value representing the day.
    • month (int) : Numerical value representing the month.
    • year (int) : Numerical value representing the year.
  • initial_nsr (int) : Initial NSR applied as a filter.

Response

  • Document with .txt extension containing the report in AFD format. The document name respects the standard for AFD, being built with AFD + serial number of the device.

Generating full report:

$.ajax({
  url: "/export_afd.fcgi?session=" + session,
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({})
});

Generating report with start date filter:

$.ajax({
    url: "/export_afd.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({
        "initial_date":{
          "day":11,
          "month":7,
          "year":2022
        }
    })
});

Generating report with NSR filter:

$.ajax({
    url: "/export_afd.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({
        "initial_nsr":1
    })
});

POST /export_audit_logs.fcgi

Allows the extraction of audit logs. The report can be used to control the device and check its events, providing the last 25000 records, which is the maximum amount stored (with rotation) in the equipment database.

It's possible to filter the generation of the report from 7 event log categories.

Event log categories.

  • config : Configuration audit log. Records all changes to system settings.
  • api : API audit log. Records session requests when accessing the API.
  • usb : USB drive audit log. Logs all events that make use of the USB drive.
  • network : Network audit log. Logs all network related changes to the device.
  • time : Time audit log. Records all changes to the device's time.
  • online : Online mode audit log. Records the server connections and responses.
  • menu : Menu device audit log. Records the menu access in offline and online modes.

Request example

Parameters

  • config (int) : Enables filter for configuration event logs. To disable "0", and to enable "1".
  • api (int) : Enables the filter for API event logs. To disable "0", and to enable "1".
  • usb (int) : Enables the filter for USB drive event logs. To disable "0", and to enable "1".
  • network (int) : Enables the filter for Network event logs. To disable "0", and to enable "1".
  • time (int) : Enables the filter for device time event logs. To disable "0", and to enable "1".
  • online (int) : Enables the filter for online mode event logs. To disable "0", and to enable "1".
  • menu (int) : Enables the filter for menu event logs. To disable "0", and to enable "1".

Response

  • Document containing the last 25000 audit logs of the most recent desired filters in English, regardless of the language in which the equipment is configured.

Generating report with all audit logs:

$.ajax({
    url: "/export_audit_logs.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({
        "config": 1,
        "api": 1,
        "usb": 1,
        "network": 1,
        "time": 1,
        "online": 1,
        "menu": 1
    })
});