Example 6: Password credential

This example shows you how to call POST Credentials/Create. If your CA requires an API key, the Value is the API key. See the second example (below).

TIP  Know your CA's requirements for credentials. Remember that you are adding credentials as is. Always validate the Credential object. The best way to check is to create a CA Template in the UI and apply your credential. If an error occurs, correct the credential, and retry.

The Values array needs these elements:

  • Name: Password, Type:string and Value that is the password.

Example 1: Create a Password Credential

Request

POST https://tpp.venafi.example/vedsdk/Credentials/Create
Authorization:Bearer 4MyGeneratedBearerTknz==
{ "CredentialPath":"\\VED\\Policy\\Credentials\\Pwd", "FriendlyName":"Password", "Values":[ { "Name":"Password", "Type":"string", "Value":"!PasswordThatisValid4MyCA" } ] }

Response

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

Example 2: Create a Digicert Credential that uses an API key

The Value is the API key from your CA.

Request

POST https://tpp.venafi.example/vedsdk/Credentials/Create
Authorization:Bearer 4MyGeneratedBearerTknz==
{ "CredentialPath":"\\VED\\Policy\\Credentials\\DigicertCred", "Description":"Test Credential", "Expiration":"/Date(1716122248657)/", "Shared":"true", "FriendlyName":"Password", "Values":[ { "Name":"Password", "Type":"string", "Value":"BVAK4PP5..." } ] }

Response

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