/v1/labels/{id}/packagings (PUT)
PUT
/v1/labels/{id}/packagings
const url = 'https://example.com/v1/labels/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/packagings';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '[{"packaging_type":"example","collection":"example","material_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/labels/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/packagings \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '[ { "packaging_type": "example", "collection": "example", "material_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]'Replace the label’s entire packagings list. The body is the complete new list; rows not in the body are deleted. An empty array clears the list.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Array<object>
object
packaging_type
string | null
collection
string | null
material_id
string | null format: uuid
Examplegenerated
[ { "packaging_type": "example", "collection": "example", "material_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }]Responses
Section titled “ Responses ”The label’s packagings after replacement
Media typeapplication/json
object
items
required
Array<object>
object
id
required
string format: uuid
packaging_type
required
string | null
collection
required
string | null
material_id
required
string | null format: uuid
Examplegenerated
{ "items": [ { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "packaging_type": "example", "collection": "example", "material_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" } ]}Invalid body
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Missing or invalid bearer token
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Label not writable
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}Upstream error
Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
number
detail
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example"}