documentation
documentation copied to clipboard
[Bug]: How do collection types get media data?
Link to the documentation page or resource
https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html
Describe the bug


Why is there no media data?
How do I get media data?
Additional context
No response
Suggested improvements or fixes
I want to get complete data through API
Related issue(s)/PR(s)
No response
Hello @milerL and thank you for opening this issue.
Have you tried populating the fields you're looking for? As mentioned in the introduction of this documentation, media fields are not populated by default as of Strapi v4.
By the way we are reworking this part of the documentation, so any feedback on it is appreciated :-)
Hi @milerL, following up quickly. The correct structure to populate the media is like this:
GET http://localhost:1337/api/htmls/1?populate=avatar
where avatar
is the name of the media field in the Content Manager. Since the issue has not had any responses for more than 2 months I will close it, but please feel free to comment or open a new issue at any time.