Tried with these three curl (among hundreds of variations):
- Curl 1
curl -X POST \
'https://pi*****/odata/Assets/UiPath.Server.Configuration.OData.SetCredentialAssetValue' \
-H 'X-UIPATH-OrganizationUnitId: 1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_TOKEN_HERE' \
-d '{
"credentialAssetValue": {
"__metadata": {
"type": "UiPath.Server.Configuration.OData.CredentialValue"
},
"Name": "PIR*******",
"ValueScope": "PerRobot",
"RobotId": 448,
"CredentialUsername": "999111",
"CredentialPassword": "newpassword123"
}
}'
- Curl 2:
curl -X POST \
'https://pi***/odata/Assets/UiPath.Server.Configuration.OData.SetCredentialAssetValue' \
-H 'X-UIPATH-OrganizationUnitId: 1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer token-here' \
-d '{
"credentialAssetValue": {
"Name": "PIR***",
"ValueScope": "PerRobot",
"RobotId": 448,
"CredentialUsername": "999111",
"CredentialPassword": "ppp"
}
}'
- Curl 3:
curl -X 'PUT' \
'https://pi****/odata/Assets(481)' \
-H 'X-UIPATH-OrganizationUnitId: 1' \
-H 'accept: application/json' \
-H 'Content-Type: application/json;odata.metadata=minimal;odata.streaming=true' \
--header 'Authorization: Bearer <token-here>' \
-d '{ \
"Name": "PIR***", \
"CanBeDeleted": true, \
"ValueScope": "PerRobot", \
"ValueType": "Credential", \
"KeyValueList": [], \
"RobotValues": [{ \
"RobotId": 448, \
"ValueType": "Credential", \
"CredentialUsername": "999111", \
"CredentialPassword": "newpassword123", \
"Id": 1 \
}], \
"Id": 1 \
}'
All I can get is “assetDto must not be null” and/or “Invalid OData query options.”
Any clue appreciated.
