Add Comment
curl --request POST \
--url https://api.serial.io/work-orders/{id}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "I think you forgot to attach the BOM",
"added_by_user_id": "cddaa2ad-a813-4e07-9ada-2d9c5fa02907"
}
'import requests
url = "https://api.serial.io/work-orders/{id}/comments"
payload = {
"comment": "I think you forgot to attach the BOM",
"added_by_user_id": "cddaa2ad-a813-4e07-9ada-2d9c5fa02907"
}
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({
comment: 'I think you forgot to attach the BOM',
added_by_user_id: 'cddaa2ad-a813-4e07-9ada-2d9c5fa02907'
})
};
fetch('https://api.serial.io/work-orders/{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.serial.io/work-orders/{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([
'comment' => 'I think you forgot to attach the BOM',
'added_by_user_id' => 'cddaa2ad-a813-4e07-9ada-2d9c5fa02907'
]),
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.serial.io/work-orders/{id}/comments"
payload := strings.NewReader("{\n \"comment\": \"I think you forgot to attach the BOM\",\n \"added_by_user_id\": \"cddaa2ad-a813-4e07-9ada-2d9c5fa02907\"\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.serial.io/work-orders/{id}/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"I think you forgot to attach the BOM\",\n \"added_by_user_id\": \"cddaa2ad-a813-4e07-9ada-2d9c5fa02907\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/work-orders/{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 \"comment\": \"I think you forgot to attach the BOM\",\n \"added_by_user_id\": \"cddaa2ad-a813-4e07-9ada-2d9c5fa02907\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"wo_number": 1,
"name": "<string>",
"description": "<string>",
"component_id": "<string>",
"part_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "DRAFT",
"phase": "<string>",
"quantity": 123,
"approvals": {
"[approver_user_id]": {
"approver_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_at": "2023-11-07T05:31:56Z",
"last_updated_at": "2023-11-07T05:31:56Z"
}
},
"assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deadline": "2023-11-07T05:31:56Z",
"activity_log": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": "<string>"
}
],
"last_edited_at": "2023-11-07T05:31:56Z",
"attachments": [
{
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"file_name": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "<string>",
"is_deleted": true
}
]
}Work Orders
Add Comment
Add a comment to the activity log
POST
/
work-orders
/
{id}
/
comments
Add Comment
curl --request POST \
--url https://api.serial.io/work-orders/{id}/comments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"comment": "I think you forgot to attach the BOM",
"added_by_user_id": "cddaa2ad-a813-4e07-9ada-2d9c5fa02907"
}
'import requests
url = "https://api.serial.io/work-orders/{id}/comments"
payload = {
"comment": "I think you forgot to attach the BOM",
"added_by_user_id": "cddaa2ad-a813-4e07-9ada-2d9c5fa02907"
}
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({
comment: 'I think you forgot to attach the BOM',
added_by_user_id: 'cddaa2ad-a813-4e07-9ada-2d9c5fa02907'
})
};
fetch('https://api.serial.io/work-orders/{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.serial.io/work-orders/{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([
'comment' => 'I think you forgot to attach the BOM',
'added_by_user_id' => 'cddaa2ad-a813-4e07-9ada-2d9c5fa02907'
]),
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.serial.io/work-orders/{id}/comments"
payload := strings.NewReader("{\n \"comment\": \"I think you forgot to attach the BOM\",\n \"added_by_user_id\": \"cddaa2ad-a813-4e07-9ada-2d9c5fa02907\"\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.serial.io/work-orders/{id}/comments")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"I think you forgot to attach the BOM\",\n \"added_by_user_id\": \"cddaa2ad-a813-4e07-9ada-2d9c5fa02907\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.serial.io/work-orders/{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 \"comment\": \"I think you forgot to attach the BOM\",\n \"added_by_user_id\": \"cddaa2ad-a813-4e07-9ada-2d9c5fa02907\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"wo_number": 1,
"name": "<string>",
"description": "<string>",
"component_id": "<string>",
"part_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "DRAFT",
"phase": "<string>",
"quantity": 123,
"approvals": {
"[approver_user_id]": {
"approver_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requested_at": "2023-11-07T05:31:56Z",
"last_updated_at": "2023-11-07T05:31:56Z"
}
},
"assignee_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"deadline": "2023-11-07T05:31:56Z",
"activity_log": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message": "<string>",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data": "<string>"
}
],
"last_edited_at": "2023-11-07T05:31:56Z",
"attachments": [
{
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"value": "<string>",
"file_name": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"added_at": "2023-11-07T05:31:56Z",
"added_by_user_id": "<string>",
"is_deleted": true
}
]
}Authorizations
API Key or Token formatted as Bearer <YOUR_KEY_OR_TOKEN>
Path Parameters
The work order UUID (work_order.id) or work order number (work_order.wo_number). Both will map to the same work order
Response
200 - application/json
OK
Work Order Data
Required range:
x >= 0Available options:
DRAFT, REVIEW, PRODUCTION, COMPLETE, CANCELED, ARCHIVED Approvals object will have one key value pair for every approver
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Multiple datasets can be added to the attachments object
Show child attributes
Show child attributes
⌘I

