According to the API documentation the JobDto has two relations: Release and Robot - which makes absolutly perfect sense.
But how to I access this info?
The way I read the documentation, the json response I recieve from the http request should have a SimpleRobotDto property named “Robot”, but extracting it seems impossible. For example I can do this easy peasy:
json(“State”) but not json(“Robot”) or json(“RobotDto”)
This gives me an error that indicates that the property does not exist.
Is there some REST idea I’m totally missing?
According to the UiPath docs, it should be possible, but doesnt it apply to my version (v.2016.2) ?
I was having the same issue. I didn’t find much info on $expand or $filter in the docs but that worked.
Can I $filter on expanded objects?
This example in docs indicates you can (though the syntax seems strange): https://staging.uipath.com/odata/Sessions?$top=1&$filter=State eq UiPath.Core.Enums.RobotState%27Disconnected%27
I tried the following with no success:
$filter=Robot.MachineName eq UiPath.Application.Dto.RobotDto.MachineName%27VDIRBDEV01%27
Also, can you have compound statements in $filters (e.g., using A “and” B)?
Thanks
The previous example I found in docs was for an enumerated type, not an expanded object.
But this example uses an expanded object and is compound (using an “and”). https://staging.uipath.com/odata/QueueItems?$top=2&$filter=Robot/Description eq ‘doc_tests’ and Status eq UiPath.Core.Model.Queues.ProcessingStatus%27Failed%27
So it is a strange/undocumented(?) syntax, but this works: https://myserver.com/odata/Jobs?$filter=State eq ‘Successful’ and Robot/MachineName eq ‘VDIRBDEV01’&$expand=Robot, Release
I have since found other defects in the Orchestrator processing of Odata commands. I reported one to UiPath and they only provided me with a workaround (no defect fix), but I did not pursue it because we are on Orchestrator 2016.2 hoping to upgrade to 2018.2 soon (I will report it again it defect still exists in new version).
I found this site helpful in explaining the OData syntax and functionality and noticed this link is in the UiPath 2018.2 API docs: http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part1-protocol/odata-v4.0-errata03-os-part1-protocol-complete.html