I have a simple API set-up, actually pointing towards httpbin. In our actual production API, I need to send an API key which is needs to be provided privately (rather than the end-user including it in their GET request).
I though this could be done via the rewrite tool in endpoint designer and although I can add content to the URL, the originaly query string keeps getting appended but preceeded with a question mark, which means that I end up with 1x question mark and then the ASCII equivalent.
You can probably do this with the rewrite, but you will need to write a capture regex that gets all of the params (including key) and then completely rewrite it with the newly captured groups.
Capturing the URL parameters is straightforward, for example - capturing everything after the “?” you can use ?(.*). The problem is that TYK is appending the original query string by default.