I tried to put a random placeholder in the value of a parameter to initialize the API call because the value will be dynamic (coming from the redirect URL after Spotify OAuth). I tried this since I couldn’t leave the field empty or the call wouldn’t initialize.
Is there a way to set this parameter dynamically in the API editor while still being able to correctly initialize the call?
I want the workflow to dynamically pull the correct authorization code when the API call is triggered, but I’m stuck on not being able to initialize the call before using the API call in the workflows.
No, there are no dynamic expression in the API connector, you need to hardcode a value to initialize for most APIs, unless the API provider has a generic value that can be used.
You do not need it to be dynamic in the API connector for it to be dynamic in the action. If it is a parameter, uncheck the box for ‘private’ and it will be available in actions to be set dynamically. If it is a JSON body value use <> and if it is a URL parameter use []…most of that information is actually in the API connector in the corresponding areas.
I ran the OAuth flow which gave me the code needed for the parameter. I tried initializing and got Status code 415. I double checked and added the headers exactly the way Spotify says to:
if you select JSON and use parameters, Bubble will encode them as JSON even if you set a different content-type. This can be avoided by using the queryst checkbox (but may not be accepted by API endpoint) and sometimes using body with key=value&key=value instead of a JSON.