Orchestrator API - Return All Assets For A User

Hello,

Using the orchestrator API I am trying to return all robot assets for a given User.

This API call works, giving all users for the asset:
“/odata/Assets?$expand=RobotValues&$filter=Name eq ‘AssetName’”

But when I try to filter for all assets per user this is not working:
“/odata/Assets?$expand=RobotValues&$filter=RobotValues/RobotName eq ‘RobotName’”

Any suggestions?

/odata/Assets?$expand=RobotValues($filter=RobotName eq ‘RobotName’)&$filter=User/UserName eq ‘UserName’

User/UserName eq 'UserName' filters the assets based on the username of the user associated with those asset

Hi Moulika, thanks for your reply, I was not able to get your query working. Maybe the below example will give more clarity. I am looking to obtain a list of all Assets with RobotName “x2@corp-attended”. I would expect two results, namely App2.Credential and App3.Credential. All my attempts to add a filter have failed thus far.

Query:
“/odata/Assets?$select=Name&$expand=RobotValues($select=RobotName)”

Response:
“value”: [
{
“Name”: “App1.Credential”,
“RobotValues”: [
{
“RobotName”: “x1@corp-attended”
}
]
},
{
“Name”: “App2.Credential”,
“RobotValues”: [
{
“RobotName”: “x2@corp-attended”
}
]
},
{
“Name”: “App3.Credential”,
“RobotValues”: [
{
“RobotName”: “x1@corp-attended”
},
{
“RobotName”: “x2@corp-attended”
},
{
“RobotName”: “x3@corp-attended”
}
]
}
]
}

@raekpacman

Welcome to the community

Please try this

"/odata/Assets?$expand=RobotValues($filter=RobotName eq 'x2@corp-attended')"

Cheers

Hi Anil,

I tried that one, it is returning assets which do not have that RobotName. For instance, it still returned App1.Credential, even though x2 is not a RobotName for this asset.