Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the files. #100

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions API_DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# API Documentation

## Overview
This document provides a detailed description of each API endpoint in the FaceRec project, including inputs, outputs, and how various scenarios are handled.

## API Endpoints

### 1. Create a New Face Entry
**Endpoint**: `/api/face-entry/create`
**Method**: `POST`
**Description**: Receives an image and metadata to create a new face entry.

**Request Body**:
```json
{
"Employeecode": "string",
"Name": "string",
"gender": "string",
"Department": "string",
"Image": "base64 encoded image"
}
```

**Response**:
- **Success (201 Created)**:
```json
{
"message": "Face entry created successfully",
"id": "unique identifier"
}
```
- **Error (400 Bad Request)**:
```json
{
"error": "Invalid input data"
}
```

### 2. Get All Face Entries
**Endpoint**: `/api/face-entry/data`
**Method**: `GET`
**Description**: Retrieves the list of all face entries.

**Response**:
- **Success (200 OK)**:
```json
[
{
"id": "unique identifier",
"Employeecode": "string",
"Name": "string",
"gender": "string",
"Department": "string",
"time": "timestamp",
"embeddings": "array of numbers",
"Image": "base64 encoded image"
},
...
]
```

### 3. Update a Face Entry
**Endpoint**: `/api/face-entry/update/{Employeecode}`
**Method**: `PUT`
**Description**: Updates the details of an existing face entry.

**Request Body**:
```json
{
"Name": "string",
"gender": "string",
"Department": "string"
}
```

**Response**:
- **Success (200 OK)**:
```json
{
"message": "Face entry updated successfully"
}
```
- **Error (404 Not Found)**:
```json
{
"error": "Face entry not found"
}
```

### 4. Delete a Face Entry
**Endpoint**: `/api/face-entry/delete/{Employeecode}`
**Method**: `DELETE`
**Description**: Deletes a specific face entry by employee code.

**Response**:
- **Success (200 OK)**:
```json
{
"message": "Face entry deleted successfully"
}
```
- **Error (404 Not Found)**:
```json
{
"error": "Face entry not found"
}
```

## Error Handling
- **400 Bad Request**: Returned when the input data is invalid or missing required fields.
- **404 Not Found**: Returned when the requested resource (face entry) is not found in the database.
- **500 Internal Server Error**: Returned when there is an unexpected error on the server.

## Conclusion
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.

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ Thanks to all the amazing people who have contributed to **FaceRec**! 💖

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

## 📄 Documentation

For detailed API documentation, please refer to the [API Documentation](API_DOCUMENTATION.md) file.


## 📄 License

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

Loading