Auto-populating query base URL from API connection #19295
Unanswered
dulle90griet
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I've searched and don't believe I've seen this asked before.
When using AWS API Gateway, created APIs receive a URL in the format
https://<API-ID>.execute-api.<REGION>.amazonaws.com, where<API-ID>is an alphanumeric string of 10 characters. If, as I do, you have reason to keep destroying and recreating your API fairly frequently, the API id keeps changing, effectively meaning that the base URL of your API connection also keeps changing.Once an API Connection has been created in Budibase and the user clicks through to the API Editor, the query path field requires that the base URL be repeated in full. If the user simply selects e.g.
GETas the method and provides "/client" as the path, the 'Send' and 'Save' buttons will remain greyed out. Clicking the globe icon at the right-hand side of that field, and then clicking again on 'Connection base URL' in the tooltip menu that appears, will auto-complete the path field with the base URL.But this is barely better than having to go through your queries one by one, copying and pasting the new base URL into each. My API Connection has 34 queries; updating the base URL each time would take 4 clicks per query (1. select query; 2. click globe; 3. click connection base URL; 4. save), or 136 in total.
Is there a way I'm missing of using a built-in binding to reference the base URL of the present connection?
Further detail that may be worth moving into an issue:
Until now I've solved this by setting a static variable,
base, in the API Connection setup, and referencing it as{{ base }}in the query path field. That way I only have to update one field each time the API Gateway API id changes.This has been my solution for several months. But at some point in the past 6-7 hours it has stopped working, I speculate due to this fix or one related to it. Now, this approach triggers an
originError.Strangely, replacing the entire base URL with a single static variable and binding (i.e.,
{{ baseURL }}/clientrather thanhttps://{{ base }}.execute-api.eu-west-2.amazonaws.com/client) does not raise the error, and allows 'Send' and 'Save' to be used. This is odd on two counts: firstly, because it didn't use to work (when I initially adopted the{{ base }}approach in early 2026, I did so precisely because any path that didn't start with an explicit "https://" and didn't generally look like an explicit URL would leave 'Save' and 'Send' greyed out); and secondly because it would seem to risk the injection of an entire URL rather than just one part of it.All reactions