hngprojects / hng_boilerplate_golang_web

Apache License 2.0
77 stars 49 forks source link

FEAT: Get all messages from contact us page with page and limit filter #276

Closed Ajinx1 closed 1 month ago

Ajinx1 commented 1 month ago

Description

Develop an API endpoint to retrieve all contact records with appropriate authentication and authorization.

Acceptance Criteria

Authorization: Bearer <token>

Response

{
    "status": "success",
    "status_code": 200,
    "message": "Messages retrieved successfully",
    "data": [
        {
            "id": "uuid1",
            "name": "John Doe",
            "email": "johndoe@example.com",
            "subject": "Inquiry",
            "message": "I would like to know more about your services."
        }
    ]
}

Unsuccessful Response:

Authorization Error Response:

{
    "status": "error",
    "status_code": 403,
    "message": "role not authorized!"
}

Purpose

Provides a backend service that allows authorized users to retrieve all contact records.

Requirements

Expected Outcome

Tasks

Testing