Comments
Comments are collection of comment. On this page, we'll dive into the different comment endpoints you can use to manage comments programmatically. We'll look at how to query, comments.
The comment model
The comment model contains all the information about your comments, including tags, the comment's name, description, and avatar.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the comment.
- Name
publication_id
- Type
- number
- Description
The id of the publication.
- Name
post_id
- Type
- number
- Description
The id of the post.
- Name
user_id
- Type
- string
- Description
The ID of the user, if logged in.
- Name
name
- Type
- string
- Description
The name of the user.
- Name
email
- Type
- string
- Description
The email of the user.
- Name
content
- Type
- string
- Description
The text content of the comment.
- Name
parent_id
- Type
- string
- Description
The ID of the parent, if its a reply.
- Name
status
- Type
- string
- Description
The status of the comment.
- Name
created_at
- Type
- timestamp
- Description
The timestamp of comment create time.
- Name
updated_at
- Type
- timestamp
- Description
The timestamp of comment update time.
GET/comments/{post_id}
Get post comments
This endpoint allows you to retrieve all comments of a single post.
Request
GET
/app/{subdomain}/comments/{post_id}curl -G https://api.bloghunch.com/app/{subdomain}/comments/{post_id} \
-H "Authorization: Bearer {token}"
Response
[
{
"id": 24,
"publication_id": 3719,
"post_id": 406856,
"user_id": null,
"name": "Team BlogHunch",
"email": "team@bloghunch.com",
"content": "Hi, this is a comment. To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard. Commenter avatars come from Gravatar.",
"parent_id": null,
"status": "approved",
"created_at": "2023-02-10T13:59:50.000+05:30",
"updated_at": "2023-02-10T13:59:50.000+05:30"
}
...
]