Get Employee by ID
Employees
Get Employee by ID
Retrieve a specific employee’s profile by their ID (Admin only)
GET
Get Employee by ID
Overview
This endpoint allows administrators to retrieve detailed profile information for any employee by their employee ID. It returns the same comprehensive data structure as the profile endpoint, including clinic, role, vacation, and request statistics.Admin Access Required
This endpoint requires administrator privileges. Only users with admin role can access other employees’ profiles.
Request
Path Parameters
The unique identifier of the employee to retrieve. Must be a valid numeric ID.
Headers
Bearer token from Azure AD authentication with admin privileges
Response
Unique employee identifier
Employee’s full name
Employee’s national ID number
Employee’s email address
Employee’s phone number
Employee’s physical address
Date the employee joined (format: YYYY-MM-DD)
Date the employee left (null if currently active)
Employee’s job position/title
URL or path to profile image
Azure AD Object ID for integration
Foreign key to employee role
Foreign key to employee status
Foreign key to assigned clinic
Foreign key to department/area
Total number of requests submitted by this employee
Number of pending requests awaiting approval
Array of vacation records for the employee
Response Example
Error Handling
400 Bad Request
The provided employee ID is not a valid number
403 Forbidden
User does not have administrator privileges to access this endpoint
404 Not Found
No employee exists with the specified ID
500 Internal Error
Database connection issues or unexpected server errors
Input Validation
The endpoint performs basic sanitization:- ID Validation: Ensures
idEmpleadois a numeric value - Type Safety: Non-numeric values are rejected with a 400 error
- SQL Injection Protection: Uses parameterized queries through Sequelize ORM
Use Cases
Admin Dashboard
View detailed employee information in administrative interfaces
Request Management
Access employee details when reviewing their submitted requests
HR Operations
Manage employee records and track vacation balances
Reporting
Generate reports with comprehensive employee data