How to set parameter from API response

Final API call looks like this:
https://nutriklinika.cdn.prismic.io/api/v2/documents/search?ref=X7T0_BIAACMArB68&q=[[at(document.type%2C+“consultant”)]]

Here q is particular query.
And ref is a string representing the required content version (master, preview, release preview, etc).

I can retrieve the master ref using the /api endpoint https://nutriklinika.cdn.prismic.io/api/v2
Screenshot 2020-11-24 175923

So first I need to get ref parameter then make an API call with this ref value.

In this case how should I set my API Connector to make my data requests?
Thank you!

Guys can anyone help?

You can embed one API call in another to add in parameters that also come from the API.