curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"ids": [
123
]
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels"
payload = { "ids": [123] }
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ids: [123]})
};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels', 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/supplier/asset/assets/{assetId}/labels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
123
]
]),
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/supplier/asset/assets/{assetId}/labels"
payload := strings.NewReader("{\n \"ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": [
{
"label": "<string>",
"associatedAssetsCount": 123,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"color": "<string>",
"createdBy": "<string>",
"createdAt": "<string>",
"updatedBy": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
}
],
"count": 123,
"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>"
}Replace an asset's labels
Replaces the full set of labels on an asset with the ids in the body; labels not listed are removed, and an empty ids array clears them all. Every id must be a live label of your buyer company’s catalog; unknown or cross-tenant ids are rejected with 400. The write is gated by the asset write permission: a key that can only read the asset gets 400. Only keys of a buyer’s internal service team can manage asset labels; a third-party supplier’s key gets 400 even when it holds asset write permission. An unknown, deleted, or foreign asset id answers the same 400 as a denied write, so ids outside your tenant are not disclosed as 404s.
curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels \
--header 'Content-Type: application/json' \
--header 'OW-KEY: <api-key>' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"ids": [
123
]
}
'import requests
url = "https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels"
payload = { "ids": [123] }
headers = {
"X-API-KEY": "<api-key>",
"OW-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-API-KEY': '<api-key>',
'OW-KEY': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({ids: [123]})
};
fetch('https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels', 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/supplier/asset/assets/{assetId}/labels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'ids' => [
123
]
]),
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/supplier/asset/assets/{assetId}/labels"
payload := strings.NewReader("{\n \"ids\": [\n 123\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels")
.header("X-API-KEY", "<api-key>")
.header("OW-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ids\": [\n 123\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useopenwrench.com/api/external/v1/supplier/asset/assets/{assetId}/labels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["OW-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ids\": [\n 123\n ]\n}"
response = http.request(request)
puts response.read_body{
"type": "<string>",
"data": [
{
"label": "<string>",
"associatedAssetsCount": 123,
"buyerCompanyId": 123,
"isDeleted": true,
"id": 123,
"color": "<string>",
"createdBy": "<string>",
"createdAt": "<string>",
"updatedBy": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
}
],
"count": 123,
"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>"
}Authorizations
OpenWrench shared secret. Required on every request alongside X-API-KEY; issued together with your API key.
Path Parameters
Asset id.
Body
Full replacement set of label ids. Send an empty array to clear all labels.
Ids of labels from the corresponding label catalog. Duplicates are de-duplicated.