curl --request PUT \
--url https://api.useopenwrench.com/api/external/v1/supplier/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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": [
{
"workOrderId": 123,
"workOrderLabelId": 123,
"action": "added",
"isActive": true,
"createdBy": "<string>",
"createdAt": "<string>",
"id": 123,
"workOrderLabel": {
"label": "<string>",
"associatedWorkOrdersCount": 123,
"isDeleted": true,
"id": 123,
"color": "<string>",
"buyerCompanyId": 123,
"supplierFacilityId": 123,
"createdBy": "<string>",
"createdAt": "<string>",
"updatedBy": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
},
"createdByContact": {
"email": "<string>",
"nameGiven": "<string>",
"nameFamily": "<string>",
"contactType": "<string>",
"title": "<string>",
"department": "<string>",
"facilityId": 123,
"isSharedContact": true,
"readOnlyAccess": true,
"invitedByEmail": "<string>",
"invitedAt": "2023-11-07T05:31:56Z",
"epaCertificationType": "<string>",
"epaCertificationNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
],
"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 a work order's labels
Replaces the full set of labels on a work order 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 own catalog; unknown or cross-tenant ids are rejected with 400. The write is gated by the work order write permission: a key that can only read the work order gets 400. On an unassigned work order, only a facility with read-write visibility may label it; bidders and read-only facilities get 400. An unknown, deleted, or foreign work order 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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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/work_order/work_orders/{woId}/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": [
{
"workOrderId": 123,
"workOrderLabelId": 123,
"action": "added",
"isActive": true,
"createdBy": "<string>",
"createdAt": "<string>",
"id": 123,
"workOrderLabel": {
"label": "<string>",
"associatedWorkOrdersCount": 123,
"isDeleted": true,
"id": 123,
"color": "<string>",
"buyerCompanyId": 123,
"supplierFacilityId": 123,
"createdBy": "<string>",
"createdAt": "<string>",
"updatedBy": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>"
},
"createdByContact": {
"email": "<string>",
"nameGiven": "<string>",
"nameFamily": "<string>",
"contactType": "<string>",
"title": "<string>",
"department": "<string>",
"facilityId": 123,
"isSharedContact": true,
"readOnlyAccess": true,
"invitedByEmail": "<string>",
"invitedAt": "2023-11-07T05:31:56Z",
"epaCertificationType": "<string>",
"epaCertificationNumber": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
],
"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
Work order 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.
Response
Success. Returns the label mappings now active on the work order.