Version 1.0
Fetches a list of all forums with their replies.
GET /api/forums HTTP/1.1
200 OK
[
{
"id": 1,
"title": "Forum Title 1",
"name": "John Doe",
"email": "john@example.com",
"message": "This is the forum message.",
"replies": [
{
"id": 1,
"name": "Jane Doe",
"reply": "This is a reply.",
"formId": 1
}
]
},
{
"id": 2,
"title": "Forum Title 2",
"name": "Alice",
"email": "alice@example.com",
"message": "Another forum message.",
"replies": []
}
]
Creates a new forum entry.
POST /api/forums HTTP/1.1
Content-Type: application/json
{
"title": "New Forum Title",
"name": "John Doe",
"email": "john@example.com",
"message": "This is the forum content."
}
201 Created
{
"id": 3,
"title": "New Forum Title",
"name": "John Doe",
"email": "john@example.com",
"message": "This is the forum content.",
"replies": []
}
Fetches details of a specific forum by its ID, including its replies.
GET /api/forums/1 HTTP/1.1
200 OK
{
"id": 1,
"title": "Forum Title 1",
"name": "John Doe",
"email": "john@example.com",
"message": "This is the forum message.",
"replies": [
{
"id": 1,
"name": "Jane Doe",
"reply": "This is a reply.",
"formId": 1
}
]
}
Fetches all replies for a specific forum.
GET /api/forums/1/replies HTTP/1.1
200 OK
[
{
"id": 1,
"name": "Jane Doe",
"reply": "This is a reply to the forum.",
"formId": 1
},
{
"id": 2,
"name": "Alice",
"reply": "Another reply.",
"formId": 1
}
]
Adds a reply to an existing forum.
POST /api/forums/1/replies HTTP/1.1
Content-Type: application/json
{
"name": "Jane Doe",
"reply": "This is a reply to the forum."
}
201 Created
{
"id": 1,
"name": "Jane Doe",
"reply": "This is a reply to the forum.",
"formId": 1
}