Example 1: Amazon Local credentials

This example shows you how to call POST Credentials/Create.

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: Source, Type:string and Value: Local. List the Source of the credential first in the Values array. This clears other attributes to avoid non-applicable data from being retained. 
  • Name: AccessKey, Type:string and Value that is the Amazon access string.
  • Name: SecretKey, Type:string and Value that is the Amazon secret key.

Example: Create a Local Amazon credential

Request

POST https://tpp.venafi.example/vedsdk/Credentials/Create
Authorization:Bearer 4MyGeneratedBearerTknz==
{
   "CredentialPath":"\\VED\\Policy\\AWS Keys\\AWSStaticCredential",
   "FriendlyName":"Amazon",
   "Expiration":"\/Date(1716122248657)\/",
   "Values":[
      {
         "Name":"Source",
         "Type":"string",
         "Value":"Local"
      },
      {
         "Name":"AccessKey",
         "Type":"string",
         "Value":"AKIAIOSFODNN7EXAMPLE"
      },
      {
         "Name":"SecretKey",
         "Type":"string",
         "Value":"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
      }
   ]
}

Response

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