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): Type of object to be created. See the topic List of Objects for a complete list of available object types.
- values (array of JSON objects): Each element must be a JSON object representing the object to be created. Each key must be a valid field of the object and the values must have the appropriate type. All JSON objects must have the same fields.
Response
- object (string): This field represents the type of report that will be generated, for example, "users".
- file_name (string): This field represents the name of the output file (optional).
- delimiter (string): This field represents the type of field delimiter, similar to the structure of a .csv file, for example: ";" or "," (optional).
- header (string): This field represents the report header (optional).
- line_break (string): This field represents the line break and can be a simple "\n" (optional).
- columns (JSON object): This field determines the columns that will be shown in the report (very similar to the fields field of the load_objects method). This field is an array that contains objects, these objects have the following fields:
- field (string): This field belongs to the columns object and represents the name of the field that will be generated.
- type (string): This field belongs to the columns object and determines the column type. It can be: "object_fileld" (Normal column field), "counter" (Record counter) and "fixed" (Fixed field).
- object_field (string): This is a normal column field. This object will have two fields, field and object, of type string, which represent the column and table respectively.
- counter (string): This object will have 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 object contains a mandatory string field that represents the fixed value of the column.
- format (JSON object) : This field belongs to the columns object and determines how the column will be formatted and displayed (optional). This object has the following fields:
- adjustment (string): This field represents whether the column should be left-aligned, right-aligned or no adjustments should be made (optional).
- fill (string): This field determines the value of filling empty spaces, for example: "0" (optional).
- format (string): This field represents the column formatting, for example: "%d: day, %m: month, %Y: year, %H: hours, %M: minutes , %S: seconds" (optional).
- width (int): This field represents the column size adjustment (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:"Nome (Usuário);Código (Usuário)",
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
})
});