Integration of REST API into U‑PROX: possibilities and examples of remote control

Share and save
Integration of REST API into U‑PROX: possibilities and examples of remote control

The U-PROX system includes built-in tools for integration with third-party software via API, with support for SOAP, REST, JSON, and XML standards.

U-PROX software is free of charge, as is the REST API included with it.

To use the REST API in U-PROX software for interaction with third-party systems, it is necessary to:

Install the U-PROX software components:

  • Server
  • Client
  • Web Server
  • Desktop Server

Follow the interaction logic:
U-PROX Equipment ⇄ U-PROX Software ⇄ Third-Party Software

The following integration methods are available:

  • Two-way integration with third-party software via web protocols (API integration)
  • Data export from U-PROX software in the form of reports using standard tools of the program or the operating system, followed by import or processing in third-party software
  • Direct access to the U-PROX software database via SQL queries in Transact-SQL (T-SQL) — without requiring additional authorization

U-PROX IP software (also known as U-PROX WEB) provides two user interfaces:

  • classic Windows interface
  • web interface (via browser)

In the classic interface, the following are available:

  • Export of reports in text format .CSV — manual or automatic
  • Export in Excel format (.XLS/.XLSX) — manual only, provided that Microsoft Excel is installed on the PC

In the web interface, the following are available:

  • Manual creation and export of reports in .PDF format
  • Report export via API — in PDF or JSON formats

The recommended software version for use is v3.057.7988.

Download the ISO image of U-PROX software version 3.57.7988 and install or update your current version.

ISO image 3.57.7988 of the U-Prox software version:
–  https://drive.google.com/file/d/14kt60eWtgMPhV5VQMBS1jq5MN7l47uxy/view

Renew in sequence – Server, Client, Web Server, Desktop Server – on the application server;
and Client and Desktop Server on remote client workstations.

  • Desktop Server – where the Web Client and U-PROX Desktop USB reader are used.

– and as specified below in the API description

Refresh the page in your browser after upgrading to newer versions – “Ctrl+F5” to reload with cache clearing.

General description of the API

Check out the available information on the “API Integration” page of our website:

–  https://u-prox.systems/software/

Check out the function reference guide (available after installing the U-Prox complex):

–  http://127.0.0.1:40001/json/help (Eng)

Also, on the installed U-PROX system, in the browser, using the developer window (F12), you can view the interaction of U-PROX WEB with the API.

If you need more information, please send an email to support@itvsystems.com.ua with the subject line “API integration.”

U-PROX WEB Server REST API

The latest versions of U-PROX WEB API examples and documentation are available in the cloud folder:

–  https://drive.google.com/drive/folders/1QpNENLEwYwjy_uOeFmjNmlSlIoVTf33b

The specified folder contains the following files:

U-Prox IP.v3.057.7988.iso – distribution disk image. From this image, you must install or update the “U-PROX IP Server”, “U-PROX IP Client”, “U-PROX Web Server”, and “U-PROX Desktop Server”.

Documentation\AcsWebService.doc – previous version of the Web service description, which includes an overview of operations for connecting to the service, receiving event notifications, creating employees, and other operations.

Documentation\html*.html – JavaScript examples using the AngularJS library.

Documentation\html\Authenticate.html – example of authentication and connection to the server.

Documentation\html\DoorControl.html – example of door control.

Documentation\html\DoorUnlockAll.html – example of emergency unlocking of all doors in the system.

Documentation\html\AdditionalEventFields.html – example of retrieving and creating devices (controllers), additional event fields, and the events themselves (passage records).

Documentation\html\Employees.html – example of retrieving a list of devices (controllers), doors, access levels, departments, employees (users), creating cards, firing employees, and deleting created objects.

Documentation\html\EventGetList.html – example of retrieving events and displaying them in “Soft Real-Time” mode.

Documentation\html\EventsReport.html – example of retrieving an event report in PDF and JSON formats.

Documentation\html\TimeAttendanceReport.html – example of retrieving a time attendance report in PDF and JSON formats.

Documentation\html\Visitors.html – example of retrieving a list of devices, doors, temporary access levels, visitors, creating cards, and deleting created objects.

Documentation\html\js*.js – JavaScript libraries used.

To demonstrate the operation of the web applications DoorControl.html, Employees.html, Visitors.html, etc., you must perform the following steps:

1. Download the U-PROX IP.v3.057.7988.iso distribution disk image from the folder in the cloud:

–  https://drive.google.com/open?id=1QpNENLEwYwjy_uOeFmjNmlSlIoVTf33b

2. Install or update U-PROX IP Server.

3. Install or update U-PROX IP Client.

4. Install or update U-PROX IP Web Server.

5. Install or update U-PROX IP Desktop Server.

6. Open the corresponding HTML file in Chrome and view the list of requests and responses to requests.

Online mode (short description)

Support for external access control modes has been added to the U-PROX IP software version 3.052.6722. It is necessary to have this or a later version installed.

“Entry permitted”:

POST http://localhost:40001/json/DoorAccessIn

{

“UserSID”: 1234567890123456, // session identifier received from the Authenticate request

“Token”: 12345, // door token or passage direction token (Door – Entry, Door – Exit) for which the command is issued

“CardCode”: “1234567890” // card code that will be saved in the log for the “Entry Allowed” event

}

“Exit permitted”:

POST http://localhost:40001/json/DoorAccessOut

{

“UserSID”: 1234567890123456, // session identifier received from the Authenticate request

“Token”: 12345, // door token or passage direction token (Door – Entry, Door – Exit) for which the command is issued

“CardCode”: “1234567890” // card code that will be saved in the log for the “Exit Allowed” event

}

“No entry”:

POST http://localhost:40001/json/DoorDenyAccessIn

{

“UserSID”: 1234567890123456, // session identifier received from the Authenticate request

“Token”: 12345, // door token or passage direction token (Door – Entry, Door – Exit) for which the command is issued

“CardCode”: “1234567890” // card code that will be saved in the log for the “Entry Denied” event

}

“No exit permitted”:

POST http://localhost:40001/json/DoorDenyAccessOut

{

“UserSID”: 1234567890123456, // session identifier received from the Authenticate request

“Token”: 12345, // door token or passage direction token (Door – Entry, Door – Exit) for which the command is issued

“CardCode”: “1234567890” // card code that will be saved in the log for the “Exit Denied” event

}

Online mode (detailed description)

Below is additional information about the external access control mode of the U-PROX IP400 controller and its support in the “U-PROX IP” software.

The external access control mode, where access decisions are made by the server based on operator commands or REST API requests, is available in “U-PROX IP” starting from version v.3.052.6833 and in later versions.

There are two modes of external access control:

  1. “Operator Denies or Grants Access” – in this mode, the controller transmits information about any presented card to the server and grants or denies access only after receiving a response from the server.
  2. “Operator Confirms Access Grant” – in this mode, the controller handles the presentation of a denied card independently by issuing a denial signal. When a permitted card is presented, the controller sends the information to the server and waits for a few seconds for a command to either allow or deny access. If no command is received within the specified timeout, the controller grants access for the permitted card.

To ensure the correct operation of the second mode (“Operator Confirms Access Grant”), the controller’s firmware version must be at least 7.23/8.23 or newer.

The configuration of the external access control mode can be performed in the “U-PROX WEB Client” software, available at http://localhost:40001/ after installing the “U-PROX IP Server” and “U-PROX WEB Server” components, as shown in the screenshots.

or in the classic client

or in the classic client

After uploading the new configuration to the controller, information about the card elevation can be obtained via REST API in the form of an event:

{

“Event”:[

{

“Device”:{

“Name”:”Turnstile”,

“Token”:23880

},

“Message”:{

“Code”:65555,                          // event code: 65554 – login request, 65555 – logout request

“Name”:”Request to exit”,

},

“Sender”:{

“Name”:”Turnstile – exit”,

“Token”:23902

},

“User”:{

“EmployeeNumber”:””,

“Post”:””,

“AdditionalFields”:[

],

“Name”:”Petrenko”,

“Token”:6580

},

“Department”:{

“Name”:”Administration”,

“Token”:6566

},

“PhotoToken”:23678,

“IconToken”:23679,

“CardCode”:”0B0016B189″,

“Issued”:”\/Date(1591793191053)\/”,

“FaceMaskDetected”:false,

“Temperature”:0,

“AdditionalFields”:[

],

“Token”:34106,

}

]

}

You can find an example of receiving events in Soft Real Time mode in the files Documentation\html\EventGetList.html and Documentation\html\Photoverification.html in the cloud folder with REST API examples:

–  https://drive.google.com/drive/u/0/folders/1yyYWg8pPimNbYoG1XeOhFfIOMLg6Y2ug

To obtain permission to pass, you must send a request:

POST http://localhost:40001/json/DoorAccessIn чи http://localhost:40001/json/DoorAccessOut

{

“UserSID”: “830730959685833”, // session identifier obtained during Authenticate request
“Token”: 23902, // Event[i].Sender.Token — access point token specified in the event
“CardCode”: “0B00123456” // card code that was granted access

}

To prohibit access, you must send a request:

POST http://localhost:40001/json/DoorDenyAccessIn or http://localhost:40001/json/DoorDenyAccessOut

{

“UserSID”: “830730959685833”, // session ID received after connecting to the server
“Token”: 23902, // Event[i].Sender.Token – access point token specified in the event
“CardCode”: “0B00123456” // card code that was granted access

}

You may also like