hngprojects / hng_boilerplate_golang_web

Apache License 2.0
77 stars 50 forks source link

FEAT: Get messages with email gotten from contact us page #278

Closed Ajinx1 closed 3 months ago

Ajinx1 commented 3 months ago

Description

Develop an API endpoint to retrieve a contact record by email with appropriate authentication and authorization.

Acceptance Criteria

Authorization: Bearer <token>

Response

{
    "status": "success",
    "status_code": 200,
    "message": "Contact record 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 a specific contact record by email.

Requirements

Expected Outcome

Tasks

Testing