Correlate the id of an image within the writing room and that of an URL?

Is there a way to correlate a photo's internal id used by Prismic and the info we get via the API?

For example, this image has the following URL on Prismic:

https://thirdfort.prismic.io/medias/?open=Y2JlpxAAACAAHUxI

but we can this URL from the API:


How do both correlate and is there a way to reverse engineer the URL to get the Y2JlpxAAACAAHUxI id? Or maybe a way to expose this within the API?

Hey @Kris,

This is an interesting question!

We don't have any API for the media library, and I don't know what the ID in the Media Library URL references. So, I doubt that there's any way to generate the Media Library URL.

I'll mark this as a feature request for when we revisit the Media Library.

Sam

Hey Kris,

I don't know if this answer will serve your need but there is a way for you to get the Image URL inside the writing room.

For that you just have to open the image cropper and click on the View Real Size Image button.

I'm curious though to understand a bit more about what you're trying to achieve.
Can you detail a bit your use case to see if we have a better solution for this ?

Thanks,
Renaud

I have clients that are unhappy with the search/sorting/filtering functionality within the Media Library.

I'm trying to build an internal tool to be able to display all images we have on the website and if you click on the image that'd redirect you to the image's page within Prismic.

Currently, building something like that is impossible since the image ID within the Prismic's writing room is not exposed to the Public API. Not sure why is this exactly.

Hello @kris,

You are correct, and as Sam stated earlier, it isn't possible, and I'll update our feature request tracker to your specific use case.

Thanks,
Racheal.