Is there anyway to achieve this functionality with the API. As seen on the app.contentful platform.
In other words does the API expose the links on a given media asset. Similar to the “There is one entry that links to this asset” section of the web app.
To search for entries which have a field linking to a specific entry…
I’m not looking for anything specific. I’m just trying to determine what, if any linked entries are attached to a given asset. In other words, can the "{entry_id}" be left empty to return all the entries that link to the asset. I’m trying to replicate what we see on the contentful web app.
Ultimately what I’m trying to do is remove all the assets in the Media area that are not in use (linked to an entry). The only way to do this currently, is by manually clicking each asset and seeing if the link icon is present.
Just get all your asset IDs and iterate through the list and for each make a CDA query using the links_to_asset search parameter and make note of all the responses where “total” is 0. The response will look like this:
That’ll produce a list of asset IDs that have no entries linking to them (aka assets that you aren’t using anywhere). Then you can iterate through this unused assets list and delete each one.
Ahh ok. So if you have thousands of assets and thousands of entries its gonna take millions of queries? Definitely the only way of doing it? Is there a way to expose this on the front end contetnful web app. Potentially showing a column for links?