ImageKit.io updates
ImageKit.io updates
imagekit.io

Custom metadata fields for better digital asset organization in the Media Library

 

New

  

With many digital assets produced by every organization, it isn't easy to manage and search for assets just by their names. The need to have a better organization system with a controlled vocabulary is essential.

For example, you would want to associate the festival or sale with the banners you have created for your store - "Halloween", "Thanksgiving", or "Christmas". Or if you sell sports apparel on your online store, then each image could be associated with a specific brand like "Nike", "Adidas", "Puma", and so on. Or the product category associated with it "Shoe", "T-shirt", "Jogger", and so on.

Each of the above examples enforces a set of choices, the controlled vocabulary, on the data associated with a file.

ImageKit's new feature, Custom metadata fields, allows you to set up your own vocabulary and taxonomy to organize digital assets basis your organization's requirements. Instead of trying to fit these values in a file's name or folder structure, you can instead define your metadata fields, define the values they can hold, associate them with your assets as additional information, and search for them using this information.

Currently, this feature is available only via ImageKit's APIs. Through the APIs, you can -

  1. Create a custom metadata field or update or delete it in your account. You can define the field type (Text, Textarea, Number, Date, Boolean, Single-select, or Multi-select), choose if the field is mandatory or not, its range of values, and more.
{
    "name": "brand",
    "schema": {
        "type": "SingleSelect",
        "selectOptions": ["Nike", "Adidas", "Puma", "Reebok", "Asics", "Others"],
        "isValueRequired": true,
        "defaultValue": "Others"
    }
}
  1. Provide custom metadata field values associated with an asset at the time of file upload or file update.
curl -X POST "https://upload.imagekit.io/api/v1/files/upload" \
-u 'your_private_api_key:' \
-F 'file=your_file' \
-F 'fileName=red_shoe_123.jpg' \
-F 'customMetadata={"brand":"Nike", "Color":"red"}'
  1. And most importantly, search for assets using the associated custom metadata values.
curl -X GET 'https://api.imagekit.io/v1/files' \
-G --data-urlencode \
"searchQuery=\"customMetadata.brand\" IN [\"Nike\", \"Adidas\"]" \
-u your_private_api_key:

If you face any issues while using this feature or have a question or suggestion, please reach out to us at support@imagekit.io.

Note: Very soon, custom metadata fields will be available in ImageKit's dashboard. Here is a sneak peek into how custom metadata fields would look in your ImageKit dashboard!

medialibrary-custom-metadata.jpg