Add an endpoint for showing the usages and supplier of image ids - #4871
Draft
lindseydew wants to merge 2 commits into
Draft
Add an endpoint for showing the usages and supplier of image ids#4871lindseydew wants to merge 2 commits into
lindseydew wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
This adds a bespoke endpoint that uses the same query params as the search API, but returns only an image id, supplier and usages to make it easier to reconcile how many images have been used as part of the quota.
The params to use the test the output are:
https://api.media.local.dev-gutools.co.uk/images-usages?q=usages@%3Eadded:2026-07-01%20usages@%3Cadded:2026-07-31%20usages@status:published&nonFree=true
A specific supplier can optionally be added:
https://api.media.local.dev-gutools.co.uk/images-usages?q=usages@%3Eadded:2026-07-01%20usages@%3Cadded:2026-07-31%20usages@status:published%20supplier:AAP&nonFree=true
This also changes the way pagination is implemented as the existing logic did not seem to be working from what I could see 🤔
At the moment this updates the
searchendpoint too, though I think it would be better to scope any changes to just this endpoint before releasingIt might be a bit of annoying user experience to have to paginate manually. A good next step could be to implement a recursive search to get all the ids and then produce a
.csvfile to download.How should a reviewer test this change?
How can success be measured?
Who should look at this?
Tested? Documented?