Variations API

Provides operations on OMN asset variations.

Retrieve variations

/dam/assets/variations/retrieve Retrieves asset variations.

Variation object represents link between assets.

Table 1. Details

Resource path

/api/core/v1/dam/assets/variations/retrieve

HTTP method

POST

Request content type

application/json

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Body parameters

Specified by VariationRequest

Return Type

OmnType with filled VariationsType. More info VariationType

Responses
Table 2. Http response codes
Code Message Datatype

200

OmnType with list of asset variations

OmnType

500

Error in ResponseType

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
Get asset variations
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/variations/retrieve' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "assetPaths": ["/MAM/demo/copies/tempAR/pcUXFux_77I.jpg", "/MAM/demo/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500_print_variation.jpg"]
}'

Request body examples:

By assets ids
{
    "assetIds": [12333]
}
By assets tids
{
    "assetTids": ["38043B75-5BB3-44CE-AFD1-401503C6F322"]
}
By assets paths
{
  "assetPaths": ["/RNC/Dir1/Dir2/file.jpg"]
}
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-09-01T11:41:47.507Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <variations>
        <variation assetId="86430" assetTid="DB32DAAC-6A80-4BEB-A09C-C020CA941F4E"/>
        <variation assetId="87960"
                 assetTid="C6E3F14B-092A-4267-9A5D-C16FE4295DC3"
                 parentTid="DB32DAAC-6A80-4BEB-A09C-C020CA941F4E">
            <meta>
                <itm key="variationType">Print</itm>
            </meta>
        </variation>
        <variation assetId="87961"
                 assetTid="11319367-DE26-4FB8-9148-3C341766C1BA"
                 parentTid="C6E3F14B-092A-4267-9A5D-C16FE4295DC3">
            <meta>
                <itm key="variationType">Print</itm>
            </meta>
        </variation>
    </variations>
</pim>

Retrieve variation types

/dam/assets/variations/types Retrieves asset variation types.
Table 3. Details

Resource path

/api/core/v1/dam/assets/variations/types

HTTP method

GET

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Return Type
Responses
Table 4. Http response codes
Code Message Datatype

200

OmnType with filled VariationTypesType

OmnType

400

Invalid input provided

ResponseType

401

Not authorized

ResponseType

404

Not found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
Request examples
curl --location --request GET 'http://<OMN_SERVER>/api/core/v1/dam/assets/variations/types' \
--header 'Authorization: Bearer <TOKEN>' \
--data-raw ''
Response example
<?xml version="1.0" encoding="UTF-8"?>
<pim xmlns="http://www.apollon.de/omn">
    <variationTypes>
        <variationType tid="Print"/>
    </variationTypes>
</pim>

Upload as Variation

/dam/assets/variations/bin/persist Upload file as variation to the system.
Table 5. Details

Resource path

/dam/assets/variations/bin/persist

HTTP method

POST

Request content type

multipart/form-data

Response content type

  • application/xml; charset=UTF-8;

  • application/json

  • application/json+compact

Form Parameters
AssetVariationUploadRequest.tid should be provided to the OMN asset.
Name Description Required

params

Upload parameters AssetVariationUploadRequest

X

payload

Blob file

X

Return Type

PimType with filled ResponsesType

Response type contains status and info about uploaded asset variation.

Responses
Table 6. Http response codes
Code Message Datatype

200

PimType with filled ResponsesType

PimType

400

Invalid input

ResponseType

404

The requested resource could not be found

ResponseType

500

An unknown internal error occurred

ResponseType

Samples
Please use transform endpoint to get the JSON/compact-JSON samples from the XML one.
1. Upload a file as variation
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/variations/bin/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'payload=@"/<FILE_PATH>/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500.jpg"' \
--form 'params="{
    \"tid\":\"52F78637-63AE-4F3E-8D4B-664E070C6AB8\",
    \"variationType\": \"Print\"
}";type=application/json'
Request body AssetUploadRequest
{
    "tid": "52F78637-63AE-4F3E-8D4B-664E070C6AB8",
    "variationType": "Print"
}
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-07-16T09:30:46.743Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="variation"
                tid="52F78637-63AE-4F3E-8D4B-664E070C6AB8"
                action="update">
            <status>SUCCESS</status>
            <description>Asset variation has been created</description>
        </response>
    </responses>
</pim>
2. Upload a file as variation with specified name
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/dam/assets/variations/bin/persist' \
--header 'Authorization: Bearer <TOKEN>' \
--form 'payload=@"/<FILE_PATH>/artworks-bQbImNIL55TZ52he-gAKJ7w-t500x500.jpg"' \
--form 'params="{
    \"tid\":\"52F78637-63AE-4F3E-8D4B-664E070C6AB8\",
    \"variationType\": \"Print\",
    \"variationFileName\": \"assetVariation.png\"
}";type=application/json'
Request body AssetUploadRequest
{
    "tid": "52F78637-63AE-4F3E-8D4B-664E070C6AB8",
    "variationType": "Print",
    "variationFileName": "assetVariation.png"
}
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-07-16T09:30:46.743Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="variation"
                tid="52F78637-63AE-4F3E-8D4B-664E070C6AB8"
                action="update">
            <status>SUCCESS</status>
            <description>Asset variation has been created</description>
        </response>
    </responses>
</pim>
Error response
No access to the asset
<?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-07-16T09:45:15.768Z</itm>
        <itm key="sourceEnv">web</itm>
    </meta>
    <responses>
        <response dataType="variation"
                tid="52F78637-63AE-4F3E-8D4B-664E070C6AB8"
                action="update">
            <status>ERROR</status>
            <description>Asset is not available by access rights</description>
        </response>
    </responses>
</pim>

Welcome to the AI Chat!

Write a prompt to get started...