Set fields on one asset. Site and location are refused: moving an asset is api.move_asset, which records where it came from.
curl --request POST \
--url https://app.assetinfinity.ai/api/rpc/update_asset \
--header 'Content-Type: application/json' \
--data '
{
"p_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissioning_date": "2023-12-25",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"criticality_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custodian_email": "<string>",
"custodian_name": "<string>",
"custodian_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custody_since": "2023-12-25",
"custody_until": "2023-12-25",
"default_booking_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"expected_life_months": 123,
"installation_date": "2023-12-25",
"latitude": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"manufacturer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"parent_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchase_cost": 123,
"purchase_date": "2023-12-25",
"replacement_date": "2023-12-25",
"replacement_value": 123,
"replacement_value_as_at": "2023-12-25",
"replacement_value_source": "<string>",
"serial_number": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warranty_expires_on": "2023-12-25"
}
}
'import requests
url = "https://app.assetinfinity.ai/api/rpc/update_asset"
payload = {
"p_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissioning_date": "2023-12-25",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"criticality_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custodian_email": "<string>",
"custodian_name": "<string>",
"custodian_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custody_since": "2023-12-25",
"custody_until": "2023-12-25",
"default_booking_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"expected_life_months": 123,
"installation_date": "2023-12-25",
"latitude": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"manufacturer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"parent_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchase_cost": 123,
"purchase_date": "2023-12-25",
"replacement_date": "2023-12-25",
"replacement_value": 123,
"replacement_value_as_at": "2023-12-25",
"replacement_value_source": "<string>",
"serial_number": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warranty_expires_on": "2023-12-25"
}
}
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_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_values: {
asset_category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
asset_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
commissioning_date: '2023-12-25',
cost_center_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
criticality_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
custodian_email: '<string>',
custodian_name: '<string>',
custodian_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
custody_since: '2023-12-25',
custody_until: '2023-12-25',
default_booking_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
department_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
expected_life_months: 123,
installation_date: '2023-12-25',
latitude: 123,
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
manufacturer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
parent_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
purchase_cost: 123,
purchase_date: '2023-12-25',
replacement_date: '2023-12-25',
replacement_value: 123,
replacement_value_as_at: '2023-12-25',
replacement_value_source: '<string>',
serial_number: '<string>',
site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
warranty_expires_on: '2023-12-25'
}
})
};
fetch('https://app.assetinfinity.ai/api/rpc/update_asset', 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_asset",
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_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_values' => [
'asset_category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'asset_model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'commissioning_date' => '2023-12-25',
'cost_center_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'criticality_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'custodian_email' => '<string>',
'custodian_name' => '<string>',
'custodian_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'custody_since' => '2023-12-25',
'custody_until' => '2023-12-25',
'default_booking_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'department_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'expected_life_months' => 123,
'installation_date' => '2023-12-25',
'latitude' => 123,
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'manufacturer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'parent_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'purchase_cost' => 123,
'purchase_date' => '2023-12-25',
'replacement_date' => '2023-12-25',
'replacement_value' => 123,
'replacement_value_as_at' => '2023-12-25',
'replacement_value_source' => '<string>',
'serial_number' => '<string>',
'site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'warranty_expires_on' => '2023-12-25'
]
]),
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_asset"
payload := strings.NewReader("{\n \"p_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissioning_date\": \"2023-12-25\",\n \"cost_center_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"criticality_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custodian_email\": \"<string>\",\n \"custodian_name\": \"<string>\",\n \"custodian_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custody_since\": \"2023-12-25\",\n \"custody_until\": \"2023-12-25\",\n \"default_booking_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"expected_life_months\": 123,\n \"installation_date\": \"2023-12-25\",\n \"latitude\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"manufacturer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"parent_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"purchase_cost\": 123,\n \"purchase_date\": \"2023-12-25\",\n \"replacement_date\": \"2023-12-25\",\n \"replacement_value\": 123,\n \"replacement_value_as_at\": \"2023-12-25\",\n \"replacement_value_source\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warranty_expires_on\": \"2023-12-25\"\n }\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_asset")
.header("Content-Type", "application/json")
.body("{\n \"p_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissioning_date\": \"2023-12-25\",\n \"cost_center_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"criticality_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custodian_email\": \"<string>\",\n \"custodian_name\": \"<string>\",\n \"custodian_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custody_since\": \"2023-12-25\",\n \"custody_until\": \"2023-12-25\",\n \"default_booking_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"expected_life_months\": 123,\n \"installation_date\": \"2023-12-25\",\n \"latitude\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"manufacturer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"parent_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"purchase_cost\": 123,\n \"purchase_date\": \"2023-12-25\",\n \"replacement_date\": \"2023-12-25\",\n \"replacement_value\": 123,\n \"replacement_value_as_at\": \"2023-12-25\",\n \"replacement_value_source\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warranty_expires_on\": \"2023-12-25\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.assetinfinity.ai/api/rpc/update_asset")
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_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissioning_date\": \"2023-12-25\",\n \"cost_center_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"criticality_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custodian_email\": \"<string>\",\n \"custodian_name\": \"<string>\",\n \"custodian_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custody_since\": \"2023-12-25\",\n \"custody_until\": \"2023-12-25\",\n \"default_booking_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"expected_life_months\": 123,\n \"installation_date\": \"2023-12-25\",\n \"latitude\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"manufacturer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"parent_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"purchase_cost\": 123,\n \"purchase_date\": \"2023-12-25\",\n \"replacement_date\": \"2023-12-25\",\n \"replacement_value\": 123,\n \"replacement_value_as_at\": \"2023-12-25\",\n \"replacement_value_source\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warranty_expires_on\": \"2023-12-25\"\n }\n}"
response = http.request(request)
puts response.read_bodyAssets
Set fields on one asset. Site and location are refused: moving an asset is api.move_asset, which records where it came from.
POST
/
rpc
/
update_asset
Set fields on one asset. Site and location are refused: moving an asset is api.move_asset, which records where it came from.
curl --request POST \
--url https://app.assetinfinity.ai/api/rpc/update_asset \
--header 'Content-Type: application/json' \
--data '
{
"p_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissioning_date": "2023-12-25",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"criticality_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custodian_email": "<string>",
"custodian_name": "<string>",
"custodian_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custody_since": "2023-12-25",
"custody_until": "2023-12-25",
"default_booking_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"expected_life_months": 123,
"installation_date": "2023-12-25",
"latitude": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"manufacturer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"parent_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchase_cost": 123,
"purchase_date": "2023-12-25",
"replacement_date": "2023-12-25",
"replacement_value": 123,
"replacement_value_as_at": "2023-12-25",
"replacement_value_source": "<string>",
"serial_number": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warranty_expires_on": "2023-12-25"
}
}
'import requests
url = "https://app.assetinfinity.ai/api/rpc/update_asset"
payload = {
"p_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"p_values": {
"asset_category_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_model_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"commissioning_date": "2023-12-25",
"cost_center_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"criticality_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custodian_email": "<string>",
"custodian_name": "<string>",
"custodian_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"custody_since": "2023-12-25",
"custody_until": "2023-12-25",
"default_booking_rate_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"department_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "<string>",
"expected_life_months": 123,
"installation_date": "2023-12-25",
"latitude": 123,
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"manufacturer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"parent_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"purchase_cost": 123,
"purchase_date": "2023-12-25",
"replacement_date": "2023-12-25",
"replacement_value": 123,
"replacement_value_as_at": "2023-12-25",
"replacement_value_source": "<string>",
"serial_number": "<string>",
"site_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"warranty_expires_on": "2023-12-25"
}
}
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_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
p_values: {
asset_category_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
asset_model_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
commissioning_date: '2023-12-25',
cost_center_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
criticality_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
custodian_email: '<string>',
custodian_name: '<string>',
custodian_user_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
custody_since: '2023-12-25',
custody_until: '2023-12-25',
default_booking_rate_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
department_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
description: '<string>',
expected_life_months: 123,
installation_date: '2023-12-25',
latitude: 123,
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
manufacturer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
parent_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
purchase_cost: 123,
purchase_date: '2023-12-25',
replacement_date: '2023-12-25',
replacement_value: 123,
replacement_value_as_at: '2023-12-25',
replacement_value_source: '<string>',
serial_number: '<string>',
site_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
warranty_expires_on: '2023-12-25'
}
})
};
fetch('https://app.assetinfinity.ai/api/rpc/update_asset', 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_asset",
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_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'p_values' => [
'asset_category_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'asset_model_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'commissioning_date' => '2023-12-25',
'cost_center_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'criticality_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'custodian_email' => '<string>',
'custodian_name' => '<string>',
'custodian_user_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'custody_since' => '2023-12-25',
'custody_until' => '2023-12-25',
'default_booking_rate_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'department_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'description' => '<string>',
'expected_life_months' => 123,
'installation_date' => '2023-12-25',
'latitude' => 123,
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'manufacturer_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'parent_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'purchase_cost' => 123,
'purchase_date' => '2023-12-25',
'replacement_date' => '2023-12-25',
'replacement_value' => 123,
'replacement_value_as_at' => '2023-12-25',
'replacement_value_source' => '<string>',
'serial_number' => '<string>',
'site_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'warranty_expires_on' => '2023-12-25'
]
]),
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_asset"
payload := strings.NewReader("{\n \"p_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissioning_date\": \"2023-12-25\",\n \"cost_center_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"criticality_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custodian_email\": \"<string>\",\n \"custodian_name\": \"<string>\",\n \"custodian_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custody_since\": \"2023-12-25\",\n \"custody_until\": \"2023-12-25\",\n \"default_booking_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"expected_life_months\": 123,\n \"installation_date\": \"2023-12-25\",\n \"latitude\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"manufacturer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"parent_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"purchase_cost\": 123,\n \"purchase_date\": \"2023-12-25\",\n \"replacement_date\": \"2023-12-25\",\n \"replacement_value\": 123,\n \"replacement_value_as_at\": \"2023-12-25\",\n \"replacement_value_source\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warranty_expires_on\": \"2023-12-25\"\n }\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_asset")
.header("Content-Type", "application/json")
.body("{\n \"p_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissioning_date\": \"2023-12-25\",\n \"cost_center_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"criticality_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custodian_email\": \"<string>\",\n \"custodian_name\": \"<string>\",\n \"custodian_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custody_since\": \"2023-12-25\",\n \"custody_until\": \"2023-12-25\",\n \"default_booking_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"expected_life_months\": 123,\n \"installation_date\": \"2023-12-25\",\n \"latitude\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"manufacturer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"parent_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"purchase_cost\": 123,\n \"purchase_date\": \"2023-12-25\",\n \"replacement_date\": \"2023-12-25\",\n \"replacement_value\": 123,\n \"replacement_value_as_at\": \"2023-12-25\",\n \"replacement_value_source\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warranty_expires_on\": \"2023-12-25\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.assetinfinity.ai/api/rpc/update_asset")
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_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"p_values\": {\n \"asset_category_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"asset_model_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"commissioning_date\": \"2023-12-25\",\n \"cost_center_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"criticality_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custodian_email\": \"<string>\",\n \"custodian_name\": \"<string>\",\n \"custodian_user_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"custody_since\": \"2023-12-25\",\n \"custody_until\": \"2023-12-25\",\n \"default_booking_rate_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"department_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"description\": \"<string>\",\n \"expected_life_months\": 123,\n \"installation_date\": \"2023-12-25\",\n \"latitude\": 123,\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"manufacturer_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"parent_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"purchase_cost\": 123,\n \"purchase_date\": \"2023-12-25\",\n \"replacement_date\": \"2023-12-25\",\n \"replacement_value\": 123,\n \"replacement_value_as_at\": \"2023-12-25\",\n \"replacement_value_source\": \"<string>\",\n \"serial_number\": \"<string>\",\n \"site_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"warranty_expires_on\": \"2023-12-25\"\n }\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
Response
200
OK
⌘I

