my code successfully pulls all the folders in Orchestrator but when I try to pull the Robots I still get Folders ?
could it be cause the authorize_token has some expiry time ?
the code for Folders and Robots is same except the scope
folder_payload = ‘grant_type=client_credentials&client_id=b8b50cd8bb&client_secret=#k#6jWJ&scope=OR.Folders’
robots_payload = ‘grant_type=client_credentials&client_id=b8b50b&client_secret=#J&scope=OR.Robots’
headers = {“Content-Type”: “application/x-www-form-urlencoded”}
conn.request(“POST”, “/identity_/connect/token”, robots_payload, headers)
res = conn.getresponse()
data = res.read()
res_dict = json.loads(data.decode(‘utf-8’))
authorize_token=res_dict.get(‘access_token’)
robots_url = ‘UiPath’
robots_headers = {“Authorization”: f"Bearer {authorize_token}"}
robots_response = requests.get(robots_url, headers=robots_headers)
robots_response.raise_for_status()
robots_data = folders_response.json()[“value”]
print(json.dumps(robots_data, indent=2))

