Skip to content

Commit 3dc29eb

Browse files
Updated the files. (#100)
1 parent 76ac737 commit 3dc29eb

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed

API_DOCUMENTATION.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# API Documentation
2+
3+
## Overview
4+
This document provides a detailed description of each API endpoint in the FaceRec project, including inputs, outputs, and how various scenarios are handled.
5+
6+
## API Endpoints
7+
8+
### 1. Create a New Face Entry
9+
**Endpoint**: `/api/face-entry/create`
10+
**Method**: `POST`
11+
**Description**: Receives an image and metadata to create a new face entry.
12+
13+
**Request Body**:
14+
```json
15+
{
16+
"Employeecode": "string",
17+
"Name": "string",
18+
"gender": "string",
19+
"Department": "string",
20+
"Image": "base64 encoded image"
21+
}
22+
```
23+
24+
**Response**:
25+
- **Success (201 Created)**:
26+
```json
27+
{
28+
"message": "Face entry created successfully",
29+
"id": "unique identifier"
30+
}
31+
```
32+
- **Error (400 Bad Request)**:
33+
```json
34+
{
35+
"error": "Invalid input data"
36+
}
37+
```
38+
39+
### 2. Get All Face Entries
40+
**Endpoint**: `/api/face-entry/data`
41+
**Method**: `GET`
42+
**Description**: Retrieves the list of all face entries.
43+
44+
**Response**:
45+
- **Success (200 OK)**:
46+
```json
47+
[
48+
{
49+
"id": "unique identifier",
50+
"Employeecode": "string",
51+
"Name": "string",
52+
"gender": "string",
53+
"Department": "string",
54+
"time": "timestamp",
55+
"embeddings": "array of numbers",
56+
"Image": "base64 encoded image"
57+
},
58+
...
59+
]
60+
```
61+
62+
### 3. Update a Face Entry
63+
**Endpoint**: `/api/face-entry/update/{Employeecode}`
64+
**Method**: `PUT`
65+
**Description**: Updates the details of an existing face entry.
66+
67+
**Request Body**:
68+
```json
69+
{
70+
"Name": "string",
71+
"gender": "string",
72+
"Department": "string"
73+
}
74+
```
75+
76+
**Response**:
77+
- **Success (200 OK)**:
78+
```json
79+
{
80+
"message": "Face entry updated successfully"
81+
}
82+
```
83+
- **Error (404 Not Found)**:
84+
```json
85+
{
86+
"error": "Face entry not found"
87+
}
88+
```
89+
90+
### 4. Delete a Face Entry
91+
**Endpoint**: `/api/face-entry/delete/{Employeecode}`
92+
**Method**: `DELETE`
93+
**Description**: Deletes a specific face entry by employee code.
94+
95+
**Response**:
96+
- **Success (200 OK)**:
97+
```json
98+
{
99+
"message": "Face entry deleted successfully"
100+
}
101+
```
102+
- **Error (404 Not Found)**:
103+
```json
104+
{
105+
"error": "Face entry not found"
106+
}
107+
```
108+
109+
## Error Handling
110+
- **400 Bad Request**: Returned when the input data is invalid or missing required fields.
111+
- **404 Not Found**: Returned when the requested resource (face entry) is not found in the database.
112+
- **500 Internal Server Error**: Returned when there is an unexpected error on the server.
113+
114+
## Conclusion
115+
This documentation provides a comprehensive guide to using the FaceRec API. Following these guidelines will help ensure proper integration and usage of the API endpoints.
116+

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ Thanks to all the amazing people who have contributed to **FaceRec**! 💖
134134

135135
[![Contributors](https://contrib.rocks/image?repo=Devasy23/FaceRec)](https://github.com/Devasy23/FaceRec/graphs/contributor)
136136

137+
## 📄 Documentation
138+
139+
For detailed API documentation, please refer to the [API Documentation](API_DOCUMENTATION.md) file.
140+
141+
137142
## 📄 License
138143

139144
This project is licensed under the **APACHE License** - see the [LICENSE](LICENSE) file for details.
145+

0 commit comments

Comments
 (0)