curl --request POST \
--url https://api.cool.computer/api/computers/{id}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"anchor": {
"page": "/menu",
"rect": {
"x": 50,
"y": 50,
"w": 50,
"h": 50
},
"selector": "section > a.cta",
"text": "<string>",
"label": "<string>",
"scroll_y": 1
}
}
'import requests
url = "https://api.cool.computer/api/computers/{id}/comments"
payload = {
"text": "<string>",
"anchor": {
"page": "/menu",
"rect": {
"x": 50,
"y": 50,
"w": 50,
"h": 50
},
"selector": "section > a.cta",
"text": "<string>",
"label": "<string>",
"scroll_y": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
anchor: {
page: '/menu',
rect: {x: 50, y: 50, w: 50, h: 50},
selector: 'section > a.cta',
text: '<string>',
label: '<string>',
scroll_y: 1
}
})
};
fetch('https://api.cool.computer/api/computers/{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.cool.computer/api/computers/{id}/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>',
'anchor' => [
'page' => '/menu',
'rect' => [
'x' => 50,
'y' => 50,
'w' => 50,
'h' => 50
],
'selector' => 'section > a.cta',
'text' => '<string>',
'label' => '<string>',
'scroll_y' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cool.computer/api/computers/{id}/comments"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"anchor\": {\n \"page\": \"/menu\",\n \"rect\": {\n \"x\": 50,\n \"y\": 50,\n \"w\": 50,\n \"h\": 50\n },\n \"selector\": \"section > a.cta\",\n \"text\": \"<string>\",\n \"label\": \"<string>\",\n \"scroll_y\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cool.computer/api/computers/{id}/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"anchor\": {\n \"page\": \"/menu\",\n \"rect\": {\n \"x\": 50,\n \"y\": 50,\n \"w\": 50,\n \"h\": 50\n },\n \"selector\": \"section > a.cta\",\n \"text\": \"<string>\",\n \"label\": \"<string>\",\n \"scroll_y\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"anchor\": {\n \"page\": \"/menu\",\n \"rect\": {\n \"x\": 50,\n \"y\": 50,\n \"w\": 50,\n \"h\": 50\n },\n \"selector\": \"section > a.cta\",\n \"text\": \"<string>\",\n \"label\": \"<string>\",\n \"scroll_y\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "note_1a2b3c",
"state": "open",
"version": 2,
"release": 123,
"anchor": {
"kind": "element",
"page": "/menu",
"rect": {
"x": 50,
"y": 50,
"w": 50,
"h": 50
},
"selector": "section > a.cta",
"text": "<string>",
"label": "<string>",
"scroll_y": 1
},
"thread": [
{
"by": "owner",
"text": "<string>",
"at": "2023-11-07T05:31:56Z",
"who": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"fixed_in_release": 123
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Create computer comment
The owner, anyone the computer is shared with and, when the computer is public, any signed-in person (a person’s own sign-in, not an organization API key or the computer’s runtime token). Leaves a note on a page of the computer’s site, anchored to an element or an area. Text is cleaned and must be 1 to 1000 bytes. The agent reads every note at once, whoever wrote it. A computer holds at most 50 open or asked notes, of which people other than the owner hold 40 and each of them 10, and 500 notes in all. Anyone but the owner may make 10 writes a minute on one computer.
curl --request POST \
--url https://api.cool.computer/api/computers/{id}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"anchor": {
"page": "/menu",
"rect": {
"x": 50,
"y": 50,
"w": 50,
"h": 50
},
"selector": "section > a.cta",
"text": "<string>",
"label": "<string>",
"scroll_y": 1
}
}
'import requests
url = "https://api.cool.computer/api/computers/{id}/comments"
payload = {
"text": "<string>",
"anchor": {
"page": "/menu",
"rect": {
"x": 50,
"y": 50,
"w": 50,
"h": 50
},
"selector": "section > a.cta",
"text": "<string>",
"label": "<string>",
"scroll_y": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
anchor: {
page: '/menu',
rect: {x: 50, y: 50, w: 50, h: 50},
selector: 'section > a.cta',
text: '<string>',
label: '<string>',
scroll_y: 1
}
})
};
fetch('https://api.cool.computer/api/computers/{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.cool.computer/api/computers/{id}/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>',
'anchor' => [
'page' => '/menu',
'rect' => [
'x' => 50,
'y' => 50,
'w' => 50,
'h' => 50
],
'selector' => 'section > a.cta',
'text' => '<string>',
'label' => '<string>',
'scroll_y' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.cool.computer/api/computers/{id}/comments"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"anchor\": {\n \"page\": \"/menu\",\n \"rect\": {\n \"x\": 50,\n \"y\": 50,\n \"w\": 50,\n \"h\": 50\n },\n \"selector\": \"section > a.cta\",\n \"text\": \"<string>\",\n \"label\": \"<string>\",\n \"scroll_y\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.cool.computer/api/computers/{id}/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"anchor\": {\n \"page\": \"/menu\",\n \"rect\": {\n \"x\": 50,\n \"y\": 50,\n \"w\": 50,\n \"h\": 50\n },\n \"selector\": \"section > a.cta\",\n \"text\": \"<string>\",\n \"label\": \"<string>\",\n \"scroll_y\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cool.computer/api/computers/{id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"anchor\": {\n \"page\": \"/menu\",\n \"rect\": {\n \"x\": 50,\n \"y\": 50,\n \"w\": 50,\n \"h\": 50\n },\n \"selector\": \"section > a.cta\",\n \"text\": \"<string>\",\n \"label\": \"<string>\",\n \"scroll_y\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "note_1a2b3c",
"state": "open",
"version": 2,
"release": 123,
"anchor": {
"kind": "element",
"page": "/menu",
"rect": {
"x": 50,
"y": 50,
"w": 50,
"h": 50
},
"selector": "section > a.cta",
"text": "<string>",
"label": "<string>",
"scroll_y": 1
},
"thread": [
{
"by": "owner",
"text": "<string>",
"at": "2023-11-07T05:31:56Z",
"who": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"fixed_in_release": 123
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}{
"type": "<string>",
"title": "<string>",
"status": 499,
"code": "<string>",
"detail": "<string>",
"resolution": "<string>",
"context": {}
}Authorizations
A Cool Computers API key, user access token, or claimed agent access token in the Authorization header. Follow https://www.cool.computer/auth.md for agent registration and https://www.cool.computer/authentication.md for direct user credentials.
Path Parameters
Stable public computer identifier.
1"cmp_123"
Body
What should change, 1 to 1000 bytes.
1Show child attributes
Show child attributes
Response
The new note.
"note_1a2b3c"
open waits for the agent, asked waits for the owner's answer, done is finished.
open, asked, done Changes on every update; send the one you read when resolving.
x >= 1Release the computer served when the note was left; 0 when it served none.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Release that fixed the note, when a newer one was published.

