Rest API

Introduction

The goal of this API is to promote an easy access to all of the data that can be displayed in the dashboard. The data and our resources are accessed by URIs. The clients send requests to these URIs using the methods defined by the HTTP protocol to obtain data relative to that specific endpoint.

ActionMethodDescription
CreatePOSTCreate a new unique object
ReadGETObtain information about a object or collection of objects

Endpoints

Sniffing Information

GET /api/sniffing

GET /api/sniffingunique

Detection Information

GET /api/people

GET /api/peopleunique

GET /api/vehicle

GET /api/vehicleunique

GET /api/twowheeler

GET /api/twowheelerunique

Sensors

These ends points return information related to the status of the services running on the different detection modules. This allows the application to know when the services stop running and to alert the administrator in case of such event.

GET /api/sensors/p22_apu

GET /api/sensors/p1_apu

GET /api/sensors/pei_jetson

Camera controls

There are also endpoints that control the movement of a rotational camera. All of these endpoints follow the the call structure https://dev.aveiro-open-lab.pt/api/cam/<action>.

POST | GET /api/cam/up

POST | GET /api/cam/down

POST | GET /api/cam/left

POST | GET /api/cam/right

POST | GET /api/cam/upleft

POST | GET /api/cam/upright

POST | GET /api/cam/downright

POST | GET /api/cam/downleft

POST | GET /api/cam/zoomin

POST | GET /api/cam/zoomout

POST | GET /api/cam/focusin

POST | GET /api/cam/focusout

POST | GET /api/cam/irisin

POST | GET /api/cam/irisout

POST | GET /api/cam/auto

POST | GET /api/cam/autostop

Authentication

There are reserved endpoints that allow the authentication of users and thus control the access to certain resources.

POST /login

POST /signup

POST /logout

Access to external APIs

Since the data is being persisted in a IT database, there is an access to the NAP group’s API to obtain all the needed data. This leads to the necessity of obtaining daily tokens to be able to execute sucessful requests.

In addition, to control the IP camera installed in Cais da Fonte Nova through the developed methods, a token is also required, so a new one is obtained everytime the status of the requests to the camera’s API are not successful.