Fetch Comment
curl --request GET \
--url https://api.sublay.io/v8/:projectId/comments/:commentId \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/comments/:commentId"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/comments/:commentId', 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.sublay.io/v8/:projectId/comments/:commentId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.sublay.io/v8/:projectId/comments/:commentId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.sublay.io/v8/:projectId/comments/:commentId")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/comments/:commentId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyComment Endpoints
Fetch Comment
Get a single comment by ID
Fetch Comment
curl --request GET \
--url https://api.sublay.io/v8/:projectId/comments/:commentId \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v8/:projectId/comments/:commentId"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sublay.io/v8/:projectId/comments/:commentId', 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.sublay.io/v8/:projectId/comments/:commentId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.sublay.io/v8/:projectId/comments/:commentId"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.sublay.io/v8/:projectId/comments/:commentId")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v8/:projectId/comments/:commentId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyReturns a single comment by its Sublay UUID.
Path Parameters
string
required
The UUID of the comment to fetch.
Query Parameters
string
Comma-separated list of associations to include. Valid values:
user, entity, space, parent, grants (the reputation-grant summary). With entity or space, entity is null when the entity isn’t available to the caller (for example, removed by a moderator) — the comment is still returned, and there is no space. The included entity is the entity’s stored record, without the fields an entity fetch computes or joins (such as commentsCount, userReaction and nsfwEffective) — see The included entity. With parent, parentComment is null when the parent no longer exists or is on another entity.Space-scoped reputation
This endpoint has a space in context, so it accepts the opt-in reputation params. They add aspaceReputation field to the populated author user, alongside the always-present reputation total. Requires the reputation bundle. See the Reputation data model for the full contract.
Response
Returns a Comment object, withisAuthorBlocked and isUnavailable flags. A deleted comment, or a moderator-removed one viewed by anyone but its author, is returned as a placeholder — the author and content are blanked, and the comment’s id, parentId, timestamps and counts are kept.
Blocks
When the caller is signed in and themoderation bundle is installed, the comment comes back the same way a thread shows it:
- The caller blocked the author — the full comment, with
isAuthorBlocked: true. - The author blocked the caller (or both blocked each other) — a placeholder with
isUnavailable: true. - The entity’s author blocked the caller —
404 comment/not-found, identical to a comment that doesn’t exist. This applies to every comment on that entity, except the caller’s own.
parentComment follows the same placeholder and flag rules.
Your own comment on an unavailable entity: when the entity’s author has blocked the caller, the caller can still open their own comments there, so they can find and delete them. entity (which carries space) and parentComment are null on those comments when requested. They are read-and-delete only: replying under them, reacting to them, and editing them are refused (404). They aren’t marked by a dedicated field: entity: null only means the entity isn’t available to the caller, and doesn’t say why.
Error Responses
Invalid Params — 400
Invalid Params — 400
Returned when
commentId isn’t a valid UUID.{ "error": "commentId: Invalid UUID format", "code": "comment/invalid-params" }
Invalid Query — 400
Invalid Query — 400
Returned when
include contains a value that isn’t supported.{ "error": "include: Include must contain valid options: user, entity, space, parent, grants", "code": "comment/invalid-query" }
Not Found — 404
Not Found — 404
{ "error": "Comment not found", "code": "comment/not-found" }

