- Core API's
- >
- Comments API
- >
- Comments - Show
Comments - Show API
Get the specified Comment.
Method GET
Parameters
Name | Details | Type | Required |
---|---|---|---|
id
|
The ID of the Comment. | integer | Yes |
How to Use
fetch('https://simplecrudapi.com/api/comments/1')
.then(response => response.json())
.then(data => {
console.log('Comment for post 1 with ID 1:', data);
})
.catch(error => console.error(error));
Response
{
"data": {
"id": 1,
"content": "This is a beautifully crafted comment, expressing a thoughtful and engaging response to the post. It highlights key points and adds valuable insight to the conversation.",
"post": {
"id": 1,
"title": "The Future of AI in Education",
"content": "Exploring the impact of artificial intelligence on modern education systems.",
"tags": [
{
"id": 3,
"name": "nostrum",
"description": "Ab nam voluptas rem velit ratione quidem quo."
},
{
"id": 9,
"name": "aut",
"description": "Corrupti soluta provident sapiente soluta."
}
],
"created_at": "2024-11-10T13:58:06.000000Z",
"updated_at": "2024-11-10T13:58:06.000000Z"
}
}
}
Try Now
fetch('https://simplecrudapi.com/api/comments/1')
.then(response => response.json())
.then(data => {
console.log('Comment for post 1 with ID 1:', data);
})
.catch(error => console.error(error));