curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"body": "",
"criterion": "<string>",
"pin": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pinMock": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reviewSendId": "<string>",
"sessionId": "<string>",
"thread": "<string>"
},
"schemaVersion": 1
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload = {
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"attachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"body": "",
"criterion": "<string>",
"pin": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pinMock": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reviewSendId": "<string>",
"sessionId": "<string>",
"thread": "<string>"
},
"schemaVersion": 1
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comment: {
clientCommentId: '<string>',
artifact: '<string>',
attachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
body: JSON.stringify(''),
criterion: '<string>',
pin: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pinMock: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
reviewSendId: '<string>',
sessionId: '<string>',
thread: '<string>'
},
schemaVersion: 1
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/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.outerlayer.ai/v1/work-items/{workItemId}/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([
'comment' => [
'clientCommentId' => '<string>',
'artifact' => '<string>',
'attachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'body' => '',
'criterion' => '<string>',
'pin' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pinMock' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'reviewSendId' => '<string>',
'sessionId' => '<string>',
'thread' => '<string>'
],
'schemaVersion' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload := strings.NewReader("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"pin\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pinMock\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reviewSendId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"thread\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/work-items/{workItemId}/comments")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"pin\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pinMock\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reviewSendId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"thread\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"pin\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pinMock\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reviewSendId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"thread\": \"<string>\"\n },\n \"schemaVersion\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Post a comment on a work item's general thread or a criterion thread
Posts one comment. Omitting criterion posts on the item’s general thread; naming one posts on that criterion’s own thread. pass/fail are a person’s verdict on the whole item: they are refused on a criterion thread (verdict_on_criterion) and from an agent session or a machine key (verdict_needs_person). A plain comment needs work.comment, a pass needs work.approve, and a fail or a follow_up needs work.review. attach makes an artifact the criterion’s proof, superseding whatever it replaces; ready hands the thread back to a person (refused from a person with ready_needs_agent). request is a note sent with a review and is refused here (request_needs_review_send); send notes through the notes route. follow_up is a member’s message to the running agent: it goes on the general thread only (follow_up_on_general_thread), from a person only (follow_up_needs_person), needs work.review, and records no verdict, so it is not a fail and the item need not be reviewable. It is refused on a closed item (work_item_closed), because no agent works on one. It asks an agent to amend like a fail: a running build reads it at its next step, and an unread one starts the next agent job. reviewSendId marks the comment as part of one review send and is refused from an agent (review_send_needs_person). Only a person’s fail or follow_up on the general thread asks an agent to amend; a plain comment never does. A read-only organization is refused a person’s fail or follow_up (billing_read_only). No verdict can be recorded on an item that is not reviewable (not_reviewable). An artifact is accepted only with attach (artifact_needs_attach). Retrying with the same clientCommentId returns the comment already recorded; reusing one for a different comment or on another work item is refused (comment_conflict). A follow_up may name a pin: an open pin on a screenshot proof or on a current mock, with no body and no attachments. The message then holds the pin’s thread, the proof’s caption and criterion and the point as percentages, and carries the screenshot as an attachment. A pin that is not on this item answers pin_not_found; a resolved pin, a pin on a replaced proof and a pin on a mock that was replaced or removed answer pin_not_sendable. A pin on a current mock is sent the same way: the message names the pin’s number, the mock’s name and id, the point and the thread, and carries the mock’s image as its attachment, and a pinMock is ignored. A pin may also carry pinMock, the current mock the reviewer compared the screenshot with: the message then names the mock and its criteria and carries its image as a second attachment. A pinMock that is not a current mock of the item answers pin_mock_not_current, and one with no pin answers pin_mock_needs_pin. When the screenshot and the mock together are over the total a comment takes, the screenshot goes alone, and the message says the mock was left out. It says the same when the image of the mock is not stored. A pin with an action other than follow_up answers pin_needs_follow_up, and one with a body or attachments answers pin_takes_no_body. A pin whose image, the screenshot or the mock it is on, is not stored answers pin_image_unavailable.
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"body": "",
"criterion": "<string>",
"pin": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pinMock": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reviewSendId": "<string>",
"sessionId": "<string>",
"thread": "<string>"
},
"schemaVersion": 1
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload = {
"comment": {
"clientCommentId": "<string>",
"artifact": "<string>",
"attachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"body": "",
"criterion": "<string>",
"pin": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"pinMock": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"reviewSendId": "<string>",
"sessionId": "<string>",
"thread": "<string>"
},
"schemaVersion": 1
}
headers = {
"X-Outerlayer-App-Id": "<api-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Outerlayer-App-Id': '<api-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
comment: {
clientCommentId: '<string>',
artifact: '<string>',
attachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
body: JSON.stringify(''),
criterion: '<string>',
pin: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
pinMock: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
reviewSendId: '<string>',
sessionId: '<string>',
thread: '<string>'
},
schemaVersion: 1
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/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.outerlayer.ai/v1/work-items/{workItemId}/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([
'comment' => [
'clientCommentId' => '<string>',
'artifact' => '<string>',
'attachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'body' => '',
'criterion' => '<string>',
'pin' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'pinMock' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'reviewSendId' => '<string>',
'sessionId' => '<string>',
'thread' => '<string>'
],
'schemaVersion' => 1
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Outerlayer-App-Id: <api-key>"
],
]);
$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.outerlayer.ai/v1/work-items/{workItemId}/comments"
payload := strings.NewReader("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"pin\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pinMock\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reviewSendId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"thread\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Outerlayer-App-Id", "<api-key>")
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.outerlayer.ai/v1/work-items/{workItemId}/comments")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"pin\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pinMock\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reviewSendId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"thread\": \"<string>\"\n },\n \"schemaVersion\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Outerlayer-App-Id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": {\n \"clientCommentId\": \"<string>\",\n \"artifact\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"body\": \"\",\n \"criterion\": \"<string>\",\n \"pin\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"pinMock\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"reviewSendId\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"thread\": \"<string>\"\n },\n \"schemaVersion\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"data": {
"created": true,
"id": "<string>",
"thread": {
"criterion": "<string>",
"waitingOn": "person"
},
"unchanged": true
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}