Hi All, I want to create/update the valueperrobot assets using orchestrator api call, can someone please share the code snippet. I can able to create global assets using the code below:
For Creating UiPath Assets as the value per bot you need to make some changes in payloads which are as follows
ValueScope: PerRobot
RobotValues: The collection of asset values per robot.
for this, you need to create JSON list like this ex:-
[{RobotId:‘’ ,RobotName:‘The name of the robot with which the asset is associated.’, ValueType:
}]
To Update the Existing asset you need to first get your Asset ID and then pass the Asset Id in the URL and JSON payload also
ex: URL odata/Assets(AssetID)
Body:
{
“Name”:“Asset1”,
“ValueScope”:“global/per robot”,
“valueType”:“Text”,
“Stringvalue”:“my name is xyz”,
“ID”:
}
Method Type : Put
To work on Specific Folder you need to first get your Folder ID by calling Orchestrator API and then pass that Folder ID inside the Header of your Payload as Key “X-UiPath-OrganizationUnitid”value :your folder Id
I have got the key and ID of the folder, could you please tell me how to add those values to the header of the payload with an example (like adding an asset to a particular folder in orchestrator)?
FYI… I am using orchestrator http request activity…
In Orchestrator Http request Activity we don’t have any option to send the header values, so for using Orchestrator HTTP request activity we can create assets only in the Same folder where the Robot resides.
To Perform this I would suggest you use HTTP Request activity there you can pass the header
Thanks & Regards
Gopal Tewari