Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: RE: Headless API Questions/Concerns
I am attempting to flatten an API response. I am trying to get all content items under a folder as well as including content in the subfolders. The flatten parameter does not seem to work at all. It only returns the content items in the referenced folder ( 36997 ). Is there a trick to getting this to work?
http://localhost:8080/o/headless-delivery/v1.0/structured-content-folders/36997/structured-contents?flatten=true
I am also trying to see the parent folder of each of the content items, but that does not seem to be available in the structured-contents enpoint. Does anyone know how to accomplish that?
Thanks
I've just check making a test and flatten is working correctly. You just need to add the flatten query parameter with value equals true and all content items of the folders and subfolders should be listed, as you already did. Which version of Liferay are you using?
As you mention, the parent folder of a content item is not available. We can discuss it internally to check if it brings value to add it in the future.
We are currently using 7.2.10 GA1 I have tried adding the flatten query parameter to other endpoints that support it and it does not seem to be working for me on any of them. For example, Knowledge Base Articles does not work either.
http://localhost:8080/o/headless-delivery/v1.0/knowledge-base-folders/38355/knowledge-base-articles?flatten=true
Thank you for looking into the Parent Folder options, it seems that the Knowledge Base Articles make more sense for what we are trying to do and they have a parentKnowledgeBaseFolder object for each item.
I updated my local version to 7.2.10 with Service Pack 3 and I am now able to flatten the results for structured content, but I still have the issue with the above endpoint. I am not able to flatten the results for knowledge-base-articles that are under a specific root folder.
Ok, I've reproduce it and in the case of Knowledge Base Articles seems like a bug to me. I'll open a ticket describing it and try to fix it as soon as we can
Thanks. Would you like us to open a ticket from our end for this?
Yes, please. Better if you open the ticket to provide a more detail information about the situation and environment you had.
Thank you very much and sorry for the inconveniences
Powered by Liferay™