Retrieve asset folder metadata using Assets API | Community
Skip to main content
Level 4
July 19, 2024
Solved

Retrieve asset folder metadata using Assets API

  • July 19, 2024
  • 3 replies
  • 2122 views

I have added metadata to a folder on DAM by using a custom folder metadata schema. However, I am unable to retrieve the information back using the assets API. Doesn't work even with /jcr_content/metadata in the API path. Is it possible to retrieve it using Assets API at all? and how?

 

 

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

Hi, 

Correct, the Assets API won't return custom metadata. If you are using AEMaaCS, I would recommend exploring the new sets of API for Assets, which it seems could work for your use case: https://developer.adobe.com/experience-cloud/experience-manager-apis/api/experimental/assets/author/ .

 

If you are using AEM on-premise,  you could simply rely on the HTTP API, something like this would work:

Asset Path: http://localhost:4502/assetdetails.html/content/dam/wknd-shared/en/adventures/cycling-tuscany/adobestock-59459597.jpeg 

Metadata access: http://localhost:4502/content/dam/wknd-shared/en/adventures/cycling-tuscany/adobestock-59459597.jpeg/jcr:content.3.json 

Hope this helps

 

 

3 replies

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 19, 2024

Hi, 

Correct, the Assets API won't return custom metadata. If you are using AEMaaCS, I would recommend exploring the new sets of API for Assets, which it seems could work for your use case: https://developer.adobe.com/experience-cloud/experience-manager-apis/api/experimental/assets/author/ .

 

If you are using AEM on-premise,  you could simply rely on the HTTP API, something like this would work:

Asset Path: http://localhost:4502/assetdetails.html/content/dam/wknd-shared/en/adventures/cycling-tuscany/adobestock-59459597.jpeg 

Metadata access: http://localhost:4502/content/dam/wknd-shared/en/adventures/cycling-tuscany/adobestock-59459597.jpeg/jcr:content.3.json 

Hope this helps

 

 

Esteban Bustamante
Level 4
July 21, 2024

Thank you @estebanbustamante. I was hoping that I could still access the metadata using the Assets HTTP API somehow, but no worries.

Is this something that Adobe can consider adding to the Assets API? It would make sense for the Assets API to return folder metadata as well, as the API client can then determine how to process the assets under the folder according to the data on the folder metadata.

EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
July 22, 2024

As far as I heard, they are not putting more effort into the Asset API but the preferred one would be these: https://developer.adobe.com/experience-cloud/experience-manager-apis/api/experimental/assets/author/. So hopefully you can stick to that. 

Hope this helps

Esteban Bustamante
MukeshYadav_
Community Advisor
Community Advisor
July 19, 2024

Hi @balaram_rudra ,

To be more precise just you need to append a selector e.g. 1 to your metadata which you were trying. It will work.

We can hit http://localhost:6502/content/dam/Seek_AEM_4-1721395328887.png/jcr:content/metadata.1.json

 

or 

We can get via servlet/model https://www.linkedin.com/pulse/get-asset-meta-data-from-node-aem-keshav-chaurasiya

Thanks

Level 4
July 21, 2024

Thank you @mukeshyadav_ , however, I was looking more towards the Assets HTTP API for this as my solution is relying already on it for the rest of the assets data.

MukeshYadav_
Community Advisor
Community Advisor
July 21, 2024

Hi @balaram_rudra ,

As mentioned in limitation https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/assets/admin/mac-api-assets

However not sure about your use case, but work around can be if we move those custom properties to asset level instead of folder level.

We are able to fetch asset level metadata via asset api

 

OR if you add custom property at jcr:content of folder itslef then it is accessible via assetapi

 

Thank

kautuk_sahni
Community Manager
Community Manager
July 23, 2024

@balaram_rudra Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Kautuk Sahni