I have used the ‘Orchestrator HTTP Request’ activity to get the access token. I have put the token request into a jsonPayload. Then we used ‘HTTP Request’ activity and provided the access token which we obtained by the earlier activity, in OAuth2Token field and also provided the required API Endpoint.
But running the bot, we are getting the error saying “You are not authenticated” even though access taken is being provided.
If anyone of you faced the same type of error and has the solution , kindly help me in resolving this issue.
Hey @Mattapalli_Kiran, Welcome to forum.
Are you passing the headers in the request?
Also, Can you please check below link:
Hi @Mattapalli_Kiran ,
Make sure that you are entering token with the bearer text in the Authorization parameter like below. thanks.
Authorization → Bearer+YourToken
yes, I have passed the headers in jsonPayload but still facing the same error, "You are not authenticated " with Status code: 403
‘Authorization’: ‘Bearer " + in_auth2_token + "’,
yes, I have passed the header through jsonPayload as below.
‘Authorization’: 'Bearer " + in_auth2_token + " ',
Did you checked this ? Coz it is working fine for me using below documentation.
Also, please have a look at below link.
Hi @Mattapalli_Kiran ,
ok i understood that you are using orchestrator Http request to authenticate with your orchestrator by sending parameters as json payload. i assume that you are successfully authenticated with orchestrator and received token.
Now you are using normal http request activity using some orchestrator services by passing your bearer token. is my understanding correct.
In this case while using http request activity select authentication none and pass the below parameters as parameters not in the json body directly. please try and let us know. thanks
X-UIPATH-TenantName → your orchestrator tenant name
Authorization → Bearer + Your token
Yes,I have checked.
I am using the API ( /odata/AuditLogs/UiPath.Server.Configuration.oData.Reports ) for downloading the audit report . All other api s were working fine but using this api still showing the same error saying "You are not authenticated "
Welcome to forums
I believe if you are using HTTP Request activity then you have to pass the cloud url as mentioned in the documentation, also you need to get the access token
If you are using Orchestrator HTTP Request then no need of cloud url and access token to generate, because it is already connected to orchestrator
Hope this may help you
Thanks for the reply and
yes, your understanding is exactly correct.
And , I have tried your suggested way by giving the parameters . But , unfortunately still facing the same error.
I could get the audit report without any issues. Can you please check whether you have tried it the below way?
- Get access token with “HTTP Request” activity, deserialize and assign the token to a variable (eg: access_token). Make sure you are using Client_ID and User_Key to authenticate in Studio if it’s cloud orchestrator.
Reference : Consuming Cloud API (uipath.com)
- Use the same activity for the API calls.
End point : “https://cloud.uipath.com/<account_name/<tenant_name>/odata/AuditLogs/UiPath.Server.Configuration.OData.Reports”
Body format : application/json
Headers: as below
Define Result & Status also as required (eg: outAudit,outStatus).
Write the result value of above HTTP directly to a csv file using Write Text File. No need of deserialization as it returns a CSV containing the data.
Sample output received.
Haven’t tried with “Orchestrator HTTP Request” activity. Let me know if it’s helpful.
is there any demo to download the audit report please