curl --request POST \
--url https://app.assetinfinity.ai/api/rpc/update_maintenance_plan \
--header 'Content-Type: application/json' \
--data '
{
"p_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_to_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_auto_generate_work_order": true,
"p_clear_assigned_team": true,
"p_clear_assigned_to_user": true,
"p_clear_end_date": true,
"p_clear_inspection_template": true,
"p_clear_preferred_vendor": true,
"p_clear_preferred_worker": true,
"p_clear_reminder_days": true,
"p_description": "<string>",
"p_end_date": "2023-12-25",
"p_estimated_duration_minutes": 123,
"p_inspection_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_instructions": "<string>",
"p_lead_time_days": 123,
"p_maintenance_type": "<string>",
"p_name": "<string>",
"p_preferred_vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_preferred_worker_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_priority_code": "<string>",
"p_reminder_days": 123,
"p_requires_permit": true,
"p_requires_shutdown": true,
"p_safety_instructions": "<string>",
"p_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_sla_resolution_minutes": 123,
"p_sla_response_minutes": 123,
"p_tolerance_days": 123,
"p_trigger_combination": "<string>",
"p_use_contract_visits": true
}
'import requests
url = "https://app.assetinfinity.ai/api/rpc/update_maintenance_plan"
payload = {
"p_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_to_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_auto_generate_work_order": True,
"p_clear_assigned_team": True,
"p_clear_assigned_to_user": True,
"p_clear_end_date": True,
"p_clear_inspection_template": True,
"p_clear_preferred_vendor": True,
"p_clear_preferred_worker": True,
"p_clear_reminder_days": True,
"p_description": "<string>",
"p_end_date": "2023-12-25",
"p_estimated_duration_minutes": 123,
"p_inspection_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_instructions": "<string>",
"p_lead_time_days": 123,
"p_maintenance_type": "<string>",
"p_name": "<string>",
"p_preferred_vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_preferred_worker_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_priority_code": "<string>",
"p_reminder_days": 123,
"p_requires_permit": True,
"p_requires_shutdown": True,
"p_safety_instructions": "<string>",
"p_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_sla_resolution_minutes": 123,
"p_sla_response_minutes": 123,
"p_tolerance_days": 123,
"p_trigger_combination": "<string>",
"p_use_contract_visits": True
}
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_plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_assigned_team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_assigned_to_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_auto_generate_work_order: true,
p_clear_assigned_team: true,
p_clear_assigned_to_user: true,
p_clear_end_date: true,
p_clear_inspection_template: true,
p_clear_preferred_vendor: true,
p_clear_preferred_worker: true,
p_clear_reminder_days: true,
p_description: '<string>',
p_end_date: '2023-12-25',
p_estimated_duration_minutes: 123,
p_inspection_template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_instructions: '<string>',
p_lead_time_days: 123,
p_maintenance_type: '<string>',
p_name: '<string>',
p_preferred_vendor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_preferred_worker_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_priority_code: '<string>',
p_reminder_days: 123,
p_requires_permit: true,
p_requires_shutdown: true,
p_safety_instructions: '<string>',
p_site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_sla_resolution_minutes: 123,
p_sla_response_minutes: 123,
p_tolerance_days: 123,
p_trigger_combination: '<string>',
p_use_contract_visits: true
})
};
fetch('https://app.assetinfinity.ai/api/rpc/update_maintenance_plan', 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_maintenance_plan",
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_plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_assigned_team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_assigned_to_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_auto_generate_work_order' => true,
'p_clear_assigned_team' => true,
'p_clear_assigned_to_user' => true,
'p_clear_end_date' => true,
'p_clear_inspection_template' => true,
'p_clear_preferred_vendor' => true,
'p_clear_preferred_worker' => true,
'p_clear_reminder_days' => true,
'p_description' => '<string>',
'p_end_date' => '2023-12-25',
'p_estimated_duration_minutes' => 123,
'p_inspection_template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_instructions' => '<string>',
'p_lead_time_days' => 123,
'p_maintenance_type' => '<string>',
'p_name' => '<string>',
'p_preferred_vendor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_preferred_worker_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_priority_code' => '<string>',
'p_reminder_days' => 123,
'p_requires_permit' => true,
'p_requires_shutdown' => true,
'p_safety_instructions' => '<string>',
'p_site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_sla_resolution_minutes' => 123,
'p_sla_response_minutes' => 123,
'p_tolerance_days' => 123,
'p_trigger_combination' => '<string>',
'p_use_contract_visits' => true
]),
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_maintenance_plan"
payload := strings.NewReader("{\n \"p_plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_to_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_auto_generate_work_order\": true,\n \"p_clear_assigned_team\": true,\n \"p_clear_assigned_to_user\": true,\n \"p_clear_end_date\": true,\n \"p_clear_inspection_template\": true,\n \"p_clear_preferred_vendor\": true,\n \"p_clear_preferred_worker\": true,\n \"p_clear_reminder_days\": true,\n \"p_description\": \"<string>\",\n \"p_end_date\": \"2023-12-25\",\n \"p_estimated_duration_minutes\": 123,\n \"p_inspection_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_instructions\": \"<string>\",\n \"p_lead_time_days\": 123,\n \"p_maintenance_type\": \"<string>\",\n \"p_name\": \"<string>\",\n \"p_preferred_vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_preferred_worker_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_priority_code\": \"<string>\",\n \"p_reminder_days\": 123,\n \"p_requires_permit\": true,\n \"p_requires_shutdown\": true,\n \"p_safety_instructions\": \"<string>\",\n \"p_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_sla_resolution_minutes\": 123,\n \"p_sla_response_minutes\": 123,\n \"p_tolerance_days\": 123,\n \"p_trigger_combination\": \"<string>\",\n \"p_use_contract_visits\": true\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_maintenance_plan")
.header("Content-Type", "application/json")
.body("{\n \"p_plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_to_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_auto_generate_work_order\": true,\n \"p_clear_assigned_team\": true,\n \"p_clear_assigned_to_user\": true,\n \"p_clear_end_date\": true,\n \"p_clear_inspection_template\": true,\n \"p_clear_preferred_vendor\": true,\n \"p_clear_preferred_worker\": true,\n \"p_clear_reminder_days\": true,\n \"p_description\": \"<string>\",\n \"p_end_date\": \"2023-12-25\",\n \"p_estimated_duration_minutes\": 123,\n \"p_inspection_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_instructions\": \"<string>\",\n \"p_lead_time_days\": 123,\n \"p_maintenance_type\": \"<string>\",\n \"p_name\": \"<string>\",\n \"p_preferred_vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_preferred_worker_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_priority_code\": \"<string>\",\n \"p_reminder_days\": 123,\n \"p_requires_permit\": true,\n \"p_requires_shutdown\": true,\n \"p_safety_instructions\": \"<string>\",\n \"p_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_sla_resolution_minutes\": 123,\n \"p_sla_response_minutes\": 123,\n \"p_tolerance_days\": 123,\n \"p_trigger_combination\": \"<string>\",\n \"p_use_contract_visits\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.assetinfinity.ai/api/rpc/update_maintenance_plan")
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_plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_to_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_auto_generate_work_order\": true,\n \"p_clear_assigned_team\": true,\n \"p_clear_assigned_to_user\": true,\n \"p_clear_end_date\": true,\n \"p_clear_inspection_template\": true,\n \"p_clear_preferred_vendor\": true,\n \"p_clear_preferred_worker\": true,\n \"p_clear_reminder_days\": true,\n \"p_description\": \"<string>\",\n \"p_end_date\": \"2023-12-25\",\n \"p_estimated_duration_minutes\": 123,\n \"p_inspection_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_instructions\": \"<string>\",\n \"p_lead_time_days\": 123,\n \"p_maintenance_type\": \"<string>\",\n \"p_name\": \"<string>\",\n \"p_preferred_vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_preferred_worker_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_priority_code\": \"<string>\",\n \"p_reminder_days\": 123,\n \"p_requires_permit\": true,\n \"p_requires_shutdown\": true,\n \"p_safety_instructions\": \"<string>\",\n \"p_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_sla_resolution_minutes\": 123,\n \"p_sla_response_minutes\": 123,\n \"p_tolerance_days\": 123,\n \"p_trigger_combination\": \"<string>\",\n \"p_use_contract_visits\": true\n}"
response = http.request(request)
puts response.read_bodyChange a plan's own details, leaving its scope, triggers and tasks alone.
Three of its arguments are about who does the work and they are not interchangeable.
assigned_team_id and preferred_worker_id are in-house, and generation prefers the crew of the
two; preferred_vendor_id is the route out, taken only when neither in-house slot is filled.
assigned_to_user_id is none of those — it is the login the schedule’s reminders go to.
NULL on any of them means leave it alone, so each has a clear flag beside it: a leaver comes off two hundred plans, and a contract ending brings work back in-house.
On an active plan that raises its own work, the rounds inside the lead time are made due and their work is raised before this returns, rather than by the next scheduled sweep.
curl --request POST \
--url https://app.assetinfinity.ai/api/rpc/update_maintenance_plan \
--header 'Content-Type: application/json' \
--data '
{
"p_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_to_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_auto_generate_work_order": true,
"p_clear_assigned_team": true,
"p_clear_assigned_to_user": true,
"p_clear_end_date": true,
"p_clear_inspection_template": true,
"p_clear_preferred_vendor": true,
"p_clear_preferred_worker": true,
"p_clear_reminder_days": true,
"p_description": "<string>",
"p_end_date": "2023-12-25",
"p_estimated_duration_minutes": 123,
"p_inspection_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_instructions": "<string>",
"p_lead_time_days": 123,
"p_maintenance_type": "<string>",
"p_name": "<string>",
"p_preferred_vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_preferred_worker_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_priority_code": "<string>",
"p_reminder_days": 123,
"p_requires_permit": true,
"p_requires_shutdown": true,
"p_safety_instructions": "<string>",
"p_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_sla_resolution_minutes": 123,
"p_sla_response_minutes": 123,
"p_tolerance_days": 123,
"p_trigger_combination": "<string>",
"p_use_contract_visits": true
}
'import requests
url = "https://app.assetinfinity.ai/api/rpc/update_maintenance_plan"
payload = {
"p_plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_team_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_assigned_to_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_auto_generate_work_order": True,
"p_clear_assigned_team": True,
"p_clear_assigned_to_user": True,
"p_clear_end_date": True,
"p_clear_inspection_template": True,
"p_clear_preferred_vendor": True,
"p_clear_preferred_worker": True,
"p_clear_reminder_days": True,
"p_description": "<string>",
"p_end_date": "2023-12-25",
"p_estimated_duration_minutes": 123,
"p_inspection_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_instructions": "<string>",
"p_lead_time_days": 123,
"p_maintenance_type": "<string>",
"p_name": "<string>",
"p_preferred_vendor_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_preferred_worker_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_priority_code": "<string>",
"p_reminder_days": 123,
"p_requires_permit": True,
"p_requires_shutdown": True,
"p_safety_instructions": "<string>",
"p_site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_sla_resolution_minutes": 123,
"p_sla_response_minutes": 123,
"p_tolerance_days": 123,
"p_trigger_combination": "<string>",
"p_use_contract_visits": True
}
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_plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_assigned_team_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_assigned_to_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_auto_generate_work_order: true,
p_clear_assigned_team: true,
p_clear_assigned_to_user: true,
p_clear_end_date: true,
p_clear_inspection_template: true,
p_clear_preferred_vendor: true,
p_clear_preferred_worker: true,
p_clear_reminder_days: true,
p_description: '<string>',
p_end_date: '2023-12-25',
p_estimated_duration_minutes: 123,
p_inspection_template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_instructions: '<string>',
p_lead_time_days: 123,
p_maintenance_type: '<string>',
p_name: '<string>',
p_preferred_vendor_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_preferred_worker_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_priority_code: '<string>',
p_reminder_days: 123,
p_requires_permit: true,
p_requires_shutdown: true,
p_safety_instructions: '<string>',
p_site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_sla_resolution_minutes: 123,
p_sla_response_minutes: 123,
p_tolerance_days: 123,
p_trigger_combination: '<string>',
p_use_contract_visits: true
})
};
fetch('https://app.assetinfinity.ai/api/rpc/update_maintenance_plan', 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_maintenance_plan",
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_plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_assigned_team_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_assigned_to_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_auto_generate_work_order' => true,
'p_clear_assigned_team' => true,
'p_clear_assigned_to_user' => true,
'p_clear_end_date' => true,
'p_clear_inspection_template' => true,
'p_clear_preferred_vendor' => true,
'p_clear_preferred_worker' => true,
'p_clear_reminder_days' => true,
'p_description' => '<string>',
'p_end_date' => '2023-12-25',
'p_estimated_duration_minutes' => 123,
'p_inspection_template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_instructions' => '<string>',
'p_lead_time_days' => 123,
'p_maintenance_type' => '<string>',
'p_name' => '<string>',
'p_preferred_vendor_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_preferred_worker_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_priority_code' => '<string>',
'p_reminder_days' => 123,
'p_requires_permit' => true,
'p_requires_shutdown' => true,
'p_safety_instructions' => '<string>',
'p_site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_sla_resolution_minutes' => 123,
'p_sla_response_minutes' => 123,
'p_tolerance_days' => 123,
'p_trigger_combination' => '<string>',
'p_use_contract_visits' => true
]),
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_maintenance_plan"
payload := strings.NewReader("{\n \"p_plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_to_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_auto_generate_work_order\": true,\n \"p_clear_assigned_team\": true,\n \"p_clear_assigned_to_user\": true,\n \"p_clear_end_date\": true,\n \"p_clear_inspection_template\": true,\n \"p_clear_preferred_vendor\": true,\n \"p_clear_preferred_worker\": true,\n \"p_clear_reminder_days\": true,\n \"p_description\": \"<string>\",\n \"p_end_date\": \"2023-12-25\",\n \"p_estimated_duration_minutes\": 123,\n \"p_inspection_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_instructions\": \"<string>\",\n \"p_lead_time_days\": 123,\n \"p_maintenance_type\": \"<string>\",\n \"p_name\": \"<string>\",\n \"p_preferred_vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_preferred_worker_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_priority_code\": \"<string>\",\n \"p_reminder_days\": 123,\n \"p_requires_permit\": true,\n \"p_requires_shutdown\": true,\n \"p_safety_instructions\": \"<string>\",\n \"p_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_sla_resolution_minutes\": 123,\n \"p_sla_response_minutes\": 123,\n \"p_tolerance_days\": 123,\n \"p_trigger_combination\": \"<string>\",\n \"p_use_contract_visits\": true\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_maintenance_plan")
.header("Content-Type", "application/json")
.body("{\n \"p_plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_to_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_auto_generate_work_order\": true,\n \"p_clear_assigned_team\": true,\n \"p_clear_assigned_to_user\": true,\n \"p_clear_end_date\": true,\n \"p_clear_inspection_template\": true,\n \"p_clear_preferred_vendor\": true,\n \"p_clear_preferred_worker\": true,\n \"p_clear_reminder_days\": true,\n \"p_description\": \"<string>\",\n \"p_end_date\": \"2023-12-25\",\n \"p_estimated_duration_minutes\": 123,\n \"p_inspection_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_instructions\": \"<string>\",\n \"p_lead_time_days\": 123,\n \"p_maintenance_type\": \"<string>\",\n \"p_name\": \"<string>\",\n \"p_preferred_vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_preferred_worker_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_priority_code\": \"<string>\",\n \"p_reminder_days\": 123,\n \"p_requires_permit\": true,\n \"p_requires_shutdown\": true,\n \"p_safety_instructions\": \"<string>\",\n \"p_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_sla_resolution_minutes\": 123,\n \"p_sla_response_minutes\": 123,\n \"p_tolerance_days\": 123,\n \"p_trigger_combination\": \"<string>\",\n \"p_use_contract_visits\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.assetinfinity.ai/api/rpc/update_maintenance_plan")
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_plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_team_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_assigned_to_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_auto_generate_work_order\": true,\n \"p_clear_assigned_team\": true,\n \"p_clear_assigned_to_user\": true,\n \"p_clear_end_date\": true,\n \"p_clear_inspection_template\": true,\n \"p_clear_preferred_vendor\": true,\n \"p_clear_preferred_worker\": true,\n \"p_clear_reminder_days\": true,\n \"p_description\": \"<string>\",\n \"p_end_date\": \"2023-12-25\",\n \"p_estimated_duration_minutes\": 123,\n \"p_inspection_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_instructions\": \"<string>\",\n \"p_lead_time_days\": 123,\n \"p_maintenance_type\": \"<string>\",\n \"p_name\": \"<string>\",\n \"p_preferred_vendor_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_preferred_worker_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_priority_code\": \"<string>\",\n \"p_reminder_days\": 123,\n \"p_requires_permit\": true,\n \"p_requires_shutdown\": true,\n \"p_safety_instructions\": \"<string>\",\n \"p_site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_sla_resolution_minutes\": 123,\n \"p_sla_response_minutes\": 123,\n \"p_tolerance_days\": 123,\n \"p_trigger_combination\": \"<string>\",\n \"p_use_contract_visits\": true\n}"
response = http.request(request)
puts response.read_bodyHeaders
Preference
params=single-object Body
Change a plan's own details, leaving its scope, triggers and tasks alone.
Three of its arguments are about who does the work and they are not interchangeable.
assigned_team_id and preferred_worker_id are in-house, and generation prefers the crew of the
two; preferred_vendor_id is the route out, taken only when neither in-house slot is filled.
assigned_to_user_id is none of those — it is the login the schedule's reminders go to.
NULL on any of them means leave it alone, so each has a clear flag beside it: a leaver comes off two hundred plans, and a contract ending brings work back in-house.
On an active plan that raises its own work, the rounds inside the lead time are made due and their work is raised before this returns, rather than by the next scheduled sweep.
Response
OK

