Use Assets_GetById API to retrieve Credential

When I use Assets_GetById API to retrieve credential, I got empty strings for both user name and password. Is there a way to get the credential?

Hi @l.wang ,

Example of Using Orchestrator API

  1. Authenticate and Get Token
POST https://<orchestrator_url>/api/Account/Authenticate
Content-Type: application/json

{
  "tenancyName": "Default",
  "usernameOrEmailAddress": "your_email@example.com",
  "password": "your_password"
}
  • Response:
{
  "result": "your_access_token"
}
  1. Retrieve Credential Asset
POST https://<orchestrator_url>/odata/Assets/UiPath.Server.Configuration.OData.GetRobotCredential
Content-Type: application/json
Authorization: Bearer your_access_token

{
  "assetName": "your_credential_asset_name"
}
  • Response:
{
  "value": {
    "UserName": "your_username",
    "Password": "your_password"
  }
}

Regards
Sandy

Sandy - I didn’t express my question well. I need to get the credential using c# by accessing the external application of UiPath API. The endpoint I uses to retrieve the credential is: https://cloud.uipath.com//<Environment/orchestrator_/odata/Assets({AssetID}). It works and returns data. The only issue is the return values for user name and password are empty string.

Looking at the many other posts on this topic, it seems you can’t get the username and password via the API.

@l.wang

I beleive using api you can only set values but not get even if the call is present

Cheers

I found the endpoint which can get the username, but the password is empty string:
orchestratorUrl/odata/Assets({assetID})$expand=RobotValues

You might be correct. Thanks for the response.