Uploading assets to the library

Creating an asset

To retrieve the Enterprise volume details, use the following Content Metadata Service (CMS) API call:     

API

GET: /instances/folder/ccmapp_enterprise_volume?sortby=create_time desc

The API call returns a response that is similar to the following: 

Response

{
    "_embedded": { 
        "collection": [ 
            { 
                "id": "0f7066e8-f441-423e-8140-01bcdbb32c70", 
                "create_time": "2024-04-04T06:06:50.418Z", 
                "update_time": "2024-04-04T06:06:50.418Z", 
                  ...... 
        }] 
    } 
}

The property ID in the response is the Enterprise volume ID and it is used in the next API call.

To retrieve the digital asset library folder that is present in the Enterprise volume, use the following CMS API call:

The digital asset library folder is created as part of the OpenText Core DAM tenant onboarding process and is located in the Enterprise volume in Content Metadata Services (CMS) .

API

 GET: /instances/folder/cms_folder/{{enterprise_volume_id}}/items?filter=name like 'Digital asset library'

The API call returns a response that is similar to the following:

Response

{
    "_embedded": {
        "collection": [
            {
                "id": "50a240af-3c0a-4c4d-91c6-2324ecddabd6", 
                "create_time": "2024-04-04T06:06:50.418Z", 
                "update_time": "2024-04-04T06:06:50.418Z", 
                  ...... 
        }] 
    } 
}

The property ID in the response is the digital asset library folder ID.  

To create an asset under the digital asset library folder, use the following CMS API:

API

POST: /instances/file/{{document_type}}

The {{document_type}} in the URL is the system name of the document type. The pre-created document type name is “ccm1_dam_brand_assets”. 

The request payload content type is the application/json with valid asset details.

Request body

{ 
    "name": "abc.jpg", 
    "description": "sample upload", 
    "renditions": [{"blob_id":"{{blob_id}}",  
        "rendition_type":"primary", 
        "name":"my content file", 
        "source": "FILE_ID" 
        } ],
    "parent_folder_id":"{{parent_folder_id}}", 
    "traits": { 
        "ccm1_dam_dimensions": { 
            "ccm1_dam_dimensions": {} 
        }, 
        "ccm1_dam_product_information": { 
            "ccm1_dam_product_information": {} 
        }, 
        "ccm1_dam_media_analysis": { 
            "ccm1_dam_media_analysis": {} 
        }, 
        "ccm1_dam_rights": { 
            "ccm1_dam_rights": {} 
        }, 
        "ccm1_dam_file": { 
            "ccm1_dam_file": {} 
        }, 
        "ccm1_dam_business": { 
            "ccm1_dam_business": {} 
        } 
    } 
}  

The {{blob_id}} in the request body is the ID of the content that is returned when the file is uploaded using CSS. The {{parent_folder_id}} is the ID of the digital asset library folder or the ID of any other folder that is present under the digital asset library folder. 

The API call returns response that is similar to the following:

Response

{ 
    "id": "fde8cce3-348b-474f-a211-c55b09a6e026", 
    "create_time": "2024-07-03T06:40:43.272Z", 
    "update_time": "2024-07-03T06:40:43.272Z", 
    .............
}

The property ID in the response is document ID. You will use this in the next step.

 

Your Progress

Creating an asset