API Endpoints

<column-name> mentioned in the endpoints below is refereed to the comments table's column name in the database.

Demo

Test the endpoints below online by replacing http://127.0.0.1:8000/api with the following URL:

https://over-demo.herokuapp.com/api

Get Comments

GET http://127.0.0.1:8000/api/comments/get

This endpoint allows you to get comments by the given query parameters (single/multiple) with filtering and pagination, If no parameter given, it will return all the comments in the database.

Query Parameters

// Without pagination
{
    "data": [
        ...
        ...
    ]
}

// with pagination
{
    "data": [
        ...
        ...
    ],
    "isLastPage": true,
    "totalPages": 1
}

Create a comment

POST http://127.0.0.1:8000/api/comments/create

This endpoint allows you to create a comment

Request Body

{ message: "Created Successfully." }

Update a comment

PUT http://127.0.0.1:8000/api/comments/update

This endpoint allows you to update a comment byid and the <column-name> you want to be updated (single/Multiple).

Query Parameters

{ message: "Updated Successfully." }

Delete a comment

DELETE http://127.0.0.1:8000/api/comments/delete

This endpoint allows you to delete a comment by id

Query Parameters

{ message: "The record has been deleted!" }

Last updated