POST API call completed successfully, but I'm not getting a response in retool

I'm calling the Xero Accounting API to add a bunch of manual journals.

In the latest case, the query ended up returning "Unexpected error occurred while running query" after 480 seconds. However, when I look at the API history on the Xero side, I see the call completed in just over a second (see screenshot below). And the journals were successfully inserted into Xero.

This sort of behaviour has been happening whenever I do PUT or POST calls to the Xero API. GETs work fine. Other APIs (eg HubSpot) are working fine as well.

I'm at a lost for what is going on - hopefully someone can help?

Same issue to me, API call succeeded, but no response body in Retool editor.

Glad to see I'm not the only one!

I can also add that I can run the same api calls via Xero's "API explorer" and I get (almost) instant responses (https://api-explorer.xero.com/)

True, I can run API call in Retool query library and get response, but when run same query to same end point in editor panel, the response body show Null :joy:

Hey folks! Are you running into this error consistently when hitting this particular endpoint?

Hi Kabirdas,

Yes it's just the xero end point (https://api.xero.com/api.xro/2.0/), and it's just POST and PUTs

Cheers

And yep its everytime :wink:

Sorry for the late reply here @maxamillian, took me a bit to set up and attempt to reproduce the behavior. The PUT requests I'm sending seem to return properly though so I imagine I'm missing something from your setup:

If you run the query with the example data from xero do you see the same issue? There have been a couple releases since you mentioned the behavior so it's also possible that it was fixed in the interim but in case it hasn't been, any other additional information you can provide about your setup would be much appreciated!

Still very slow / timing out for me.

For example, I sent just ONE invoice today and it took 20 seconds to get a response via retool app, but the Xero API history told me just 219ms.

And then I did ONE invoice via the Xero API explorer and the response was pretty much instant, with the Xero API history reporting 400ms

So something seems to be stopping Retool getting a response in a timely fashion?

Sorry for delay in coming back with details. Here's an example of a post that took 70 seconds today. From Retool's Timeline:

But only took 191ms from Xero's API History:

This is a small post - 2 journals with a total of 8 line items. Usually they're bigger, and when I attempt to post a bigger journal via retool, it times out, but the post is still successful from the Xero side! When I post those bigger journals directly via the Xero API Explorer, it has no trouble dealing with it, and the response is prompt.

This is the payload (with descriptions anonymised) for this particular post:

payload.json (1.8 KB)

Still no luck using that same data :disappointed: since it looks like you both may be using the New Zealand API I'm wondering if overriding the outbound Retool region on your instance has any effect on the result. My guess would be that us-west-2 would be better ultimately but it may still be worth a try.

Even though I haven't been able to reproduce this I'll still log it as a bug for further investigation. Thanks for surfacing the issue here!

Hi Kabirdas,

Thank you for looking into it. It is a bit of a mystery eh! Ok, I'll try adjusting the region...

Kabirdas, can you please provide me with screenshots info on your Xero resource setup? Just want to double check its not something to do with that?

@Kabirdas , I've tried the region change, but to no avail. Can you please provide me with your xero resource setup so I can check if it's something to do with that? Thanks, Maxamillian

Sure thing! Here's the resource setup page:

We do have different auth methods. I'm now implementing your method, and it works! But I'm not sure why it should be any different?

I'm using a custom auth with Oauth2 (generic), whereas you're using SSO. Here is a screenshot of my setup below. The only thing I can see that might affect things is that we have different callback URLs (generated by Retool) - your method generates https://carbn.retool.com/oauth/user/redirectCallback vs mine generating https://oauth.retool.com/oauth/user/oauthcallback

I should add that I don't know a lot about these different auth methods!

In any case, it's now working satisfactorily! So thank you!




1 Like