Links API
Provides operations on OMN links.
Persist links
| /common/links/persist Create links between OMN objects (Assets, Products, Projects) |
Resource path |
/api/core/v1/common/links/persist |
HTTP method |
POST |
Request content type |
|
Response content type |
|
Return Type
PimType with filled ResponsesType
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
PimType with list of ResponseTypes |
|
500 |
An unknown internal error occurred |
Samples
| Please use transform endpoint to get the JSON/compact-JSON samples from the XML one. |
1. Link single asset to single product
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<links>
<itms type="assetToProduct">
<itms type="Main_Image">
<itm key="assetTid">assetTid1</itm>
<itm key="productTid">productTid1</itm>
</itms>
</itms>
</links>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itm key="productTid">productTid1</itm>
<itm key="assetTid">assetTid1</itm>
<itm key="linkType">Main_Image</itm>
</details>
</response>
</responses>
</pim>
2. Link single asset to single product by id
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<links>
<itms type="assetToProduct">
<itms type="Main_Image">
<itm key="assetId">1</itm>
<itm key="productId">2</itm>
</itms>
</itms>
</links>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itm key="productTid">productTid3</itm>
<itm key="assetTid">assetTid3</itm>
<itm key="linkType">Main_Image</itm>
</details>
</response>
</responses>
</pim>
3. Link multiple assets to single product
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<links>
<itms type="assetToProduct">
<itms type="Main_Image">
<itms type="assetTid">
<itm>assetTid1</itm>
<itm>assetTid2</itm>
</itms>
<itm key="productTid">productTid1</itm>
</itms>
</itms>
</links>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itms type="assetTid">
<itm>assetTid1</itm>
<itm>assetTid2</itm>
</itms>
<itm key="productTid">productTid1</itm>
</details>
</response>
</responses>
</pim>
4. Link single asset to multiple products
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<links>
<itms type="assetToProduct">
<itms type="Main_Image">
<itm key="assetTid">assetTid1</itm>
<itms type="productTid">
<itm>productTid1</itm>
<itm>productTid2</itm>
</itms>
</itms>
</itms>
</links>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itm key="productTid">productTid1</itm>
<itm key="assetTid">assetTid1</itm>
<itm key="linkType">Main_Image</itm>
</details>
</response>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itm key="productTid">productTid1</itm>
<itm key="assetTid">assetTid2</itm>
<itm key="linkType">Main_Image</itm>
</details>
</response>
</responses>
</pim>
5. Link multiple assets to multiple products
Request body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<links>
<itms type="assetToProduct">
<itms type="Main_Image">
<itms type="assetTid">
<itm>assetTid1</itm>
<itm>assetTid2</itm>
</itms>
<itms type="productTid">
<itm>productTid1</itm>
<itm>productTid2</itm>
</itms>
</itms>
</itms>
</links>
</pim>
Response body
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itm key="productTid">productTid1</itm>
<itms type="assetTid">
<itm>assetTid1</itm>
<itm>assetTid2</itm>
</itms>
<itm key="linkType">Main_Image</itm>
</details>
</response>
<response dataType="link" action="create">
<status>SUCCESS</status>
<description>The link has been saved successfully</description>
<details>
<itm key="productTid">productTid1</itm>
<itms type="assetTid">
<itm>assetTid1</itm>
<itm>assetTid2</itm>
</itms>
<itm key="linkType">Main_Image</itm>
</details>
</response>
</responses>
</pim>
Error responses
1. Asset not found: There is no asset(s) with provided identity / tid
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" id="1">
<status>ERROR</status>
<description>Asset not found</description>
</response>
</responses>
</pim>
2. Product not found: There is no product(s) with provided identity / tid
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" id="2">
<status>ERROR</status>
<description>Product not found</description>
</response>
</responses>
</pim>
3. Attribute not found: There is no attribute with provided identifier
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" tid="Main_Image">
<status>ERROR</status>
<description>Attribute not found</description>
</response>
</responses>
</pim>
4. Asset is not available by access rights: Asset(s) has/have been restricted by access rights
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" tid="assetTid">
<status>ERROR</status>
<description>Asset is not available by access rights</description>
</response>
</responses>
</pim>
5. Product is not available by access rights: Product(s) has/have been restricted by access rights
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" tid="productTid">
<status>ERROR</status>
<description>Product is not available by access rights</description>
</response>
</responses>
</pim>
6. Asset has been already linked to the product: Product already has provided asset(s) in linked assets
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" tid="productTid1">
<status>ERROR</status>
<description>Asset has been already linked to the product</description>
<details>
<itm key="assetTid">assetTid1</itm>
<itm key="productTid">productTid1</itm>
</details>
</response>
</responses>
</pim>
7. Product attribute cardinality has been exceeded: Product attribute configured cardinality is less than it will be after linking asset(s)
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn" schemaVersion="5.6.0">
<meta>
<itm key="messageType">request</itm>
<itm key="messageTime">2022-06-14T14:34:40.177Z</itm>
<itm key="sourceEnv">web</itm>
</meta>
<responses>
<response dataType="link" action="create">
<status>ERROR</status>
<description>Product attribute cardinality has been exceeded</description>
<details>
<itms type="assetTid">
<itm>assetTid1</itm>
<itm>assetTid2</itm>
</itms>
<itm key="productTid">productTid1</itm>
</details>
</response>
</responses>
</pim>