Create an asset model
curl --request POST \
--url https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"modelName": "<string>",
"assetTypeId": 123,
"id": 123,
"manuals": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"specs": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models"
payload = {
"modelName": "<string>",
"assetTypeId": 123,
"id": 123,
"manuals": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"specs": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
modelName: '<string>',
assetTypeId: 123,
id: 123,
manuals: [{fileName: '<string>', fileId: '<string>'}],
specs: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models', 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.useopenwrench.com/api/external/v1/buyer/asset/asset_models",
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([
'modelName' => '<string>',
'assetTypeId' => 123,
'id' => 123,
'manuals' => [
[
'fileName' => '<string>',
'fileId' => '<string>'
]
],
'specs' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"OW-KEY: <api-key>",
"X-API-KEY: <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.useopenwrench.com/api/external/v1/buyer/asset/asset_models"
payload := strings.NewReader("{\n \"modelName\": \"<string>\",\n \"assetTypeId\": 123,\n \"id\": 123,\n \"manuals\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"specs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
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.useopenwrench.com/api/external/v1/buyer/asset/asset_models")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"modelName\": \"<string>\",\n \"assetTypeId\": 123,\n \"id\": 123,\n \"manuals\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"specs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"modelName\": \"<string>\",\n \"assetTypeId\": 123,\n \"id\": 123,\n \"manuals\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"specs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"modelName": "<string>",
"assetTypeId": 123,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"manuals": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"specs": [
{
"key": "<string>",
"value": "<string>"
}
],
"assetType": {
"name": "<string>",
"usesRefrigerant": true,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"primarySpendCategory": 123,
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"allProblemTypeIds": [
123
],
"allProblemTypeIdsAsString": "<string>",
"allProblemTypes": [
{
"id": 123,
"name": "<string>"
}
],
"allProblemTypesName": "<string>",
"allSpendCategories": [
123
],
"depreciationClassId": 123,
"depreciationClassName": "<string>",
"requiredFields": [
{}
],
"optionalFields": [
{}
],
"replaceMarkupOnOriginalCost": 123,
"replacementThreshold": 123,
"applianceCategory": "<string>",
"refrigerantTypeCode": "<string>",
"fullChargeLb": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"status": "ok"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Asset Models
Create an asset model
Creates an asset model. buyerCompanyId is derived from the API key.
POST
/
v1
/
buyer
/
asset
/
asset_models
Create an asset model
curl --request POST \
--url https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"modelName": "<string>",
"assetTypeId": 123,
"id": 123,
"manuals": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"specs": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models"
payload = {
"modelName": "<string>",
"assetTypeId": 123,
"id": 123,
"manuals": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"specs": [
{
"key": "<string>",
"value": "<string>"
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
modelName: '<string>',
assetTypeId: 123,
id: 123,
manuals: [{fileName: '<string>', fileId: '<string>'}],
specs: [{key: '<string>', value: '<string>'}]
})
};
fetch('https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models', 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.useopenwrench.com/api/external/v1/buyer/asset/asset_models",
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([
'modelName' => '<string>',
'assetTypeId' => 123,
'id' => 123,
'manuals' => [
[
'fileName' => '<string>',
'fileId' => '<string>'
]
],
'specs' => [
[
'key' => '<string>',
'value' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"OW-KEY: <api-key>",
"X-API-KEY: <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.useopenwrench.com/api/external/v1/buyer/asset/asset_models"
payload := strings.NewReader("{\n \"modelName\": \"<string>\",\n \"assetTypeId\": 123,\n \"id\": 123,\n \"manuals\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"specs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("OW-KEY", "<api-key>")
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.useopenwrench.com/api/external/v1/buyer/asset/asset_models")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"modelName\": \"<string>\",\n \"assetTypeId\": 123,\n \"id\": 123,\n \"manuals\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"specs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/buyer/asset/asset_models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"modelName\": \"<string>\",\n \"assetTypeId\": 123,\n \"id\": 123,\n \"manuals\": [\n {\n \"fileName\": \"<string>\",\n \"fileId\": \"<string>\"\n }\n ],\n \"specs\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": {
"modelName": "<string>",
"assetTypeId": 123,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"manuals": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"specs": [
{
"key": "<string>",
"value": "<string>"
}
],
"assetType": {
"name": "<string>",
"usesRefrigerant": true,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"primarySpendCategory": 123,
"attachments": [
{
"fileName": "<string>",
"fileId": "<string>"
}
],
"allProblemTypeIds": [
123
],
"allProblemTypeIdsAsString": "<string>",
"allProblemTypes": [
{
"id": 123,
"name": "<string>"
}
],
"allProblemTypesName": "<string>",
"allSpendCategories": [
123
],
"depreciationClassId": 123,
"depreciationClassName": "<string>",
"requiredFields": [
{}
],
"optionalFields": [
{}
],
"replaceMarkupOnOriginalCost": 123,
"replacementThreshold": 123,
"applianceCategory": "<string>",
"refrigerantTypeCode": "<string>",
"fullChargeLb": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
},
"status": "ok"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}{
"message": "<string>",
"type": "<string>",
"status": "error",
"traceId": "<string>"
}Autorizaciones
OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.
Cuerpo
application/json