I’m exploring the UiPath Apps functionality and building a small app.
The app is a dashbord to view and interact with Orchestrator through the Orchestrator REST API.
One simple function I try to achieve is to list all the available folders in the tenant by using the REST API endpoint: https://cloud.uipath.com/zzzzzz/DefaultTenant/orchestrator_/odata/Folders
First I have tested the REST API both with Swagger and Postman, and the call to the endpoint works just fine. I have created a PAT to authenticate without any problems.
Then I built a connector against the REST API with Connection Builder in the Integration Service, published it and connected it with my PAT to the service.
And finally I have built a simple app in UiPath Apps with one button and one textarea.
When the button ic clicked a call is done to my connector and the raw response is then supposed to be displayed in the textarea.
There seems to be no problem with the code and app, but when I do the call I get an exception.
And I can’t get any error message from the error object.
So my questions are:
How do I find the error message in Apps so I can display it.
Which tools do I have to check logs etc to find where and what the problem is?
And any other suggestions or ideas are welcome also!
I actually found at least one debugging option, even if it isn’t any UiPath tool/functionality.
By using the developer tools in the browser I found out that the problem probably is an authorization problem - I have an 401 response from the REST API endpoint.
Even though I have set up the PAT on the autorization tab in the connection builder it seems that I need to add the autorization with the PAT in the header of each call to the endpoints?
I thought that the whole thing with the authorization tab was that you don’t need to add in in every call?
Maybe it will work if I set it up right…
Here is the autorization parameter added to the endpoint:
The problem with the authorization in the setup of the connector is solved.
I needed to set the default value for the token and select to not ask the user for the value.
And don’t forget to add the prefix "Bearer " before your PAT!
This way the default token/PAT is used and no popup is displayed asking for the bearer.
And the following calls to the endpoint will work without any problem.
In case you have any help of this post - I will be glad if you let me know!