API call response

HI Experts,

when we do APi calls from powershell, We see issue intermittent like 504 (Gateway Timeout). it seems this error happens because of delay in response from the server than expected… how can we fix this because we have customized powershell scripts to do APIs…

Hi @chandramohans27 , I believe the error is coming from within the customer network. Did you already check with your network/firewall team?

Also, I hope you have whitelisted the target url that you are trying to hit from the server hosting your custom PowerShell script.

Hi @gauravsajwan1

I see this error intermittently for few minutes… Later it worked… You mean to say the network could have been not stable, so this need to be addressed with network team.

Yes since the server where your PowerShell script is running is within customer network, it’s always good to validate the firewall rules are properly placed + network connectivity is working fine, as it can be a problem if it happens in Production with intermittent behavior.

Also, increasing timeout + adding retries on your API call is another option worth trying if it resolves.

2 Likes

Agree with this being “standard error handling” which many of us (me included) don’t always include in our PowerShell scripting assuming things are ALWAYS going to work as expected.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.