Skip to content

Getting started

This guide will help you get started with using DAM. By the end of the guide, you will have uploaded a file, transformed it, and retrieved a cacheable URL from the API.

The guide can be followed with associated code examples from our GitHub repository, which you will find here.

Setup environment

The first thing to do is set up a local Bizzkit development environment. A detailed guide for doing this can be found here.

Note

DAM has some limitations when running in a local Docker environment which can be found here.

Uploading a file

Upload some product images to the root folder by pressing the 'UPLOAD' button. In this guide, we will upload a single image file.

Note down the file ID after uploading, which you can see on the right side after selecting your file. Example below:

File overview.

Retrieving a file

Let's use the API to retrieve a URL for the image we uploaded, and at the same time do some ad-hoc transformation:

For the full code example, click here.

  1. Go to https://localhost:8012/swagger/index.html or where you might access the DAM API.
  2. Authorize
  3. Go to POST: /api/{culture}/files/cache/details and send a request with the following body:

    [
      {
        "fileId": "ee357c6c-06c9-4de7-9988-be704f02ee59",
        "transformation": "ResizeToCanvas",
        "allowWhitespaceExpansion": false,
        "allowEnlarge": false,
        "height": 400,
        "width": 400
      }
    ]
    

Note

Your fileId will be different from the one in the request above.

You should get a fileUri which can be used to retrieve the file, alongside some meta information for the transformed file.

[
  {
    "status": "Success",
    "cachedFileDetails": {
      "fileUri": "http://localhost:10000/devstoreaccount1/dam-cache/19/38/1d3a-dda8-4b58-9308-252c4e6f8486/eco-tote-bag-oyster-back-63e4a955b0025.png?v=638181930020000000",
      "fileName": "eco-tote-bag-oyster-back-63e4a955b0025.png",
      "height": 400,
      "width": 400,
      "cachedFileInfo": {
        "fileId": "ee357c6c-06c9-4de7-9988-be704f02ee59",
        "croppingId": null,
        "imageType": null
      }
    }
  }
]

Important

In a real production environment you would rely on precached transformations, instead of the ad-hoc transformation we did here, to speed up response times. For more related to predefined settings, click here.

In addition, do not cache the fileUri for a long period since it can change.

Next steps

This guide introduced you to the key functionality of DAM, which is uploading files, transforming them, and generating URLs. However, DAM has a lot more to offer than just that, so we recommend you check out our tutorials, how to's, concepts and user guide to gain even more knowledge about Bizzkit DAM.