Skip to content

Ge0rgeAshraf/BoschSecureOSIntegration

Repository files navigation

Bosch & ISS SecureOS Integration API

Overview

This API enables integration between Bosch Access Control and ISS SecureOS VMS, allowing gates to open automatically when a registered car's plate number is detected. Users interact with the system via a mobile app.

Please See the ex1 and ex2 pictures and text files first to know how to input the plate number.


Features

  • User registration and email verification via OTP.
  • JWT-based authentication.
  • Plate number registration and gate-opening functionality.

API Endpoints

Users

Register a User

Endpoint: POST /api/Users/register Description: Registers a new user.

Request Example:

{
  "name": "John Doe",
  "email": "johndoe@example.com",
  "password": "SecurePass123"
}

Response:

  • 200 OK: User registered successfully.
  • 400 Bad Request: Invalid input, email already exists, invalid email format, or weak password.

Error Response Example:

{
  "message": "Email already exists"
}

Send OTP

Endpoint: POST /api/Users/send-otp Description: Sends an OTP to the user's email for verification.

Request Example:

{
  "email": "johndoe@example.com"
}

Response:

  • 200 OK: OTP sent successfully.
  • 400 Bad Request: User not found or email not provided.

Error Response Example:

{
  "message": "User not found"
}

Confirm User

Endpoint: POST /api/Users/confirm-user Description: Verifies the user's email using the OTP.

Request Example:

{
  "email": "johndoe@example.com",
  "otp": "123456"
}

Response:

  • 200 OK: OTP verified successfully.
  • 400 Bad Request: OTP not sent, expired, or invalid.
  • 500 Internal Server Error: Error occurred while confirming the user.

Error Response Example:

{
  "message": "Invalid OTP"
}

Login

Endpoint: POST /api/Users/login Description: Logs in the user and returns a JWT token.

Request Example:

{
  "email": "johndoe@example.com",
  "password": "SecurePass123"
}

Response:

  • 200 OK: User logged in successfully, returns JWT token.
  • 400 Bad Request: Invalid credentials or user not confirmed.
  • 401 Unauthorized: Invalid credentials.

Error Response Example:

{
  "message": "Invalid credentials"
}

Tickets

Get All Tickets

Endpoint: GET /api/Tickets Description: Fetches all tickets.

Headers:

  • Authorization: Bearer token (Mandatory)

Response Example:

[
  {
    "id": 1,
    "userId": 42,
    "plateNumber": "ABC123",
    "dateTime": "2024-12-11T13:49:11.611Z"
  }
]

Error Response Example:

{
  "message": "Unauthorized access"
}

Create a Ticket

Endpoint: POST /api/Tickets Description: Registers a new plate number.

Headers:

  • Authorization: Bearer token (Mandatory)

Request Example:

{
  "plateNumber": "XYZ789"
}

Response Example:

{
  "id": 2,
  "userId": 42,
  "plateNumber": "XYZ789",
  "dateTime": "2024-12-11T13:49:11.613Z"
}

Error Response Example:

{
  "message": "Invalid plate number format"
}

Usage Flow

  1. Register a User: Use /api/Users/register to create an account.
  2. Send OTP: Use /api/Users/send-otp to send an OTP to the registered email.
  3. Confirm User: Use /api/Users/confirm-user to verify the email with the OTP.
  4. Login: Use /api/Users/login to log in and receive a JWT token.
  5. Add Plate Number: Use /api/Tickets to register a car's plate number.
  6. Automatic Gate Opening: Once the plate is registered, the gate opens when the VMS detects the car.

Notes

  • JWT tokens are valid for 1 day.
  • Ensure the backend server and VMS system are properly configured for smooth integration.

For Further Questions

Contact the backend development team.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages