API Enhancements

This document describes API-related enhancements in Upchain 22.2. Changes that were a part of weekly updates are flagged by an asterisk(*).

Supplier

User’s organization information

Manually attached translations using the API

Follow these steps to manually attach a translation to an item using the API:

  1. Use GET /api/bom/v2/item_versions/{itemVersionId}/translations to fetch all translations associated with the item identified by the itemVersionId.
    By default, those with permission to access the item, can get all of the latest versions of translations for the specified itemVersionId. Set allVersions to true to get both the latest and earlier versions of translations.
  2. Create the new translation using POST /api/bom/v1/file-versions. Consider the following before sending the request (you will need to refer to the response payload from step 1):
Does a translation with the same file name already exist?
Yes No
a. If subCategory: USER_GENERATED, when creating the new translation, use fileId in the request payload. This adds the new version of the translation and increments the file version.
b. If subCategory: SYSTEM_GENERATED, you will receive a 409-http error code and the operation terminates without creating the translation.
a. To ensure that translations, with the same file name, associated with other items do not increment, set forceNewTranslationFile to true.

3. Attach the newly created translation from step 3 to an iteming using `POST /api/bom/v1/item-versions/{itemVersionId}/file-versions-bulk`. You can attach multiple translations to the item identified by itemVersionId.
Note: Only support is permitted to attach a translation to a Released or Released_External item. All others will receive a 403 http-error code.

You can remove translations using the following endpoints:

Restrict roles from creating new versions of released items

When POST /api/bom/v2/items is used to create a new version of a released item and the individual calling this endpoint does not have one of the permitted roles, then a 403-http error code is returned.

Required configurations

Tenant Administrators must perform the following steps:

  1. Request support to make the following tenant properties available: create.new.item.version.from.release.check and create.new.item.version.from.release.allowed.
  2. In Administration > Engineering > Tenant properties:
    1. Click Edit.
    2. For the tenant property create.new.item.version.from.release.allowed type: permitted role 1 = item type 1, item type 2; permitted role 2` = item type 2, item type 3; and so on. Separate each permission-configuration with a semicolon and separate multiple item types with a comma.
Note: Tenant Administrator’s role does not have to be configured. This role is always allowed to create new versions of all item types.

Example:
create.new.item.version.from.release.allowed : Lead Mechanical Designer = Product Structure Item, Purchased Mechanical Part; Project Manager = Product Structure Item, Purchased Mechanical Part, Electrical Package.

Clear locks using the API

Tenant Administrators can use DELETE ​/api​/lock​/v1​/item-versions​/{itemVersionId}​/locks to remove BOM-edit, edit, and check out locks for the item specified in itemVersionId.

Note: DELETE /api/lock/v1/item-versions/{itemVersionId}/locks clears an item's edit lock and the checkout lock for any associated files. If this endpoint is used for any other lock types, then an error is returned.

A 200-http response returns information about all cleared locks.