API only returns entities for subfolders, not assets | Community
Skip to main content
December 12, 2020
Solved

API only returns entities for subfolders, not assets

  • December 12, 2020
  • 1 reply
  • 970 views

GET http://host:port/api/assets/myfolder.json 

Returns an object that contains "entities", an array of objects where each is a folder within "myfolder"

But when I do the same for a folder that contains assets...

GET http://host:port/api/assets/myfolder/mysubfolder.json  

There is no "entities" key at all.

"properties" is there (as well as "links", "class", and "actions"), and this contains paging information that shows me that there's something there ("total" > 0), plus I have links for "next" (and "previous" if I follow a "next" link), but I don't actually get the entities listing.

Note: on the web interface, every asset has a flag that says "REQUIRED METADATA MISSING". Would this be why they are excluded from the API? Can that be changed?

Note: I am a beginner with only 1 hour of experience with AEM! Just trying to do a simple integration with a project management app. Thanks!

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 shelly-goel

Hello@quarfie 

Yes there would be metadata schema applied on the assets folder which is validating if all the assets have mandatory metadata fields in it or not and displaying the flag. A property "hasValidMetadata" would be added to "jcr:content" of assets which is used to filter the invalid assets in a search result.

You can navigate to a specific asset's properties and add the missing mandatory metadata. You can also check which metadata schema is applied to the Asset's parent folder and navigate to Tools > Assets >  Metadata Schema Forms and see those properties configured as mandatory.

Please refer here: https://experienceleague.adobe.com/docs/experience-manager-65/assets/administer/metadata-schemas.html?lang=en#define-mandatory-metadata

1 reply

shelly-goel
Adobe Employee
shelly-goelAdobe EmployeeAccepted solution
Adobe Employee
December 14, 2020

Hello@quarfie 

Yes there would be metadata schema applied on the assets folder which is validating if all the assets have mandatory metadata fields in it or not and displaying the flag. A property "hasValidMetadata" would be added to "jcr:content" of assets which is used to filter the invalid assets in a search result.

You can navigate to a specific asset's properties and add the missing mandatory metadata. You can also check which metadata schema is applied to the Asset's parent folder and navigate to Tools > Assets >  Metadata Schema Forms and see those properties configured as mandatory.

Please refer here: https://experienceleague.adobe.com/docs/experience-manager-65/assets/administer/metadata-schemas.html?lang=en#define-mandatory-metadata