Create a new value to a credential attribute

Send a POST request to assign a new value to an attribute for a specific credential.

Prerequisites

JSON Web Token (JWT)
All Control Room APIs require a JSON Web Token (JWT) to access the APIs. Generate an authentication token using the Enterprise 11 Authentication API.
Credential and attribute id
Retrieve the credential and attribute ids from the credential that you created in Create a new credential. Use the ids to access and assign a value to the attribute.
Note:
  • Use the Swagger definition files installed with your Control Room to test the APIs. View the available Swagger APIs at http://<your_control_room_url>/swagger/.
  • You can also use a REST client to complete this task.

Procedure

  1. Add an authentication token to the request header.
    Note: Use the Enterprise 11 Authentication API to generate a JSON Web Token.
  2. Specify the method and URL containing the credential id.
    • Method: POST
    • URL: http://<your_control_room_url>/v2/credentialvault/credentials/17/attributevalues
  3. Provide attribute id and new value in the request body.
    Request body:
    {
      "list":[
      {
        "credentialAttributeId": 84,
        "value": "john_smith"
      }
    ]
    }
  4. Send the request.
    • In a REST Client, click SEND.
    • In the Swagger interface, click Execute.
    The response for this example returns information on the new credential.

    Response body:

    {
      "list": [
        {
          "id": "15",
          "credentialAttributeId": "84",
          "value": "Oy0hyrDwMeWF2dXLe00deQ==",
          "createdBy": "14",
          "createdOn": "2020-04-06T21:02:25.723Z",
          "updatedBy": "14",
          "updatedOn": "2020-04-06T21:02:25.723Z",
          "version": "0",
          "credentialAttribute": {
            "id": "84",
            "name": "password",
            "description": "",
            "userProvided": false,
            "masked": true,
            "createdBy": "14",
            "createdOn": "2020-04-06T21:00:40.476Z",
            "updatedBy": "14",
            "updatedOn": "2020-04-06T21:00:40.476Z",
            "version": "0",
            "passwordFlag": false
          }
        }
      ]
    }
You can also run REST requests from a command terminal. Here is a Curl example of the request. This example is formatted for readability. Replace text inside the angle brackets with the appropriate values.
curl -X POST "<your_control_room_url>/v2/credentialvault/credentials"
                -H "accept: application/json" -H "X-Authorization: <authentication_token>"
                -H "Content-Type: application/json" -d
                {
                  "name": "name",
                  "description": "<credential_description>",
                  "attributes": [
                    {
                      "name": "<attribute_name>",
                      "userProvided": "<true_or_false>",
                      "masked": "<true_or_false>",
                      "passwordFlag": "<true_or_false>"
                    }
                  ]
                }