This project is based on the Django framework and is designed to interface with the Kernel search system for validation and interaction. After logging in, users can obtain API keys and endpoints to enable file uploads and Kernel search functionalities.
- User registration, login, and account activation.
- Password reset functionality.
- Secure file uploads to the Kernel system.
- API requests to perform authenticated searches on the Kernel system.
- User-specific daily query limits and storage management.
The login portal is located at: http://20.247.44.131:8000/. After logging in, users can retrieve their API keys and endpoint details from the API page.
Endpoint: GET /api/
Description: Lists all available API endpoints.
Endpoint: POST /api/register/
Description: Register a new user account.
Request Example:
bashcurl -X POST http://20.247.44.131:8000/api/register \
-H "Content-Type: application/json" \
-d '{
"username": "example_user",
"password": "example_password",
"email": "[email protected]"
}'
Sample Response:
json{
"message": "Registration complete. Please activate your account via email."
}
Endpoint: POST /api/token/
Description: Log in to obtain a JWT token.
Request Example:
bashcurl -X POST http://20.247.44.131:8000/api/token/ \
-H "Content-Type: application/json" \
-d '{
"username": "example_user",
"password": "example_password"
}'
Sample Response:
json{
"access": "your_access_token",
"refresh": "your_refresh_token"
}
Endpoint: POST /api/ask
Description: Send a query to the Kernel system using your API key.
Request Headers:
bashAuthorization: Bearer <your_access_token>
Request Example:
bashcurl -X POST http://20.247.44.131:8000/api/ask \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json" \
-d '{
"question": "Your query"
}'
Sample Response:
json{
"answer": "The search result"
}
Endpoint: POST /api/upload
Description: Upload files to the Kernel system (maximum file size: 10MB).
Request Example:
bashcurl -X POST http://20.247.44.131:8000/api/upload \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: multipart/form-data" \
-F "file_uploaded=@path/to/your/file"
Sample Response:
json{
"message": "Upload successful!",
"data": {
"documentId": "abc123",
"index": "user_1_index"
}
}
Endpoint: DELETE /api/deleteUploads/
Description: Delete all files uploaded by the current user.
Request Example:
bashcurl -X DELETE http://20.247.44.131:8000/api/deleteUploads/ \
-H "Authorization: Bearer <your_access_token>" \
-H "Content-Type: application/json"
Sample Response:
json{
"message": "All uploaded documents have been deleted."
}