Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Retrieve asset folder metadata using Assets API

Avatar

Level 4

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?

Seek_AEM_4-1721395328887.png

Seek_AEM_0-1721395663508.png

 

 

Seek_AEM_0-1721395492357.png

 

 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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/ .

EstebanBustamante_2-1721398660888.png

 

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/adobes... 

EstebanBustamante_0-1721398412476.png

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

EstebanBustamante_1-1721398470476.png

Hope this helps

 

 



Esteban Bustamante

View solution in original post

8 Replies

Avatar

Correct answer by
Community Advisor

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/ .

EstebanBustamante_2-1721398660888.png

 

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/adobes... 

EstebanBustamante_0-1721398412476.png

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

EstebanBustamante_1-1721398470476.png

Hope this helps

 

 



Esteban Bustamante

Avatar

Level 4

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.

Avatar

Community Advisor

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

Avatar

Community Advisor

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

MukeshYadav__0-1721400454635.png

 

or 

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

Thanks

Avatar

Level 4

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.

Avatar

Community Advisor

Hi @Balaram_Rudra ,

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

MukeshYadav__0-1721544238451.png

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

MukeshYadav__1-1721544441505.png

MukeshYadav__5-1721545336361.png

 

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

MukeshYadav__6-1721545689896.png

 

MukeshYadav__4-1721545293121.png

Thank

Avatar

Level 4

Thank you for the suggestions @MukeshYadav_ , I will definitely consider them. Much appreciated

Avatar

Administrator

@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