Lists comments on a post. Without limit every match comes back.
Post Comments
Comments on blog posts.
List comments on a post#
GET
/cdna-api/blogs/post-comments/{post.id}
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Comment, in the Reference
Parameters
post.idpathrequired- integer
- The blog post id.
propertiesquery- selector
- The fields and relations to return, such as
{id,text,published}. filtersquery- name=value
- Any stored field, or a relation with a dot, such as
parent.id=12. Prefix the name with!,>,<,%or|. Use stored field names exactly as in the model, and comparetotalCountwith the unfiltered list's to confirm a filter applied. orderByquery- string
field:ASCorfield:DESC, comma-separated. Stored fields only.limitquery- integer
- Records per response. There is no default.
offsetquery- integer
- Records to skip.
Example
List comments on a post
GET /cdna-api/blogs/post-comments/1 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": {
"comments": [
{
"id": 2,
"text": "Changed comment from API 744",
"created": "2020-12-28T23:29:23+01:00",
"modified": "2021-01-11T13:25:18+01:00",
"published": "2020-12-28T23:29:18+01:00",
"parent": null
},
{
"id": 3,
"text": "<p>A comment</p>",
"created": "2020-12-28T23:29:53+01:00",
"modified": "2020-12-28T23:29:53+01:00",
"published": "2020-12-28T23:29:46+01:00",
"parent": null
}
]
}
}
Open in Postman docs Saved response from the Postman collection, shortened
Create a comment#
POST
/cdna-api/blogs/comment/{post.id}
Creates a comment.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
post.idpathrequired- integer
- The blog post id.
textbody- string
- The body, as HTML.
Example
Create a comment
POST /cdna-api/blogs/comment/3 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"text": "Added test comment from API 273"
}
Response
200 OK
{
"result": "success",
"data": {
"comment": {
"id": 6,
"text": "Added test comment from API 889",
"created": "2021-01-11T13:24:02+01:00",
"modified": "2021-01-11T13:24:02+01:00",
"published": false,
"person": null,
"parent": null,
"children": [],
"post": 3
}
},
"message": "The Comment has been added successfully."
}
Open in Postman docs Saved response from the Postman collection
Show a comment#
GET
/cdna-api/blogs/comment/{id}
Reads one comment by its id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- Comment, in the Reference
Parameters
idpathrequired- integer
- The comment id.
propertiesquery- selector
- The fields and relations to return, such as
{id,text,published}.
Example
Show a comment
GET /cdna-api/blogs/comment/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": {
"comment": {
"id": 2,
"text": "<p>Some comment</p>",
"created": "2020-12-28T23:29:23+01:00",
"modified": "2020-12-28T23:29:23+01:00",
"person": null,
"post": {
"name": "A blog post"
}
}
}
}
Open in Postman docs Saved response from the Postman collection
Edit a comment#
PUT
/cdna-api/blogs/comment/{id}
Changes a comment. Fields left out keep their values.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
idpathrequired- integer
- The comment id.
textbody- string
- The body, as HTML.
Example
Edit a comment
PUT /cdna-api/blogs/comment/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"text": "Changed comment from API 898"
}
Response
200 OK
{
"result": "success",
"data": {
"comment": {
"id": 2,
"text": "Changed comment from API 744",
"created": "2020-12-28T23:29:23+01:00",
"modified": "2021-01-11T13:25:18+01:00",
"published": "2020-12-28T23:29:18+01:00",
"person": null,
"parent": null,
"children": [],
"post": 1
}
},
"message": "The Comment has been saved successfully."
}
Open in Postman docs Saved response from the Postman collection
Delete a comment#
DELETE
/cdna-api/blogs/comment/{id}
Deletes a comment.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
idpathrequired- integer
- The comment id.
Example
Delete a comment
DELETE /cdna-api/blogs/comment/6 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": {
"comment": {
"id": 6,
"text": "Added test comment from API 889",
"created": "2021-01-11T13:24:02+01:00",
"modified": "2021-01-11T13:24:02+01:00",
"published": false,
"person": null,
"parent": null,
"children": [],
"post": 3
}
},
"message": "The Comment has been successfully deleted."
}
Open in Postman docs Saved response from the Postman collection