Expand my Community achievements bar.

SOLVED

API only returns entities for subfolders, not assets

Avatar

Level 1

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!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

1 Reply

Avatar

Correct answer by
Employee Advisor

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