Loading...
 
Skip to main content

Api Comments Doc

Get all comments

Request URL - comments
Copy to clipboard
https://example.com/api/comments


cURL - comments
Copy to clipboard
curl -X 'GET' \ 'https://example.com/api/comments?type=article&objectId=1&offset=0&maxRecords=5' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments?type=article&objectId=1&offset=0&maxRecords=5'; $headers = [ 'Accept: application/json', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { $error_msg = curl_error($ch); echo 'Error: ' . $error_msg; } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>



Javascript - comments
Copy to clipboard
const url = 'https://example.com/api/comments?type=article&objectId=1&offset=0&maxRecords=5'; fetch(url, { method: 'GET', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer xxxxx' } }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - comments
Copy to clipboard
{ "title": "Comments", "comments": [ { "threadId": 7, "object": "1", "objectType": "article", "parentId": 0, "userName": "admin", "commentDate": 1754168128, "hits": 0, "type": "n", "points": "0.00", "votes": 0, "average": "0.0000", "title": "Untitled", "data": "Hey, first comment", "email": "", "website": "", "user_ip": "::1", "summary": "", "smiley": null, "message_id": "admin-0-333ff4a0b7@localhost", "in_reply_to": "", "comment_rating": null, "archived": null, "approved": "y", "locked": "n", "grandFather": 0, "replies_info": { "replies": [ { "threadId": 8, "object": "1", "objectType": "article", "parentId": 7, "userName": "admin", "commentDate": 1754168138, "hits": 0, "type": "n", "points": "0.00", "votes": 0, "average": "0.0000", "title": "Untitled", "data": "Good", "email": "", "website": "", "user_ip": "::1", "summary": "", "smiley": null, "message_id": "admin-7-f5b8fc3444@localhost", "in_reply_to": "admin-0-333ff4a0b7@localhost", "comment_rating": null, "archived": null, "approved": "y", "locked": "n", "parsed": "Good", "user_posts": 9, "user_level": 5, "user_email": "", "attachments": [], "is_reported": 0, "user_online": "n", "user_exists": 1, "replies_info": { "replies": [], "numReplies": 0, "totalReplies": 0 }, "level": 0, "can_edit": true } ], "numReplies": 1, "totalReplies": 1 }, "isEmpty": "n", "version": 0, "diffInfo": [], "replies_flat": [ { "threadId": 8, "object": "1", "objectType": "article", "parentId": 7, "userName": "admin", "commentDate": 1754168138, "hits": 0, "type": "n", "points": "0.00", "votes": 0, "average": "0.0000", "title": "Untitled", "data": "Good", "email": "", "website": "", "user_ip": "::1", "summary": "", "smiley": null, "message_id": "admin-7-f5b8fc3444@localhost", "in_reply_to": "admin-0-333ff4a0b7@localhost", "comment_rating": null, "archived": null, "approved": "y", "locked": "n", "parsed": "Good", "user_posts": 9, "user_level": 5, "user_email": "", "attachments": [], "is_reported": 0, "user_online": "n", "user_exists": 1, "replies_info": { "replies": [], "numReplies": 0, "totalReplies": 0 }, "level": 0, "can_edit": true } ], "parsed": "Hey, first comment", "user_posts": 9, "user_level": 5, "user_email": "", "attachments": [], "is_reported": 0, "user_online": "n", "user_exists": 1, "can_edit": true }, { "threadId": 9, "object": "1", "objectType": "article", "parentId": 0, "userName": "admin", "commentDate": 1754168149, "hits": 0, "type": "n", "points": "0.00", "votes": 0, "average": "0.0000", "title": "Untitled", "data": "Second comment", "email": "", "website": "", "user_ip": "::1", "summary": "", "smiley": null, "message_id": "admin-0-b45ea10f1f@localhost", "in_reply_to": "", "comment_rating": null, "archived": null, "approved": "y", "locked": "n", "grandFather": 0, "replies_info": { "replies": [], "numReplies": 0, "totalReplies": 0 }, "isEmpty": "n", "version": 0, "diffInfo": [], "replies_flat": [], "parsed": "Second comment", "user_posts": 9, "user_level": 5, "user_email": "", "attachments": [], "is_reported": 0, "user_online": "n", "user_exists": 1, "can_edit": true } ], "type": "article", "objectId": "1", "parentId": 0, "count": 3, "offset": 0, "maxRecords": 5, "sortMode": "commentDate_asc", "allow_post": true, "allow_remove": true, "allow_lock": true, "allow_unlock": false, "allow_archive": true, "allow_moderate": true, "allow_vote": false }



Parameters

  • type string *: Object type to get comments from. Possible values are:
    • wiki page, file gallery, poll, faq, blog post, trackeritem, article, activity

  • objectId integer *: Object ID to get comments from

  • offset integer *: Offset to start from

  • maxRecords integer *: Maximum number of records to return





Create a new comment.

Request URL - comments
Copy to clipboard
https://example.com/api/comments


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments' \ -H 'accept: application/json' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Authorization: Bearer xxxxx' \ -d 'parentId=9' \ -d 'title=My Reply' \ -d 'data=Hello test' \ -d 'objectId=1' \ -d 'type=article'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments'; $data = http_build_query([ 'parentId' => 9, 'title' => 'My Reply', 'data' => 'Hello test', 'objectId' => 1, 'type' => 'article' ]); $headers = [ 'Accept: application/json', 'Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { $error_msg = curl_error($ch); echo 'Error: ' . $error_msg; } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>



Javascript - comments
Copy to clipboard
const formData = new URLSearchParams(); formData.append('parentId', '9'); formData.append('title', 'My Reply'); formData.append('data', 'Hello test'); formData.append('objectId', '1'); formData.append('type', 'article'); fetch('https://example.com/api/comments', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Bearer xxxxx' }, body: formData.toString() }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - comments
Copy to clipboard
{ "threadId": "13", "parentId": 9, "type": "article", "objectId": "1", "feedback": [] }



Request body

  • type string *: Object type on which to create the comment. Possible values are:
    • wiki page, file gallery, poll, faq, blog post, trackeritem, article, activity

  • objectId integer *: Object ID on which to create the comment

  • offset integer *: Offset to start from

  • parentId integer Optional: Parent comment ID

  • version integer Optional: Comment version. By default, it is 0

  • title string Optional: Comment title

  • data string Optional: Comment wiki content

  • watch string Optional: Tiki boolean use format y/n

  • anonymous_name string Optional: Anonymous user name

  • anonymous_email string Optional: Anonymous user email

  • anonymous_website string Optional: Anonymous user website




Create a new comment.

Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/14' \ -H 'accept: application/json' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Authorization: Bearer xxxxx' \ -d 'title=Updated Title' \ -d 'data=Updated content'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/14'; $data = http_build_query([ 'title' => 'Updated Title', 'data' => 'Updated content', ]); $headers = [ 'Accept: application/json', 'Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { $error_msg = curl_error($ch); echo 'Error: ' . $error_msg; } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>



Javascript - comments
Copy to clipboard
const formData = new URLSearchParams(); formData.append('title', 'Updated title'); formData.append('data', 'Updated content'); fetch('https://example.com/api/comments/14', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Bearer xxxxx' }, body: formData.toString() }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - comments
Copy to clipboard
{ "threadId": 14, "comment": { "threadId": 14, "object": "1", "objectType": "article", "parentId": 9, "userName": "admin", "commentDate": 1754173243, "hits": 0, "type": "n", "points": "0.00", "votes": 0, "average": "0.0000", "title": "Updated title", "data": "Updated content", "email": "", "website": "", "user_ip": "::1", "summary": "", "smiley": "", "message_id": "admin-9-a2d3a35adf@localhost", "in_reply_to": "admin-0-b45ea10f1f@localhost", "comment_rating": 0, "archived": null, "approved": "y", "locked": "n", "parsed": "Hello test Updated", "user_posts": 14, "user_level": 5, "user_email": "", "attachments": [], "is_reported": 0, "user_online": "n", "user_exists": 1 } }



Request body

  • title string Optional: Comment title

  • data string Optional: Comment wiki content




Remove a comment.

Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}


cURL - comments
Copy to clipboard
curl -X 'DELETE' \ 'https://example.com/api/comments/14' \ -H 'Authorization: Bearer xxxxx' \ -H 'accept: application/json'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/14'; $headers = [ 'Accept: application/json', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec($ch); if (curl_errno($ch)) { $error_msg = curl_error($ch); echo 'Error: ' . $error_msg; } else { $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code === 200) { $data = json_decode($response, true); print_r($data); } else { echo 'Error: HTTP status code ' . $http_code; } } curl_close($ch); ?>



Javascript - comments
Copy to clipboard
fetch('https://example.com/api/comments/14', { method: 'DELETE', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer xxxxx' } }) .then(res => { if (!res.ok) throw new Error("HTTP " + res.status); return res.json(); }) .then(data => { console.log(data); }) .catch(err => { console.log('Fetch error: ' + err.message); });


Response - comments
Copy to clipboard
{ "threadId": 14, "status": "DONE", "objectType": "article", "objectId": "1", "parsed": "Content test" }



Parameters

  • threadId string *: Comment thread ID


Lock a comment thread.


Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}/lock


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/23/lock' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'type=wiki%20page&objectId=test-page'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/23/lock'; $data = http_build_query([ 'type' => 'wiki page', 'objectId' => 'test-page' ]); $headers = [ 'Accept: application/json', 'Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - comments
Copy to clipboard
const formData = new URLSearchParams(); formData.append('type', 'wiki page'); formData.append('objectId', 'test-page'); fetch('https://example.com/api/comments/23/lock', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Bearer xxxxx' }, body: formData.toString() }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - comments
Copy to clipboard
{ "title": "Lock comments", "type": "wiki page", "objectId": "test-page", "status": "DONE" }



Parameters

  • threadId integer *: The comment thread ID.
  • type string *: The type of the object (wiki page, file gallery, poll, faq, blog post, trackeritem, article, activity)
  • objectId string *: The object ID associated with the comment thread.

Unlock a comment thread.


Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}/unlock


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/23/unlock' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'type=wiki%20page&objectId=test-page'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/23/unlock'; $data = http_build_query([ 'type' => 'wiki page', 'objectId' => 'test-page' ]); $headers = [ 'Accept: application/json', 'Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - comments
Copy to clipboard
const formData = new URLSearchParams(); formData.append('type', 'wiki page'); formData.append('objectId', 'test-page'); fetch('https://example.com/api/comments/23/unlock', { method: 'POST', headers: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', 'Authorization': 'Bearer xxxxx' }, body: formData.toString() }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - comments
Copy to clipboard
{ "title": "Unlock comments", "type": "wiki page", "objectId": "test-page", "status": "DONE" }



Parameters

  • threadId integer *: The comment thread ID.
  • type string *: The type of the object (wiki page, file gallery, poll, faq, blog post, trackeritem, article, activity)
  • objectId string *: The object ID associated with the comment thread.


Moderate comment - approve


Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}/approve


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/23/approve' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/23/approve'; $headers = [ 'Accept: application/json', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, ''); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - comments
Copy to clipboard
fetch('https://example.com/api/comments/23/approve', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer xxxxx' } }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - comments
Copy to clipboard
{ "threadId": 23, "type": "wiki page", "objectId": "test-page", "status": "DONE", "do": "APPROVE" }



Parameters

  • threadId integer *: The comment thread ID.


Moderate comment - reject


Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}/reject


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/23/reject' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/23/reject'; $headers = [ 'Accept: application/json', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, ''); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - comments
Copy to clipboard
fetch('https://example.com/api/comments/23/reject', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer xxxxx' } }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - comments
Copy to clipboard
{ "threadId": 23, "type": "wiki page", "objectId": "test-page", "status": "DONE", "do": "REJECT" }



Parameters

  • threadId integer *: The comment thread ID.

Archive comment


Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}/archive


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/23/archive' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/23/archive'; $headers = [ 'Accept: application/json', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, ''); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - comments
Copy to clipboard
fetch('https://example.com/api/comments/23/archive', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer xxxxx' } }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - comments
Copy to clipboard
{ "threadId": 23, "type": "wiki page", "objectId": "test-page", "status": "DONE", "do": "archive" }



Parameters

  • threadId integer *: The comment thread ID.

Unarchive comment


Request URL - comments
Copy to clipboard
https://example.com/api/comments/{threadId}/unarchive


cURL - comments
Copy to clipboard
curl -X 'POST' \ 'https://example.com/api/comments/23/unarchive' \ -H 'accept: application/json' \ -H 'Authorization: Bearer xxxxx'


PHP - comments
Copy to clipboard
<?php $url = 'https://example.com/api/comments/23/unarchive'; $headers = [ 'Accept: application/json', 'Authorization: Bearer xxxxx' ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POSTFIELDS, ''); $response = curl_exec($ch); if (curl_errno($ch)) { echo 'Error: ' . curl_error($ch); } else { $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { $data = json_decode($response, true); print_r($data); } else { echo "Error: HTTP status code $status\n"; echo $response; } } curl_close($ch); ?>


Javascript - comments
Copy to clipboard
fetch('https://example.com/api/comments/23/unarchive', { method: 'POST', headers: { 'Accept': 'application/json', 'Authorization': 'Bearer xxxxx' } }) .then(response => { if (!response.ok) throw new Error("HTTP " + response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error("Fetch error:", error));


Response - comments
Copy to clipboard
{ "threadId": 23, "type": "wiki page", "objectId": "test-page", "status": "DONE", "do": "unarchive" }



Parameters

  • threadId integer *: The comment thread ID.

Show PHP error messages