POST Credentials/Adaptable/Update

Updates field values in an Adaptable Credential. For an Adaptable Credential, you can change these values: ConnectorName, CustomFields, or CredentialType.

WARNING!  

If the Adaptable Credential script changed after you configured the connector, you must re-approve the change. Otherwise, errors occur.

In VCC, open the VCC Adaptable Credential connector properties and follow the prompts. Likewise, in Trust Protection Platform, open and approve the Adaptable Credential.

Requirements

  • Permissions:  The caller must have Master Admin permission.
  • Token scope:  Security:Manage

Headers

  • Content type: Content-Type:application/json.

  • Token: The bearer access token that you received. For example, Authorization:Bearer 4MyGeneratedBearerTknz==. For more information, see Passing a bearer token in your API calls.

Parameters

Input parameters

Name

Description

CredentialPath

Read only. An existing Adaptable Credential path and name. For example: \\VED\\Policy\\MyAdaptableCredential.

ConnectorName

The VCCAdaptable Credential connector that describes the vault, and PowerShell script. For example: MyVCC-Connector.

CustomFields

(Optional) An array of name/value pairs that supply basic and custom values to pass to the Adaptable Credential PowerShell script. The field name must appear in the script. Retain the name and only set the Value.

  • Text1-Text5Value: Zero or more Custom Fields and corresponding string values.

  • Option1-Option2Value: Zero or more options that accept either 1: Enable, or 0: Disable values.

  • PasswdValue: In Trust Protection Platform, the Service Credential to access the vault. For example \\VED\\Policy\\SvcCredTokenForVault.

  • [Additional custom field]:Value: A custom field name from the script. May be required by a CA, device, or service.

CredentialType

The kind of credential to retrieve from the vault. One of the following:

  • Username and Password Credential: The user name. Retrieve the password from the vault.

  • Password Credential: The credential. Retrieve only the password from the vault.

Returns

For valid requests, Credentials/Adaptable/Update returns a HTTP 200 message and a Result of 1. For invalid requests, note the HTTP message, Result of 0, and corresponding Error.

Response description

Name

Description

HTTP 200

For valid requests, this call returns a HTTP 200 message and the following data in the message body:

  • Error: Appears only when the operation cannot supply the necessary data. Provides only a description and Result. No other data.
  • Result: The result:
    • 0: Failure. See the corresponding error message.

    • 1: Success.

HTTP 400

For invalid requests, this call returns HTTP 400 Bad Request and the following data in the message body:

Result: 0: Failure and the corresponding error message.

OR 

  • error: The reason for the error.
  • error_description: If available, additional information about how to retry the request.

Example 1: Vault device changed

Careful! If the vault changes, the Adaptable Credential may generate errors when you try to use it in a place like in a CA template. To switch vaults:

  • Set the new VCC ConnectorName.

  • Set Text1 to the vault new path and Passwd to the new Service Credential that contains a valid token as the password.

  • Adaptable Credential to a new VCC Adaptable connector.

Request for Example 1

POST https://tpp.venafi.example/vedsdk/Credentials/Adaptable/Update
Authorization:Bearer 4MyGeneratedBearerTknz==
{
   "CredentialPath":"\\VED\\Policy\\Credentials\\CredentialforProvisioning",
   "CredentialType":"Username Password Credential",
   "ConnectorName":"VCC-HCAdaptable3",
   "CustomFields":[
      {
         "Name":"Text1",
         "Value":"/kv/data/MyNewPath"
      },
      {
         "Name":"Text2",
         "Value":"training\\administrator"
      },
      {
         "Name":"Option1",
         "Value":"1"
      },
      {
         "Name":"Passwd",
         "Value":"\\VED\\Policy\\Credentials\\MyServiceCredentialtoNewVault"
      }
   ]
}

Response for Example 1

HTTP/1.1 200 OK
{
  "Result": 1
}

Example 2: Change vault user in a custom field value

Careful! Custom field values are not verified until they are needed elsewhere in Venafi. To change the vault user, carefully set Text 2.

Request for Example 2

POST https://tpp.venafi.example/vedsdk/Credentials/Adaptable/Update
Authorization:Bearer 4MyGeneratedBearerTknz==
{
   "CredentialPath":"\\VED\\Policy\\Credentials\\CredentialforProvisioning5",
   "CredentialType":"Username Password Credential",
   "ConnectorName":"VCC-HCAdaptable3",
   "CustomFields":[
      {
         "Name":"Text1",
         "Value":"/kv/data/vaskopath"
      },
      {
         "Name":"Text2",
         "Value":"training\\Newbie"
      }
   ]
}

Response for Example 2

HTTP/1.1 200 OK
{
  "Result": 1
}