Feedback API Documentation

Submit Feedback

This endpoint allows users to submit feedback, optionally with an attachment.

curl -X POST "https://yourdomain.com/feedback/submit" \
     -F "user_type=ANONYMOUS" \
     -F "name=John Doe" \
     -F "email=john.doe@example.com" \
     -F "category=Bug Report" \
     -F "subject=Login Issue" \
     -F "message=Unable to login with valid credentials." \
     -F "attachment=@/path/to/your/file.png"
    

Sample Response:

{
    "status": 1,
    "message": "Feedback submitted and email sent successfully"
}
    

List Feedback

This endpoint retrieves a list of feedback entries with optional filters and pagination.

curl -X POST "https://yourdomain.com/feedback/list" \
     -H "Content-Type: application/json" \
     -d '{
         "filters": {
             "user_type": "STUDENT",
             "category": "Bug Report",
             "status": "New",
             "search": "login"
         },
         "offset": 0,
         "limit": 10
     }'
    

Sample Response:

{
    "status": 1,
    "totalRecords": 2,
    "data": [
        {
            "feedback_id": "1",
            "user_id": "2",
            "user_type": "STUDENT",
            "name": null,
            "email": null,
            "category": "Bug Report",
            "subject": "Login Issue",
            "message": "Unable to login with valid credentials.",
            "attachment_url": "uploads/feedback/5f2b5c7e8a9a1.png",
            "status": "New",
            "created_at": "2024-09-17 10:15:30",
            "updated_at": "2024-09-17 10:15:30"
        },
        {
            "feedback_id": "2",
            "user_id": "3",
            "user_type": "STUDENT",
            "name": null,
            "email": null,
            "category": "Bug Report",
            "subject": "Error on Dashboard",
            "message": "Seeing a 500 error when accessing the dashboard.",
            "attachment_url": null,
            "status": "New",
            "created_at": "2024-09-18 09:20:10",
            "updated_at": "2024-09-18 09:20:10"
        }
    ],
    "categories": ["Bug Report", "Feature Request", "General Feedback", "Other"],
    "statuses": ["New", "In Progress", "Resolved", "Closed"],
    "user_types": ["STAFF", "STUDENT", "PARENTS", "GUARDIAN", "ANONYMOUS"]
}
    

View Specific Feedback

This endpoint retrieves details of a specific feedback entry by its ID.

curl -X POST "https://yourdomain.com/feedback/view" \
     -H "Content-Type: application/json" \
     -d '{
         "feedback_id": 1
     }'
    

Sample Response:

{
    "status": 1,
    "data": {
        "feedback_id": "1",
        "user_id": "2",
        "user_type": "STUDENT",
        "name": null,
        "email": null,
        "category": "Bug Report",
        "subject": "Login Issue",
        "message": "Unable to login with valid credentials.",
        "attachment_url": "uploads/feedback/5f2b5c7e8a9a1.png",
        "status": "New",
        "created_at": "2024-09-17 10:15:30",
        "updated_at": "2024-09-17 10:15:30"
    }
}
    

Delete Feedback

This endpoint deletes a specific feedback entry by its ID.

curl -X POST "https://yourdomain.com/feedback/delete" \
     -H "Content-Type: application/json" \
     -d '{
         "feedback_id": 1
     }'
    

Sample Response:

{
    "status": 1,
    "message": "Feedback deleted successfully"
}
    

Update Feedback Status

This endpoint updates the status of a specific feedback entry.

curl -X POST "https://yourdomain.com/feedback/update_status" \
     -H "Content-Type: application/json" \
     -d '{
         "feedback_id": 1,
         "status": "Resolved"
     }'
    

Sample Response:

{
    "status": 1,
    "message": "Feedback status updated successfully"
}
    

Notes