Comments
Create Comment
Create a comment or a reply on an asset.
POST
/
comments
Create Comment
curl --request POST \
--url https://api.aspect.inc/comments \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": 123,
"duration": 123,
"anchor_position": {
"x": 50,
"y": 50
},
"annotation": [
{
"tool": "pen",
"color": "<string>",
"stroke_width": 123,
"points": [
{
"x": 123,
"y": 123
}
]
}
],
"page": 123,
"text_highlight": {
"text": "<string>",
"rects": [
{
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
]
},
"mentions": [
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"start_index": 123,
"end_index": 123
}
],
"attachment_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"private": false
}
'import requests
url = "https://api.aspect.inc/comments"
payload = {
"text": "<string>",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": 123,
"duration": 123,
"anchor_position": {
"x": 50,
"y": 50
},
"annotation": [
{
"tool": "pen",
"color": "<string>",
"stroke_width": 123,
"points": [
{
"x": 123,
"y": 123
}
]
}
],
"page": 123,
"text_highlight": {
"text": "<string>",
"rects": [
{
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
]
},
"mentions": [
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"start_index": 123,
"end_index": 123
}
],
"attachment_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"private": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
resource_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
timestamp: 123,
duration: 123,
anchor_position: {x: 50, y: 50},
annotation: [
{tool: 'pen', color: '<string>', stroke_width: 123, points: [{x: 123, y: 123}]}
],
page: 123,
text_highlight: {text: '<string>', rects: [{x: 0.5, y: 0.5, width: 0.5, height: 0.5}]},
mentions: [
{
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
text: '<string>',
start_index: 123,
end_index: 123
}
],
attachment_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
private: false
})
};
fetch('https://api.aspect.inc/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.aspect.inc/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'resource_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'timestamp' => 123,
'duration' => 123,
'anchor_position' => [
'x' => 50,
'y' => 50
],
'annotation' => [
[
'tool' => 'pen',
'color' => '<string>',
'stroke_width' => 123,
'points' => [
[
'x' => 123,
'y' => 123
]
]
]
],
'page' => 123,
'text_highlight' => [
'text' => '<string>',
'rects' => [
[
'x' => 0.5,
'y' => 0.5,
'width' => 0.5,
'height' => 0.5
]
]
],
'mentions' => [
[
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'text' => '<string>',
'start_index' => 123,
'end_index' => 123
]
],
'attachment_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'private' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aspect.inc/comments"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"timestamp\": 123,\n \"duration\": 123,\n \"anchor_position\": {\n \"x\": 50,\n \"y\": 50\n },\n \"annotation\": [\n {\n \"tool\": \"pen\",\n \"color\": \"<string>\",\n \"stroke_width\": 123,\n \"points\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"page\": 123,\n \"text_highlight\": {\n \"text\": \"<string>\",\n \"rects\": [\n {\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"height\": 0.5\n }\n ]\n },\n \"mentions\": [\n {\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"start_index\": 123,\n \"end_index\": 123\n }\n ],\n \"attachment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"private\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aspect.inc/comments")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"timestamp\": 123,\n \"duration\": 123,\n \"anchor_position\": {\n \"x\": 50,\n \"y\": 50\n },\n \"annotation\": [\n {\n \"tool\": \"pen\",\n \"color\": \"<string>\",\n \"stroke_width\": 123,\n \"points\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"page\": 123,\n \"text_highlight\": {\n \"text\": \"<string>\",\n \"rects\": [\n {\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"height\": 0.5\n }\n ]\n },\n \"mentions\": [\n {\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"start_index\": 123,\n \"end_index\": 123\n }\n ],\n \"attachment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"private\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aspect.inc/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"timestamp\": 123,\n \"duration\": 123,\n \"anchor_position\": {\n \"x\": 50,\n \"y\": 50\n },\n \"annotation\": [\n {\n \"tool\": \"pen\",\n \"color\": \"<string>\",\n \"stroke_width\": 123,\n \"points\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"page\": 123,\n \"text_highlight\": {\n \"text\": \"<string>\",\n \"rects\": [\n {\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"height\": 0.5\n }\n ]\n },\n \"mentions\": [\n {\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"start_index\": 123,\n \"end_index\": 123\n }\n ],\n \"attachment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"private\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"timestamp": 123,
"duration": 123,
"page": 123,
"is_resolved": true,
"private": true,
"number": 123,
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
},
"replies": "<array>",
"reactions": [
{
"reaction": "<string>",
"users": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
}
]
}
],
"mentions": [
{
"start_index": 123,
"end_index": 123,
"text": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
}
}
],
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"created": "2023-11-07T05:31:56Z",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z"
}
],
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"anchor_position": {
"x": 50,
"y": 50
},
"annotation": [
{
"tool": "pen",
"color": "<string>",
"stroke_width": 123,
"points": [
{
"x": 123,
"y": 123
}
]
}
],
"text_highlight": {
"text": "<string>",
"rects": [
{
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
application/json
API request schema for creating a comment
Comment text content
Response
Successful Response
API response schema for a single comment with nested replies, reactions, mentions, and attachments
⌘I
Create Comment
curl --request POST \
--url https://api.aspect.inc/comments \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": 123,
"duration": 123,
"anchor_position": {
"x": 50,
"y": 50
},
"annotation": [
{
"tool": "pen",
"color": "<string>",
"stroke_width": 123,
"points": [
{
"x": 123,
"y": 123
}
]
}
],
"page": 123,
"text_highlight": {
"text": "<string>",
"rects": [
{
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
]
},
"mentions": [
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"start_index": 123,
"end_index": 123
}
],
"attachment_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"private": false
}
'import requests
url = "https://api.aspect.inc/comments"
payload = {
"text": "<string>",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"timestamp": 123,
"duration": 123,
"anchor_position": {
"x": 50,
"y": 50
},
"annotation": [
{
"tool": "pen",
"color": "<string>",
"stroke_width": 123,
"points": [
{
"x": 123,
"y": 123
}
]
}
],
"page": 123,
"text_highlight": {
"text": "<string>",
"rects": [
{
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
]
},
"mentions": [
{
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"start_index": 123,
"end_index": 123
}
],
"attachment_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"private": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
resource_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
timestamp: 123,
duration: 123,
anchor_position: {x: 50, y: 50},
annotation: [
{tool: 'pen', color: '<string>', stroke_width: 123, points: [{x: 123, y: 123}]}
],
page: 123,
text_highlight: {text: '<string>', rects: [{x: 0.5, y: 0.5, width: 0.5, height: 0.5}]},
mentions: [
{
user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
text: '<string>',
start_index: 123,
end_index: 123
}
],
attachment_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
private: false
})
};
fetch('https://api.aspect.inc/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.aspect.inc/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'resource_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'timestamp' => 123,
'duration' => 123,
'anchor_position' => [
'x' => 50,
'y' => 50
],
'annotation' => [
[
'tool' => 'pen',
'color' => '<string>',
'stroke_width' => 123,
'points' => [
[
'x' => 123,
'y' => 123
]
]
]
],
'page' => 123,
'text_highlight' => [
'text' => '<string>',
'rects' => [
[
'x' => 0.5,
'y' => 0.5,
'width' => 0.5,
'height' => 0.5
]
]
],
'mentions' => [
[
'user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'text' => '<string>',
'start_index' => 123,
'end_index' => 123
]
],
'attachment_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'private' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aspect.inc/comments"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"timestamp\": 123,\n \"duration\": 123,\n \"anchor_position\": {\n \"x\": 50,\n \"y\": 50\n },\n \"annotation\": [\n {\n \"tool\": \"pen\",\n \"color\": \"<string>\",\n \"stroke_width\": 123,\n \"points\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"page\": 123,\n \"text_highlight\": {\n \"text\": \"<string>\",\n \"rects\": [\n {\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"height\": 0.5\n }\n ]\n },\n \"mentions\": [\n {\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"start_index\": 123,\n \"end_index\": 123\n }\n ],\n \"attachment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"private\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aspect.inc/comments")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"timestamp\": 123,\n \"duration\": 123,\n \"anchor_position\": {\n \"x\": 50,\n \"y\": 50\n },\n \"annotation\": [\n {\n \"tool\": \"pen\",\n \"color\": \"<string>\",\n \"stroke_width\": 123,\n \"points\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"page\": 123,\n \"text_highlight\": {\n \"text\": \"<string>\",\n \"rects\": [\n {\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"height\": 0.5\n }\n ]\n },\n \"mentions\": [\n {\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"start_index\": 123,\n \"end_index\": 123\n }\n ],\n \"attachment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"private\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aspect.inc/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"resource_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"timestamp\": 123,\n \"duration\": 123,\n \"anchor_position\": {\n \"x\": 50,\n \"y\": 50\n },\n \"annotation\": [\n {\n \"tool\": \"pen\",\n \"color\": \"<string>\",\n \"stroke_width\": 123,\n \"points\": [\n {\n \"x\": 123,\n \"y\": 123\n }\n ]\n }\n ],\n \"page\": 123,\n \"text_highlight\": {\n \"text\": \"<string>\",\n \"rects\": [\n {\n \"x\": 0.5,\n \"y\": 0.5,\n \"width\": 0.5,\n \"height\": 0.5\n }\n ]\n },\n \"mentions\": [\n {\n \"user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"text\": \"<string>\",\n \"start_index\": 123,\n \"end_index\": 123\n }\n ],\n \"attachment_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"private\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>",
"timestamp": 123,
"duration": 123,
"page": 123,
"is_resolved": true,
"private": true,
"number": 123,
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
},
"replies": "<array>",
"reactions": [
{
"reaction": "<string>",
"users": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
}
]
}
],
"mentions": [
{
"start_index": 123,
"end_index": 123,
"text": "<string>",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "<string>",
"avatar_url": "<string>"
}
}
],
"attachments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"created": "2023-11-07T05:31:56Z",
"url": "<string>",
"url_expires_at": "2023-11-07T05:31:56Z"
}
],
"created": "2023-11-07T05:31:56Z",
"updated": "2023-11-07T05:31:56Z",
"anchor_position": {
"x": 50,
"y": 50
},
"annotation": [
{
"tool": "pen",
"color": "<string>",
"stroke_width": 123,
"points": [
{
"x": 123,
"y": 123
}
]
}
],
"text_highlight": {
"text": "<string>",
"rects": [
{
"x": 0.5,
"y": 0.5,
"width": 0.5,
"height": 0.5
}
]
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}