How to create/update ValuePerRobot scope assets using Orchestrator API requests?

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:

JsonPayload:

“{Name: ‘Test_BoolFalseFinal’,ValueScope: ‘Global’,ValueType: ‘Bool’,BoolValue:‘True’,Description: ‘Testing’,Id:xyz}”

Endpoint: “/odata/Assets”

Also I want to create/update the values in a specific folder not the default one. How can I include the folder path in the above code? Please guide.

Note: I am using orchestrator version: 2020.10.10

Hi @663959

Welcome back to UiPath Forum.

  1. 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:
}]

  1. 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

  1. 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

For more guidance please follow this Swagger UI path
https://staging.uipath.com/

Thanks :slight_smile:

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…

My apology that I didn’t thanked you first…

Thank you :slight_smile:

Hi @663959

Sorry for the late reply.

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

Thank you, that worked :slight_smile:

1 Like

Hi @663959

Could you please mark it as solution.
So that it will help us to close this issue

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.