Change a work order's details
curl --request POST \
--url https://app.assetinfinity.ai/api/rpc/update_work_order \
--header 'Content-Type: application/json' \
--data '
{
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"estimated_duration_minutes": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planned_end_at": "2023-11-07T05:31:56Z",
"planned_start_at": "2023-11-07T05:31:56Z",
"remarks": "<string>",
"reported_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requires_permit": true,
"safety_instructions": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"work_order_priority_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_order_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"p_work_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.assetinfinity.ai/api/rpc/update_work_order"
payload = {
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"estimated_duration_minutes": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planned_end_at": "2023-11-07T05:31:56Z",
"planned_start_at": "2023-11-07T05:31:56Z",
"remarks": "<string>",
"reported_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requires_permit": True,
"safety_instructions": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"work_order_priority_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_order_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"p_work_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
p_values: {
asset_category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
due_at: '2023-11-07T05:31:56Z',
estimated_duration_minutes: 123,
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
planned_end_at: '2023-11-07T05:31:56Z',
planned_start_at: '2023-11-07T05:31:56Z',
remarks: '<string>',
reported_by_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
requires_permit: true,
safety_instructions: '<string>',
site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
work_order_priority_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
work_order_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
p_work_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.assetinfinity.ai/api/rpc/update_work_order', 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://app.assetinfinity.ai/api/rpc/update_work_order",
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([
'p_values' => [
'asset_category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'due_at' => '2023-11-07T05:31:56Z',
'estimated_duration_minutes' => 123,
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'planned_end_at' => '2023-11-07T05:31:56Z',
'planned_start_at' => '2023-11-07T05:31:56Z',
'remarks' => '<string>',
'reported_by_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'requires_permit' => true,
'safety_instructions' => '<string>',
'site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'work_order_priority_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'work_order_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'p_work_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"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://app.assetinfinity.ai/api/rpc/update_work_order"
payload := strings.NewReader("{\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"estimated_duration_minutes\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planned_end_at\": \"2023-11-07T05:31:56Z\",\n \"planned_start_at\": \"2023-11-07T05:31:56Z\",\n \"remarks\": \"<string>\",\n \"reported_by_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requires_permit\": true,\n \"safety_instructions\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"work_order_priority_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"work_order_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"p_work_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.assetinfinity.ai/api/rpc/update_work_order")
.header("Content-Type", "application/json")
.body("{\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"estimated_duration_minutes\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planned_end_at\": \"2023-11-07T05:31:56Z\",\n \"planned_start_at\": \"2023-11-07T05:31:56Z\",\n \"remarks\": \"<string>\",\n \"reported_by_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requires_permit\": true,\n \"safety_instructions\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"work_order_priority_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"work_order_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"p_work_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.assetinfinity.ai/api/rpc/update_work_order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"estimated_duration_minutes\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planned_end_at\": \"2023-11-07T05:31:56Z\",\n \"planned_start_at\": \"2023-11-07T05:31:56Z\",\n \"remarks\": \"<string>\",\n \"reported_by_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requires_permit\": true,\n \"safety_instructions\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"work_order_priority_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"work_order_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"p_work_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyWork orders
Change a work order's details
Correct what a job says about itself — its title, what is known, the machine it is against, whether it needs a permit. On the offline allowlist, so the person who mistyped it at the machine is the one who can put it right there.
The status, the urgency and the dates are refused: each is owned by the action that records why it moved — a transition, Set priority, Reschedule.
POST
/
rpc
/
update_work_order
Change a work order's details
curl --request POST \
--url https://app.assetinfinity.ai/api/rpc/update_work_order \
--header 'Content-Type: application/json' \
--data '
{
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"estimated_duration_minutes": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planned_end_at": "2023-11-07T05:31:56Z",
"planned_start_at": "2023-11-07T05:31:56Z",
"remarks": "<string>",
"reported_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requires_permit": true,
"safety_instructions": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"work_order_priority_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_order_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"p_work_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://app.assetinfinity.ai/api/rpc/update_work_order"
payload = {
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"estimated_duration_minutes": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planned_end_at": "2023-11-07T05:31:56Z",
"planned_start_at": "2023-11-07T05:31:56Z",
"remarks": "<string>",
"reported_by_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"requires_permit": True,
"safety_instructions": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"work_order_priority_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"work_order_type_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"p_work_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
p_values: {
asset_category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
due_at: '2023-11-07T05:31:56Z',
estimated_duration_minutes: 123,
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
planned_end_at: '2023-11-07T05:31:56Z',
planned_start_at: '2023-11-07T05:31:56Z',
remarks: '<string>',
reported_by_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
requires_permit: true,
safety_instructions: '<string>',
site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>',
work_order_priority_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
work_order_type_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
p_work_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://app.assetinfinity.ai/api/rpc/update_work_order', 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://app.assetinfinity.ai/api/rpc/update_work_order",
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([
'p_values' => [
'asset_category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'due_at' => '2023-11-07T05:31:56Z',
'estimated_duration_minutes' => 123,
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'planned_end_at' => '2023-11-07T05:31:56Z',
'planned_start_at' => '2023-11-07T05:31:56Z',
'remarks' => '<string>',
'reported_by_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'requires_permit' => true,
'safety_instructions' => '<string>',
'site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>',
'work_order_priority_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'work_order_type_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'p_work_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"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://app.assetinfinity.ai/api/rpc/update_work_order"
payload := strings.NewReader("{\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"estimated_duration_minutes\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planned_end_at\": \"2023-11-07T05:31:56Z\",\n \"planned_start_at\": \"2023-11-07T05:31:56Z\",\n \"remarks\": \"<string>\",\n \"reported_by_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requires_permit\": true,\n \"safety_instructions\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"work_order_priority_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"work_order_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"p_work_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://app.assetinfinity.ai/api/rpc/update_work_order")
.header("Content-Type", "application/json")
.body("{\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"estimated_duration_minutes\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planned_end_at\": \"2023-11-07T05:31:56Z\",\n \"planned_start_at\": \"2023-11-07T05:31:56Z\",\n \"remarks\": \"<string>\",\n \"reported_by_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requires_permit\": true,\n \"safety_instructions\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"work_order_priority_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"work_order_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"p_work_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.assetinfinity.ai/api/rpc/update_work_order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"estimated_duration_minutes\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planned_end_at\": \"2023-11-07T05:31:56Z\",\n \"planned_start_at\": \"2023-11-07T05:31:56Z\",\n \"remarks\": \"<string>\",\n \"reported_by_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"requires_permit\": true,\n \"safety_instructions\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\",\n \"work_order_priority_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"work_order_type_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"p_work_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_bodyHeaders
Preference
Available options:
params=single-object Body
application/jsonapplication/vnd.pgrst.object+jsonapplication/vnd.pgrst.object+json;nulls=strippedtext/csv
Correct what a job says about itself — its title, what is known, the machine it is against, whether it needs a permit. On the offline allowlist, so the person who mistyped it at the machine is the one who can put it right there.
The status, the urgency and the dates are refused: each is owned by the action that records why
it moved — a transition, Set priority, Reschedule.
Response
200
OK
⌘I

