API triggers issue(sync long-polling): UIPath studio http activity get error message

Hello everyone,
I was using UiPath studio http activity to make a API triggers in order to request an online robot task and receive the result. But I get the error message as below. Besides, I can use Postman get the result perfectly with no error.

"message": "{\"type\":\"https://tools.ietf.org/html/rfc9110#section-15.5.2\",\"title\":\"Unauthorized\",\"status\":401,\"traceId\":\"00-2bbca4480be204f552c003c03496496c-d5a2680320b8e7cf-00\"}",

And it is important to note that the code mode is set to sync long-polling. If set to async it works well in http activity.


I am looking forward to your answer. Thanks.

Hi @donfeng91

401 error relates to unauthorized request issue. Could you please check if authorization details are being passed correctly?

As you can see below, I use the same UiPath process to run to request API trigger in which I only change the call mode.

This picture is requesting the Async polling mode. It works well.

And this picture is requesting the Sync long-polling mode. It encounters the exception.

Both process I run above didn’t change anything of the process. This is my http request configration:

This picture is that I use postman to make a request under the Sync long-polling mode and it runs perfectly.

I read the link article in the error message, but there is no help.

Probably the Require Authentication header for sync API Triggers redirects setting is enabled. Sync calls will not work when the client automatically follows redirects and this setting is enabled.