How do you format a REST call with CredentialTarget?

How do you properly format a REST call using the CredentialTarget parameter identified here?
https://www.uipath.com/kb-articles/uipath-robot-api

I’ve been able to successfully call the robot passing User/Password. But I cannot seem to figure out how to call it passing a CredentialTarget?

Hey @Scott

Here Credential Target is The username defined in the Windows Vault Manager/ Credential Manager.

CredentialTarget - The name of a Windows Credential that defines the user account that should execute the process.

Let me know the result of it.

Regards…!!
Aksh

Hi Thanks…

Can you show me how the JSON is formatted?
I cannot get it to accept a call unless I actually use a format like:

{
‘WorkflowFile’: ‘C:\main.xaml’,
‘User’: 'myusername,
‘Password’: ‘mypassword’,
‘Type’: 0,
‘InputArguments’: {
‘stringData’: ‘mydata’
}
}

What does it look like if I specify a credential target instead?

Thank you!

Hey @Scott

{
‘WorkflowFile’: ‘C:\main.xaml’,
‘User’: ‘’,
‘Password’: ‘’,
‘CredentialTarge’:<your credential user name>
‘Type’: 0,
‘InputArguments’: {
‘stringData’: ‘mydata’
}

Regards…!!
Aksh

1 Like

Thanks, I will give it a try.
One more kind of random question… so you’ll know what I am trying to do.
Trying to demo remote execution of a bot.
The problem I have been having is that the REST call “logs in” and shuts down the Remote Desktop Connection I have to the server running the bot.
I’m trying to show the REST invocation and the bot running remotely.
You think this will still cause the RDC session to drop?

Cheers.

Hi,

I tried running with Credential Target in above format, but it gave below error.

{“message”:"StartJob : mscorlib, \n System.AggregateException: One or more errors occurred. —> System.Exception: Password or Credential must be specified. Job’s username {0}, Windows Identity {1}\r\n at UiPath.Service.Impl.CredentialStore.ValidateAuthentication(UserIdentity identity)

Is the Parameter name changed to other name in new version, because it seems it is not recognizing that windows credentials have to be used?

Thanks,
Eesh Tyagi

Have you added the credential into the windows credential manager and used that credential name here?

according to this error you have not specified so you are getting this and other thing if you are using credentialTarget property then you don’t have to specify username and pasword property.

Regards…!!
Aksh

For your information : @Scott @Eesh_Tyagi

Regards…!!
Aksh

1 Like

Aksh ~

Am I reading that correctly? You’re not going to support a REST endpoint anymore?
Please clarify.

Thank you,
Scott

Not me :slight_smile: UiPath Team.

@badita will confirm more on this.

Regards…!!
Aksh

Our focus is Orchestrator API.

You can try it as is in CE

  • uncomment the http binding line in app settings (it will be overriden at the next update)
  • run the robot with elevated rights

Hi,

So its not CredentialTarget , it should be Credential. And we have to specify ‘User’ field also.

But again after running below command it gives access denied error.

{'WorkflowFile': '<XAML file name>','User':'EESH','Credential':'LAPTOP-464AVEER','Type': 0}

Error is

 {"message":"Executor start process failed, reason Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}

So i am guessing since the UIRobot svc is running in say user X which is my local system account, it will not allow another credential say User Y in non windows server. But might be possible in VM or Windows server. May be @badita can correct this statement if i am wrong.

2 Likes

Hey @Eesh_Tyagi

You are targeting the Users credential into the windows credential manager so it is appropriate field and most important depends on the API developer and parameters they have taken.

You have to read all things here first, Your some doubts will be clarify easily.

https://www.uipath.com/kb-articles/uipath-robot-api

Regards…!!
Aksh

I don’t know this area. Maybe @andraciorici or @Lavinia :slight_smile:
Anyway we have cut REST API support for this reason…to complicated.

1 Like

@aksh1yadav i have already gone through that article :slight_smile:. But with CredentialTarget it gives the error mentioned intially.

And also i have added windows credentials in manager and also tried with using only credentialTarget property removing username and password.

With the above method(using credential paramater), i understand that the API parameter mentioned is credentialTarget, but i tried using credential which gave an Job ID in POSTMAN API client.

1 Like

Hey @Eesh_Tyagi

Ahhan… seems to be the things has been changed. i have to check on this otherwise waiting for the latest updates from @Lavinia and @andraciorici

Thanks for noticing and updating me as well :slight_smile: :thumbsup:

Regards…!!
Aksh

Hi all,

The credential target represents the target name of a credential defined in Windows Credential Store. This credential will be retrieved by UiRobot service and used for auto-login and workflow execution.

Not sure if you are aware, but a user can read credentials only from its Windows Credential Store. Because of this, the credential must be saved in Local System’s credential store. This way, UiRobotSvc is able to retrieve it and use it.

Regarding the other questions, the name of the parameter is CredentialTarget not credential. And yes, username must be specified as well and it must match the user set in the credential stored in Windows Credential Store.

As @badita said, this API can be used, but is no longer maintained.

3 Likes

Hey @Eesh_Tyagi

As @andraciorici now confirmed :slight_smile: still things are same :stuck_out_tongue:

Same as what i said :slight_smile: :blush: :nerd:

Regards…!!
Aksh

2 Likes