Skip to main content

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

  1. Call Photo API with GET /v2/photos to query every photo object in the environment

    1. retrieval limitation (10,000 items) need to batch GET query.

  2. 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.

  3. Filter response for only empty arrays

    1. If the photo is not being used, then it returns an empty object like this:

    2. {"references":[],"count":0}

  4. Save the photoID/photoURL to reference of photos were deleted

  5. 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.

  6. 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.

More information