Get comments for article (public)
curl --request GET \
--url https://api.octaviatech.app/cms/articles/{id}/comments \
--header 'x-api-key: <api-key>'import requests
url = "https://api.octaviatech.app/cms/articles/{id}/comments"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.octaviatech.app/cms/articles/{id}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.octaviatech.app/cms/articles/{id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.octaviatech.app/cms/articles/{id}/comments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.octaviatech.app/cms/articles/{id}/comments")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/articles/{id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Comments retrieved successfully",
"data": {
"comments": [
{
"_id": "{{objectId}}",
"articleId": "{{objectId}}",
"actorType": "user",
"actorKey": "u:{{objectId}}",
"userId": {
"_id": "{{objectId}}",
"firstName": "Ada",
"lastName": "Lovelace",
"avatar": "https://cdn.example.com/a.jpg"
},
"parentId": null,
"content": "Great write-up, thanks for sharing.",
"likes": 2,
"dislikes": 0,
"status": "approved",
"isDeleted": false,
"createdAt": "2025-05-22T21:42:41.596Z",
"updatedAt": "2025-05-22T21:42:41.596Z",
"userReaction": "like"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1
}
}
}{
"success": false,
"statusCode": 400,
"message": "Invalid parentId",
"data": null
}{
"success": false,
"statusCode": 404,
"message": "Article not found",
"data": null
}{
"success": false,
"statusCode": 500,
"message": "Server Error",
"data": null
}Articles
Get comments for article (public)
Paginated list of approved, non-deleted comments for the article, each with the author (firstName, lastName, avatar) and the caller’s own reaction. When comments are disabled for the article, category, or sub-category, an empty list is returned with 200 instead of an error.
GET
/
articles
/
{id}
/
comments
Get comments for article (public)
curl --request GET \
--url https://api.octaviatech.app/cms/articles/{id}/comments \
--header 'x-api-key: <api-key>'import requests
url = "https://api.octaviatech.app/cms/articles/{id}/comments"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.octaviatech.app/cms/articles/{id}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.octaviatech.app/cms/articles/{id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.octaviatech.app/cms/articles/{id}/comments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.octaviatech.app/cms/articles/{id}/comments")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.octaviatech.app/cms/articles/{id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"message": "Comments retrieved successfully",
"data": {
"comments": [
{
"_id": "{{objectId}}",
"articleId": "{{objectId}}",
"actorType": "user",
"actorKey": "u:{{objectId}}",
"userId": {
"_id": "{{objectId}}",
"firstName": "Ada",
"lastName": "Lovelace",
"avatar": "https://cdn.example.com/a.jpg"
},
"parentId": null,
"content": "Great write-up, thanks for sharing.",
"likes": 2,
"dislikes": 0,
"status": "approved",
"isDeleted": false,
"createdAt": "2025-05-22T21:42:41.596Z",
"updatedAt": "2025-05-22T21:42:41.596Z",
"userReaction": "like"
}
],
"pagination": {
"total": 1,
"page": 1,
"limit": 20,
"totalPages": 1
}
}
}{
"success": false,
"statusCode": 400,
"message": "Invalid parentId",
"data": null
}{
"success": false,
"statusCode": 404,
"message": "Article not found",
"data": null
}{
"success": false,
"statusCode": 500,
"message": "Server Error",
"data": null
}Authorizations
Path Parameters
Pattern:
^[a-fA-F0-9]{24}$Example:
"{{objectId}}"
Query Parameters
Required range:
x >= 1Example:
1
Defaults to 20, capped at 100
Required range:
1 <= x <= 100Example:
20
Sort by creation time. Any value other than asc means newest first.
Available options:
asc, desc Example:
"desc"
Return only replies to this comment. Takes precedence over rootOnly.
Pattern:
^[a-fA-F0-9]{24}$Example:
"{{objectId}}"
Set to true to return only top-level comments. Ignored when parentId is provided.
Example:
"true"
Response
OK
Was this page helpful?

