Feedback API

Submit and retrieve user feedback

POST
/api/users/user/{userId}/feedback

Description

Submit feedback from a user. This endpoint allows users to send feedback messages to the application.

Request Body

{
  "feedbackMessage": "I really like the new mood tracking feature!"
}

Response

{
  "success": true,
  "feedbackId": "kjzl6hvfrbw6c8b9wqj0xxj9j4wcqrv1vj8h3",
  "message": "Feedback submitted successfully"
}

Error Responses

Missing User ID (400 Bad Request)

{
  "error": "Missing user ID parameter"
}

Missing Feedback Message (400 Bad Request)

{
  "error": "Feedback message is required"
}

Server Error (500 Internal Server Error)

{
  "error": "Internal server error",
  "code": "internal_error"
}

Implementation Notes

  • The feedback system allows users to submit feedback messages about their experience with the application.
  • Users can retrieve their own feedback history through the GET endpoint.
  • Administrators can access all feedback from all users through the admin endpoint.
  • Dates are formatted in the dd/mm/yyyy format for better readability.
  • The feedback data is stored in the Convex database and includes the user ID, message content, and creation timestamp.