Fetch Comment by Foreign ID
curl --request GET \
--url https://api.sublay.io/v7/:projectId/comments/by-foreign-id \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/comments/by-foreign-id"
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/v7/:projectId/comments/by-foreign-id', 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/v7/:projectId/comments/by-foreign-id",
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/v7/:projectId/comments/by-foreign-id"
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/v7/:projectId/comments/by-foreign-id")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/comments/by-foreign-id")
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 by Foreign ID
Get a comment by its foreign ID
Fetch Comment by Foreign ID
curl --request GET \
--url https://api.sublay.io/v7/:projectId/comments/by-foreign-id \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sublay.io/v7/:projectId/comments/by-foreign-id"
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/v7/:projectId/comments/by-foreign-id', 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/v7/:projectId/comments/by-foreign-id",
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/v7/:projectId/comments/by-foreign-id"
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/v7/:projectId/comments/by-foreign-id")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sublay.io/v7/:projectId/comments/by-foreign-id")
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 matching the given
The
foreignId within the project. Useful for looking up comments using your own application’s identifiers.
If the comment author is block-edged with the signed-in caller, in either
direction, this returns
404 with comment/not-found — identical to a
comment that does not exist. An embedded parentComment is nulled under the
same rule. Requires the moderation bundle.Query Parameters
string
required
The foreign ID to look up.
string
Comma-separated list of associations to include. Valid values:
user, entity, space, parent, grants (the reputation-grant summary).Response
Returns a200 OK with the following shape:
{
"comment": { ...Comment }
}
comment field is a Comment object. If the comment has been removed (user-deleted or moderation-removed) and the viewer is not the author, identifying fields (userId, user, content, gif, mentions, attachments) are nulled out as a Reddit-style placeholder.
This endpoint nests the record under a
comment key, unlike every other read surface, which returns the record bare. So a requested grants summary lives at comment.grants — see GrantSummary.Error Responses
Not Found — 404
Not Found — 404
{ "error": "Comment not found", "code": "comment/not-found" }

