API Post assets

currently setup with single tenant (“default”) and in process of setting up 2 new tenants and getting rid of default (since it can not be renamed << very strange )

I’m trying to get all data from “default” tenant and copy it

asset with credentials

GET odata/Assets

returns something like this

{
  "Name": "ACME",
  "CanBeDeleted": true,
  "ValueScope": "Global",
  "ValueType": "Credential",
  "Value": "username: ",
  "StringValue": "",
  "BoolValue": false,
  "IntValue": 0,
  "CredentialUsername": "",
  "CredentialPassword": "",
  "ExternalName": null,
  "CredentialStoreId": 1,
  "HasDefaultValue": true,
  "Description": null,
  "Id": 117,
  "KeyValueList": []
}

when trying to post

{"message":"The user name or external name cannot be null or empty.","errorCode":1500,"resourceIds":null}

is there a way to grab username via GET odata/Assets?

rest of the assets work just fine … some trouble with ID’s … but nothing I can’t deal with or script for… assets with credentials, I can not find a way to grab username … which leaves me with lot of manual work

any suggestions?

For the time being, the only option I can think of is as follows :
1 - Run asset API
2 - Put an If condition to check if it a credential API
3 - If so then run UiPath robot which calls “Get Credential” activity
4 - Get the userName from workflow and update the body of Credential API

2 Likes

that’s a good idea…
more scripting…but I don’t mind

after step 3 pretty sure I’ll need additional steps

4 - post odata/Robots + folder id(create a new robot in folder)
5 - If so then run UiPath robot which calls “Get Credential” activity
6 - Get the userName from workflow and update the body of Credential API
7 - delete robot from folder

repeat for each folder

heck… if I’m doing username… I might as well do password
thanks @mahesh.kumar … I’ll do some testing… but “on paper” looks doable

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