Use an alias to access the MASTER ref with the REST API

Hi there,

I've found a couple answers online, but nothing official I believe. I'm using prismic's REST API to fetch some data from our public master version (security is set to "Public API for Master only"), and you need to pass in a ref to master, which appears to be changing every time we do a release.

I saw some people recommend you always do a first query to /api and get the ref from there, but that requires an extra back-and-forth to prismic, which is wasted time for us, as we use the data to render a client-side page, and that makes the data appear late.

I was wondering whether simply using an alias, that dynamically points to the master ref on prismic's backend was something that was being considered?

Simply being able to do ref=MASTER_REF would be very helpful.

Hey Florian, at the moment, the solution you mentioned is the correct one to get the ref of your response.

Doing a query to your endpoint CDN gives you access to the ref, like so:

https://your-repo-name.cdn.prismic.io/api/v2

I will mark your thread as a feature request to be aware of your suggestion.

Thanks

This issue has been closed due to inactivity. Flag to reopen.