The Mobile Continuous Authentication Metrics API provides endpoints to manage and retrieve metrics related to phone battery, touch dynamics, and virtual keyboard usage.
All endpoints are prefixed with the base URL: http://127.0.0.1:8000/api
-
URL:
POST /battery-metrics/create -
Description: Inserts battery metrics for a specific phone.
-
Parameters:
{device_id}: The device id of the phone.{android_version}: The android version of the phone.{voltage}: The voltage of the phone. (Must be a number){current}: The current of the phone. (Must be a number)
-
Response:
- Status Code: 200 OK
- Body: message and an object of the inserted metrics
-
URL:
GET /battery-metrics -
Description: Get a list of battery metrics.
-
Parameters:
- No paramaters needed
-
Response:
- Status Code: 200 OK
- Body: Array of battery metrics.
-
URL:
GET /battery-metrics/{device_id} -
Description: Get a list of battery metrics for a specific phone.
-
Parameters:
{device_id}: The device id of the phone.
-
Response:
- Status Code: 200 OK
- Body: Array of battery metrics.
-
URL:
POST /touch-dynamics/create -
Description: Inserts touch dynamics metrics for a specific phone.
-
Parameters:
{device_id}: The device id of the phone.{android_version}: The android version of the phone.{finger_pressure}: The voltage of the finger pressure. (Must be a number){finger_blocked_area}: The value of finger blocked area. (Must be a number){hold_time}: The value of hold time. (Must be a number){finger_orientation}: The finger orientation value.
-
Response:
- Status Code: 200 OK
- Body: message and an object of the inserted metrics
-
URL:
GET /touch-dynamics -
Description: Get a list of touch dynamics metrics.
-
Parameters:
- No paramaters needed
-
Response:
- Status Code: 200 OK
- Body: Array of touch dynamics.
-
URL:
GET /touch-dynamics/{device_id} -
Description: Get a list of touch dynamics metrics for a specific phone.
-
Parameters:
{device_id}: The device id of the phone.
-
Response:
- Status Code: 200 OK
- Body: Array of touch dynamics.
-
URL:
POST /virtual-keyboard-metrics/create -
Description: Inserts virtual keyboard dynamics metrics for a specific phone.
-
Parameters:
{device_id}: The device id of the phone.{android_version}: The android version of the phone.{flight_time}: The voltage of the flight time. (Must be a number){key_hold_time}: The value of key hold time. (Must be a number){finger_pressure}: The value of finger pressure. (Must be a number){finger_area}: The value of finger area. (Must be a number)
-
Response:
- Status Code: 200 OK
- Body: message and an object of the inserted metrics
-
URL:
GET /virtual-keyboard-metrics -
Description: Get a list of virtual keyboard dynamics metrics.
-
Parameters:
- No paramaters needed
-
Response:
- Status Code: 200 OK
- Body: Array of touch dynamics.
-
URL:
GET /virtual-keyboard-metrics/{device_id} -
Description: Get a list of virtual keyboard dynamics metrics for a specific phone.
-
Parameters:
{device_id}: The device id of the phone.
-
Response:
- Status Code: 200 OK
- Body: Array of virtual keyboard dynamics.
-
URL:
GET /phones -
Description: Get a list of phones and their metrics (battery, touch dynamics and keystrokes).
-
Parameters:
- No paramaters needed
-
Response:
- Status Code: 200 OK
- Body: Array of touch dynamics.
-
URL:
GET /phones/{device_id} -
Description: Get a specific phone and its metrics.
-
Parameters:
{device_id}: The device id of the phone.
-
Response:
- Status Code: 200 OK
- Body: Array of metrics for a specific phone.
This guide will help you set up this project on your local machine.
Make sure you have the following installed on your machine:
-
Clone the repository:
git clone https://github.com/DallingtonAsin/biometrics-api.git
-
Navigate to the project directory:
cd biometrics-api -
Install PHP dependencies:
composer install --ignore-platform-reqs
-
Copy the
.env.examplefile to create a new.envfile:cp .env.example .env
Open the .env file in your favorite text editor and configure the following:
DB_CONNECTION: Set it tomysql.DB_HOST: Database host (e.g.,127.0.0.1for local development).DB_PORT: Database port (usually3306).DB_DATABASE: Database name.DB_USERNAME: Database username.DB_PASSWORD: Database password.
Run the following commands to set up the database:
php artisan migrateStart the development server using the command below
php artisan serveVisit http://localhost:8000 in your browser to confirm the application is running.
