Link a label to an element
curl --request POST \ --url https://api.whatsbuilt.fi/v1/projects/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/labels/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/assign \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "element_global_id": "example", "move": true }'For a label on no element, or one whose element was deleted from the project. A label on another element answers 409 CONFLICT unless move is true, which moves it as the app does. A retired label answers 409 LABEL_RETIRED. An element carries one label: a second answers 409 ASSET_ALREADY_LABELLED. Needs the admin role, or the inspector role where the project lets inspectors link labels (403 LABEL_LINK_NOT_ALLOWED).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The label’s id
Request Bodyrequired
Section titled “Request Bodyrequired”The body of assignLabel.
object
The element.
True moves a label that is on another element, as the app does; default false answers 409
Example generated
{ "element_global_id": "example", "move": true}Responses
Section titled “Responses”The label
A live label.
object
The label.
The project.
The GS1 GIAI printed in the QR code
The short code printed under the QR code
The GS1 Digital Link the QR code holds
The element the label is on; null while unassigned or retired
assigned and active are both in use; active once scanned. New statuses may come.
When it was put on its element.
Its first scan.
When it was minted.
The row’s change time.
Example
{ "status": "unassigned", "deleted": false}Invalid body, parameters or Idempotency-Key
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}Missing, malformed, expired or revoked token
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}INSUFFICIENT_SCOPE; INSUFFICIENT_PROJECT_ROLE when the project role the scopes give does not cover the write, or the project is not the integration’s; PUBLIC_API_DISABLED when the project’s owning organisation has turned the API off
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}No such project, label or element
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}ASSET_ALREADY_LABELLED, LABEL_RETIRED, or the label is on another element
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}IDEMPOTENCY_KEY_REUSED: the key was used with another body
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}RATE_LIMITED; wait for Retry-After seconds
The error body of every /v1 answer of 400 or more.
object
A sentence for people; it may change
Part of the contract
What the code names, where it names something
The X-Request-Id of the call
Example generated
{ "error": "example", "code": "example", "details": "example", "request_id": "example"}