Deleting Unused Images in Photo Center
Summary
Here is a process in how to help determine if the image is in use and how to remove the images. This procedure does require coding several API requests.
Procedure
-
Call Photo API with GET
/v2/photosto query every photo object in the environment- retrieval limitation (10,000 items) need to batch GET query.
-
Perform a GET on the API endpoint
https://{org}.arcpublishing.com/photo/api/v2/proxies/referenced-content/{photo_ID}/The endpoint returns a json object containing the information of the references. -
Filter response for only empty arrays
- If the photo is not being used, then it returns an empty object like this:
{"references":[],"count":0}
-
Save the photoID/photoURL to reference of photos were deleted
-
Call DELETE
/v2/photos/{photoId}for photos with no related items.A photo can be deleted even if it is not unpublished. When deleting a published image in Photo Center, the system automatically un-publishes the image as part of the deletion process.
-
Validate process with a verification script (optional). If the file with the unused photoIDs was created previously, it will help in this step to perform a GET on the urls and validate a 404 response.