- Event List API, where we can get all active events with pagination.
GET Method
http://localhost:3000/api/v1/events?page=1&limit=10
Response:
{
"events": [
{
"id": 1,
"title": "Dhaka-event",
"start_at": "2023-01-05T00:59:01.000Z",
"end_at": "2023-01-05T00:59:01.000Z"
},
{
"id": 2,
"title": "Mymensingh-event",
"start_at": "2023-02-05T00:59:01.000Z",
"end_at": "2023-02-05T00:59:01.000Z"
},
{
"id": 3,
"title": "Khulns-event",
"start_at": "2023-03-05T00:59:01.000Z",
"end_at": "2023-03-05T00:59:01.000Z"
},
{
"id": 4,
"title": "Sylhet-event",
"start_at": "2023-04-05T00:59:01.000Z",
"end_at": "2023-04-05T00:59:01.000Z"
},
{
"id": 5,
"title": "Rajshahi-event",
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z"
}
],
"paginate": {
"total": 5,
"per_page": 10,
"total_pages": 1,
"current_page": 1
}
}
- Event Details API, where we can get single event information.
GET Method
params: 5
http://localhost:3000/api/v1/events/details/:id
Response:
{
"event": {
"id": 5,
"title": "Rajshahi-event",
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z",
"total_workshops": "0"
}
}
- Workshop List API, where we can get all the active workshops of a single event.
GET Method
params: 5
http://localhost:3000/api/v1/workshops/:id
Response:
{
"event": {
"id": 5,
"title": "Rajshahi-event",
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z",
"workshop": [
{
"id": 5,
"event_id": 5,
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z",
"title": "workshop-title-Rajshahi",
"description": "workshop-description-Rajshahi"
}
]
}
}
- Workshop Details API, where we can get single workshop information.
GET Method
params: 5
http://localhost:3000/api/v1/workshops/details/:id
Response:
{
"workshop": {
"id": 5,
"event_id": 5,
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z",
"title": "workshop-title-Rajshahi",
"description": "workshop-description-Rajshahi",
"total_reservations": "1"
}
}
- Make a workshop reservation API.
POST Method
http://localhost:3000/api/v1/workshops/details/:id
POST Body:
{
"name": "rabby",
"email": "rabby@gmail.com",
"workshop_id": 5
}
Response:
{
"reservation": {
"name": "rabby",
"email": "rabby@gmail.com",
"workshop_id": 5
},
"events": {
"id": 5,
"title": "Rajshahi-event",
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z",
"workshops": [
{
"id": 5,
"event_id": 5,
"start_at": "2023-05-05T00:59:01.000Z",
"end_at": "2023-05-05T00:59:01.000Z",
"title": "workshop-title-Rajshahi",
"description": "workshop-description-Rajshahi"
}
]
}
}
POST Method
http://localhost:3000/api/v1/events/create
POST Body:
{
"title": "Rajshahi-event",
"start_at": "2023-5-5T06:59:01.107Z",
"end_at": "2023-5-5T06:59:01.107Z"
}
POST Method
http://localhost:3000/api/v1/workshops/create
POST Body:
{
"event_id": 25,
"start_at": "2023-5-5T06:59:01.107Z",
"end_at": "2023-5-5T06:59:01.107Z",
"title": "workshop-title-Rajshahi",
"description": "workshop-description-Rajshahi"
}