6.1 HTTP API Version 3

2N Access Commander API received a major overhaul in version 3 (APIv3) for easier integration. Users, devices (and other entities) can now be created with all properties in a single POST request, where APIv2 needed separate requests to add every RFID card, phone number, etc. 
APIv3 also supports PATCH, so to change a single user property, it is enough just to send that one field via PATCH, instead of having to send the whole object in a PUT request. We will continue to support the legacy APIv2 until 31.5. 2024.

Swagger UI

2N Access Commander API
 v3 
OAS3

Important note

This documentation file purpose is to help Access Commander development team as a reference manual. This file IS NOT the official Access Commander API reference manual and might NOT always reflect the actual version of the API endpoints. If you find any bug please report it to your distributor and he will schedule a fix into future releases.

Address

The URL of AccessCommander's API is versioned and uses https, i.e. the url looks like https://serveraddress/api/v3/..., where:

serveraddress is hostname of AC,

HTTP

Http commands used for communication with the server:

GET lists entities (getting the list of entities with parameter values) or get single entity

PUT updates the whole entity

POST creates a new entity

DELETE deletes the entity

PATCH updates entity according to JSON PATCH RFC 6902

Data Structure

Server Response

Response structure:


{
  "Id": ...
}

Errors

401 unauthorized

501 server errors, the structure looks like this:


{
  "Code": 2,
  "Message": "...",
  "Detail": "..."
}

Authentication

The user sends a request containing username and password to the endpoint /login.

If the pair is valid, the server creates the cookie and sends it back to the browser.

All consequent requests are sent to the server along with the cookie. The server always verifies

if the cookie is valid. If it is not, it returns 401 in response. The cookie is deleted by sending

request to the endpoint /logout.

UserManager

Admin

AccessManager

VisitorManager

Reports