Online mode configuration

In online mode, at the time of authorization, the device consults its server/system to find out what to do: allow the user access or not. All the operating modes can be accessed at: Operating Modes.

The following step-by-step explains how to enable and configure online mode (Pro mode) on access control devices.

Step 1 - Create a device object:

This object will be the representation of your server/system on the device.

Request example

$.ajax({
  url: "/create_objects.fcgi?session=" + session,
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({
    object: "devices",
    values: [{name: 'My server 1', ip: 'http://myserver.com/api', public_key: ''}]
  })
});

Response example

{"ids":[473359]}

Important: Save this id, you will need to use this value in the next step.

Notes:

  1. The ip attribute can be any address, for example:

    • 192.168.110.200:80/api2
    • http://192.168.110.200:80
    • 192.168.200.200:8080
    • http://myserver.com/service
  2. It is not necessary to create a "devices" object every time you activate online mode (Enterprise) in access control. This object only needs to be created once in the device's memory. Once this object has been created, you only need to carry out steps 2 and 3, which are responsible for assigning the address of the server that will be used to receive events and, finally, activating online mode on the device respectively.

Step 2 - Create your server/system reference in access control:

Note: The server_id value to be passed is the id of the server/system created in Step 1.

Request example

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

Step 3 - Activate online mode (Pro)

Request example

$.ajax({
  url: "/set_configuration.fcgi?session=" + session,
  type: 'POST',
  contentType: 'application/json',
  data: JSON.stringify({
    general: {
        online: "1",
        local_identification: "1"
    },
    online_client: {
      extract_template: "0",
      max_request_attempts: "3"
    }
  })
});

Step 4 - Check session validity

After these steps, the device will communicate with your server/system. To test the communication, you can implement the endpoint /session_is_valid.fcgi.

Remember that the endpoint will be concatenated with the ip value entered in Step 1, for example:

  • http://myserver.com/api/session_is_valid.fcgi
  • 192.168.115.200/session_is_valid.fcgi
  • 192.168.110.200:8080/session_is_valid.fcgi

Note: If the device_is_alive.fcgi is not answered, the device will not come online and consequently the requests will not reach the server.

Once the above operations have been carried out, the access control will be communicating with your server/system. When a user identifies themselves on the device, it will send an identification event to your server/system with the user's access information. It is then up to your server/system to handle this event and return a message to the access control.