Hello everyone,
I’m currently implementing a KYC sequence with an 3rd party service called MangoPay.
I’m facing an issue I’m not able to explain after having setup the API properly using POST.
When I execute a call to the POST API, I see that 2 POST calls are executed instead of 1.
I’ve tried several possibilities :
using a StateState with the format of the API result
using Group/Display with the format of the API result.
They bot work fine, except that they execute 2 calls to the API.
The only way I’ve been able to have one single call, as expected, is by retrieving one specific field (an ID created on the server API Side) from the returned result of the API. That could be ok if everything goes right in the server API side, except that if there is an error while executing the Data treatment on the API side, I would not be able to retrieve the other error messages, status etc …
It’s as if the Bubble user interface instanciates the StateStates or the Displated Group twice in run time sequence.
Does any one have encountered such a behavior using the API Connector ?
Actually, I did not really find a nice solution unfortunately. I wonder if it’s a bug I should report to bubble.
The last thing I have tried is getting the raw result of the API call with a Json text reply, but again, I’ve not been able to decode the Json text answer properly… but I think that with some perseverance I should find the right formats matching to get it right, as always with Json.
Having the same issue here. I forwarded the bug report to bubble team and Kylie tried to help me since jun 2nd without success.
Even using the next steps of the workflow with condition “only when result of api is not empty”, the API itself is being triggered a second time without any plausible cause.
~10s seconds apart and intermittently, which makes it harder to debug in backend.
Actually, it could not be triggered a second time, because I only receive one webhook to trigger it and use this action on this single workflow!!
I tried everything I could to debug it, but just couldn’t.
The api consumes a service based on gpt and it sometimes takes 10-20s to react, as it search an answer on a context with several documents.
I truly believe that it is something related to this waiting time, but could not solve the issue yet and bubble team suggested to look for a bubble expert
1 - the one I just mention above : executing the API Call in a BackEnd Workflow
2 - setting up the API Call in the API Connector to “Action” instead of “Data”. By doing this, the API call is not executed at Page Load time. The way to use it is : create an action in your workflow, and you’ll find your API Call in the list of “Plugin” actions. Then refer to the result of this action for further steps by using "Result Step 1 … " properties.
The reason why your API calls twice is due to Bubble caching your API.
Fortunately, there’s an easy fix.
Let’s assume you have an element with an API datasource called myAPI with a single parameter called parameter1.
Making a change to that API (such as removing parameter1 and adding parameter2) will cause your API to call twice. (If you check using chrome’s dev tool, you’ll still see your old parameter even though you’ve deleted it)
The reason is because your element still has your old API settings/parameters cached to it even though you have updated the API.
To fix this, you cannot simply clear your data source and update it with your new API changes. You need to completely delete your element and add a new one. (Or delete the API step if it’s a display list workflow you’re using.)
This will fix this issue.
(Bear in mind that this fix is for the specific issue I have outlined above. If your issue isn’t exactly this, then it might not fix it)
that was not my situation. i receive a webhook and it triggers a workflow where I call an API (no front-end).
i solved it by writing on the database the info from the webhook (as a queue).
then i trigger the api call once when there is a change on this thing on DB.
as far as i debugged, it seemed that the backend workflow was somehow trying to “speed up” the api call and doing the request every time a webhook arrived + when the step “API Call”, therefore calling it twice.
as this api call is paid per request, this was frustrating me a lot. however, now it is under control…
One thing I have to share… Check if you have the same call on a different point in your flow … I was researching for hours until if found, that I had the old version of the API Call still running in a different workflow that was also triggered LOL