Hi all, running into an error i’ve not seen before.
When I call the API connector from a backend workflow and specify the parameter, it only works when the parameter in workflow = the parameter I used to initialize the call.
Any idea what I’m doing wrong?
I initialize the call by manually entering the value for parameter ‘ids’.
When I call the API connector in the backend workflow, I specify the ‘ids’ parameter, but it only works when it is specified with the parameter I used to initialize the API connector, in this example ‘ruby’. If I change the parameter in the workflow to something else, e.g ‘ethereum’ I don’t get any response from the API connector.
You can see in the logs, when parameter is set the same as the parameter used to initialize the API connector (e.g ‘ruby’) ‘test_1’ gets a value, but when I change it (e.g ‘ethereum’) it does not.
My initial reaction is that Option Sets would’t be a sustainable solution for my app since, even though ‘currencies’ is static with ‘USD’, ‘ids’ is dynamic (it can be any cryptocurrency, of which there are hundreds / thousands that get added to frequently).
It seems like there should be a better solution for this since I expected this to be a standard use case for the API connector.
I’m not well versed enough in APIs to know whether this is poor API design by Coingecko or Bubble not being robust enough.
**Response from bubble:
"It appears that the primary issue is with the how the API provider is returning data to Bubble.
For example, when getting the exchange rate between Ruby and USD the API will return the following:
{
“ruby”: {
“usd”: 0.12428
}
}
Because the API is using the name of currency as a “key” in the JSON returned, Bubble will only recognize the returned value as valid if that key matches what was there when the API was initialized.
Bubble expects that key values are not dynamic so the API would need to return a result like the example below for it to work with the API connector in its current form.
{
“exchange”: {
“currency”: “ruby”,
“compare_to”: “usd”,
“price”: 0.12428
}
}
Currently, the only work around for this would be to either use a different API provider or create a separate call for each currency that you may use."