You are not authenticated!', 'details': 'You should be authenticated (sign in) in order to perform this operation

I’m doing API call to get the robots from cloud orchestrator but getting error You are not authenticated!', ‘details’: 'You should be authenticated (sign in) in order to perform this operation. my API call is as below,
import requests

url = ‘UiPath
access_token = ‘your-token’

set up the request headers with the access token

headers = {
‘Authorization’: f’Bearer {access_token}',
‘Content-Type’: ‘application/json’
}

make the API call with the headers

response = requests.get(url, headers=headers)

print the response

print(response.json())

As the error suggests, you need to obtain an access token by calling the authentication endpoint first. Have you done that already?

You can refer to this documentation link for details: Automation Cloud - Managing External Applications (uipath.com)

Can you please add a sample authentication request code for the same here?
i’m not getting any information on suggested link.

@swapnil.pawar you can refer here for samples: Orchestrator - Consuming Cloud API (uipath.com)

Hi, I have tried with API to send the robot logs to elastic index, logs are indexed successfully in the API call, but logs are not showing in the kibana dashboard.

Code is :
logs = response.json()
json_logs = json.dumps(logs)

//post logs into the elastic
response = requests.post(url, headers=headers, data=json_logs)

You mean the logs are succesfully uploaded to Elasticsearch but you can’t see them in Kibana? You’ve gone through the Explore page in Kibana and couldn’t see the logs you just uploaded?

Yes, I have printed the robot logs on console also, then indexed logs to elastic using the “json.dumps(logs)”, output : {‘_index’: ‘default’, ‘_type’: ‘_doc’, ‘_id’: ‘W4sXXXXXXXXX’, ‘_version’: 1, ‘result’: ‘created’, ‘_shards’: {‘total’: 2, ‘successful’: 1, ‘failed’: 0}, ‘_seq_no’: 1, ‘_primary_term’: 1}
Logs indexed successfully.

  • I’m passing the headers in API call, do we need to pass to timestamp for elastic API call?
  • Logs are not searchable on kibana discover tab, tried to refresh index but no luck.

I’m not familiar with Elastic API, you’ll probably have to go to the Elastic forums for this.

I’m using /odata/robotlogs api to get the robot logs, but in response.json I’m only getting the few columns and if export logs in csv then I am getting all the columns values :- level logger user levelOrdinal timeStamp Source tenantId organizationUnitId message logType fingerprint windowsIdentity machineName processName processVersion jobId robotName machineId fileName indexName transactionExecutionTime totalExecutionTimeInSeconds rawMessage tenantKey userKey transactionStatus transactionState transactionId queueName processingExceptionType processingExceptionReason queueItemPriority queueItemReviewStatus activityInfo logF_BusinessProcessName

Do you have anything specified in the $select property of the API query? What columns are missing between your CSV export and the API response?

I’m getting the custom log fields in the raw message, and I’m separating raw message values to the new values, sometimes these custom log fields are present so I have added a condition if the value is present in the log message then assign it’s value else assign nothing, issue is resolved!