curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/notes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"clientSendId": "<string>",
"notes": [
{
"body": "<string>",
"criterion": "<string>",
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"schemaVersion": 1,
"summary": "<string>",
"summaryAttachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/notes"
payload = {
"clientSendId": "<string>",
"notes": [
{
"body": "<string>",
"criterion": "<string>",
"attachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"schemaVersion": 1,
"summary": "<string>",
"summaryAttachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
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({
clientSendId: '<string>',
notes: [
{
body: JSON.stringify('<string>'),
criterion: '<string>',
attachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
schemaVersion: 1,
summary: '<string>',
summaryAttachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/notes', 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}/notes",
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([
'clientSendId' => '<string>',
'notes' => [
[
'body' => '<string>',
'criterion' => '<string>',
'attachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'schemaVersion' => 1,
'summary' => '<string>',
'summaryAttachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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}/notes"
payload := strings.NewReader("{\n \"clientSendId\": \"<string>\",\n \"notes\": [\n {\n \"body\": \"<string>\",\n \"criterion\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"schemaVersion\": 1,\n \"summary\": \"<string>\",\n \"summaryAttachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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}/notes")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientSendId\": \"<string>\",\n \"notes\": [\n {\n \"body\": \"<string>\",\n \"criterion\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"schemaVersion\": 1,\n \"summary\": \"<string>\",\n \"summaryAttachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/notes")
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 \"clientSendId\": \"<string>\",\n \"notes\": [\n {\n \"body\": \"<string>\",\n \"criterion\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"schemaVersion\": 1,\n \"summary\": \"<string>\",\n \"summaryAttachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"failId": "<string>",
"noteIds": [
"<string>"
]
}
}{
"data": {
"created": true,
"failId": "<string>",
"noteIds": [
"<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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Send review notes on several criteria as one agent job
Stores one request comment on each named criterion’s thread and one fail on the item’s general thread whose body lists the notes, in a single statement: either every row is stored or none is. Each request leaves its criterion thread waiting on an agent. Every comment of the send carries clientSendId as its reviewSendId. The optional summary is stored with them as a plain comment on the general thread, so an agent that gets the fail also gets the summary. The fail is what asks an agent to amend, so one send starts one job. A read-only organization is refused the send (billing_read_only). Only a person can send notes (verdict_needs_person otherwise), and only on an item that is reviewable (not_reviewable). Retrying with the same clientSendId returns the rows already stored.
curl --request POST \
--url https://api.outerlayer.ai/v1/work-items/{workItemId}/notes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Outerlayer-App-Id: <api-key>' \
--data '
{
"clientSendId": "<string>",
"notes": [
{
"body": "<string>",
"criterion": "<string>",
"attachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
],
"schemaVersion": 1,
"summary": "<string>",
"summaryAttachments": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.outerlayer.ai/v1/work-items/{workItemId}/notes"
payload = {
"clientSendId": "<string>",
"notes": [
{
"body": "<string>",
"criterion": "<string>",
"attachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
],
"schemaVersion": 1,
"summary": "<string>",
"summaryAttachments": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
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({
clientSendId: '<string>',
notes: [
{
body: JSON.stringify('<string>'),
criterion: '<string>',
attachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
}
],
schemaVersion: 1,
summary: '<string>',
summaryAttachments: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.outerlayer.ai/v1/work-items/{workItemId}/notes', 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}/notes",
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([
'clientSendId' => '<string>',
'notes' => [
[
'body' => '<string>',
'criterion' => '<string>',
'attachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]
],
'schemaVersion' => 1,
'summary' => '<string>',
'summaryAttachments' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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}/notes"
payload := strings.NewReader("{\n \"clientSendId\": \"<string>\",\n \"notes\": [\n {\n \"body\": \"<string>\",\n \"criterion\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"schemaVersion\": 1,\n \"summary\": \"<string>\",\n \"summaryAttachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\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}/notes")
.header("X-Outerlayer-App-Id", "<api-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientSendId\": \"<string>\",\n \"notes\": [\n {\n \"body\": \"<string>\",\n \"criterion\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"schemaVersion\": 1,\n \"summary\": \"<string>\",\n \"summaryAttachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.outerlayer.ai/v1/work-items/{workItemId}/notes")
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 \"clientSendId\": \"<string>\",\n \"notes\": [\n {\n \"body\": \"<string>\",\n \"criterion\": \"<string>\",\n \"attachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n }\n ],\n \"schemaVersion\": 1,\n \"summary\": \"<string>\",\n \"summaryAttachments\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created": true,
"failId": "<string>",
"noteIds": [
"<string>"
]
}
}{
"data": {
"created": true,
"failId": "<string>",
"noteIds": [
"<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>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}