RS2 REST API v7.0.0

RS2 REST API v7.0.0.x User's Guide

Last Update: 2/27/2019 4:29PM

Release Notes

3

Requirements

3

Introduction

3

Swagger/OpenAPI and Client Code Generation

4

Abbreviations/Glossary of Terms

5

API Notes

5

General

5

GET (lists) versus GET (single item)

5

PUT

6

Alarms

6

PUT /v1.0/Alarms/{id}

6

Badges

6

GET /v1.0/Badges

6

Filter Parameter

6

OrderBy Parameter

7

LastCardTimestamp and LastCardholderTimestamp Parameters

8

GET /v1.0/Badges/LastModification

8

Cards

8

GET /v1.0/Cards

8

POST v1.0/Cards/{id} and PUT v1.0/Cards{id}

9

Card Event Reporting - CardEvents with PUT/POST

9

Cardholders

10

POST v1.0/Cardholders/{id} and PUT v1.0/Cards/{id}

10

Columns

10

GET /v1.0/Columns/{tableName}

10

Messages - Events, Alarms and Change of State Notifications

10

Polling

10

SignalR

10

Message Data

11

Release Notes

? Web API version increased to 7.0.0.x to coincide with the version of Access It!

Requirements

? HTTPS is now required to use the Web API. ? The Web API must be activated on the Access It dongle. ? A client key must be entered into the system, using either the thick client or the web

client, in order to activate the Web API. (Provided by RS2) ? A seperate Public Key must be passed with all calls to the API for the call to work.

(Provided by RS2)

Introduction

The RS2 REST API can be used for the following purposes:

Fetch system data including hardware settings and events. Update system data such as reader and card settings. Execute commands on hardware such as unlocking a door or executing a macro.

There is comprehensive online documentation available and that should be the first point of reference for a developer looking to integrate with the API. This document is intended to provide additional notes and information that could not easily be included in the online documentation.

If the Web API feature is enabled and the Access It! service is running then the online documentation will be available at the following URL:

http://(Access It! Server):(Port)/swagger/ui/index

Note that the Web API port is 55459 by default but can be set to a different number within the Access It! Universal software from the "Edit Server" screen.

Accessing the above URL will provide a list of available API calls as shown below:

Clicking on each item in the list will reveal more details about the API calls available for each area of the API (Alarm, Badge, etc.). It is possible to send GET/POST/PUT commands directly using the above web interface. Basic authentication is used for all calls and we strongly recommend using SSL (https) in production. A valid Access It! username/password must be supplied when executing each command. A permission check will be applied to each REST call according to the username provided.

Swagger/OpenAPI and Client Code Generation

Swagger (also known as OpenAPI) is an API description format for REST APIs. It is analogous to the WSDL document format that is often used to describe a SOAP-based web service. For more information see .

The Swagger/OpenAPI description document (in JSON format) for RS2's REST API can be viewed here:

http://(Access It! Server):(Port)/swagger/docs/v1.0

This JSON document can easily be imported into the Postman application (see: ) if desired. Postman provides another way to quickly try out the API.

The Swagger description document can also be used to generate client code in many languages using Swagger-CodeGen (see: ). Alternatively, a developer can write their own custom code to execute HTTP GET/PUT/POST commands if preferred.

Abbreviations/Glossary of Terms

The reader can learn more about Access It! by using the help documentation that is included with that software (accessed using the File -> help menu item). This will help with understanding basic terminology such as "Timezone", "Interval", "Precision Access", and "Access Level". The reader should also be aware of the following abbreviations and/or terms that are used within the API:

SCP

Abbreviation

SIO

CP (e.g. CPNumber) ACR (e.g. ACRNumber) MP (e.g. MPNumber) Ack (e.g. SecureAck)

Meaning

System Control Processor board (main board)

System Input/Output board (typically used to provide extra inputs/outputs/readers)

Output (e.g. Output Number)

Reader (e.g. Reader Number)

Input (e.g. Input Number)

Acknowledgement (e.g. Secure Acknowledgement)

API Notes

General

GET (lists) versus GET (single item)

There are often two different GET requests per item - one that returns a list of items and another that returns a single item. For some items the GET request that returns a list (e.g. list of cards) does not return as much item data as the GET request for a single item (e.g. a single card). This

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download