Read and Review Automation Anywhere Documentation

Automation 360

Close Contents

Contents

Open Contents

Configure a credential with attribute values using API

  • Updated: 1/31/2021
    • Automation 360 v.x
    • Explore
    • RPA Workspace

Configure a credential with attribute values using API

Create a credential with a standard attribute and add two additional attributes with user-input values.

Prerequisites

Note: You can view the Control Room APIs in the Community Edition, but API functionality is limited. You need a licensed Automation 360 Edition to access the full functionality of the APIs.
  • Use the Authentication API to generate a JSON Web Token. See Authentication API.
  • All roles have the Manage my credentials and lockers permission that is necessary to configure credentials and attributes. No additional permissions are necessary to use this endpoint.
In this example, you configure a credential with three attributes to hold email hostname, username, and password.

Procedure

  1. Add the authentication token to the request header.
  2. Create a credential. Use the POST method and endpoint URL: <your_control_room_url>/v2/credentialvault/credentials.
    Request body: This example request includes the following required parameters:
    • userProvided: a boolean value that configures whether the attribute requires a user's input (true) or is standard for all users (false).
    • masked: a boolean value that configures whether the attribute value is masked with asterisks (true) or is visible to users (false).
    {
      "name": "Email",
      "attributes": [
      	{
          "name": "hostname",
          "userProvided": false,
          "masked": false
        } 	
      ]
    }
  3. Send the request.
    Response body: In a successful request, this endpoint returns the following data:
    • id: a unique numeric identifier for the credential.
    • attributes:id: a unique numeric identifier for attribute.
    {
        "id": "1630",
        "name": "Email",
        "description": "",
        "ownerId": "1508",
        "attributes": [
            {
                "id": "3335",
                "name": "hostname",
                "description": "",
                "userProvided": false,
                "masked": false,
                "createdBy": "1508",
                "createdOn": "2020-12-28T22:04:41.366448Z",
                "updatedBy": "1508",
                "updatedOn": "2020-12-28T22:04:41.366450Z",
                "version": "0",
                "passwordFlag": false
            }
        ],
        "createdBy": "1508",
        "createdOn": "2020-12-28T22:04:41.366460Z",
        "updatedBy": "1508",
        "updatedOn": "2020-12-28T22:04:41.366464Z",
        "version": "0"
    }
    The REST API responds to each request with an HTTP response code. For response codes, see API response codes.
  4. Assign a standard value to the hostname attribute to the credential. Use the POST method and endpoint URL:<your_control_room_url>/v2/credentialvault/credentials/{credentialId}/attributevalues.
    {
      "list": [
        {
          "credentialAttributeId": "3335",
          "value": "mail.example.com"
        }
      ]
    }
  5. Send the request.
    Response body:
    {
      "list": [
        {
          "id": "1630",
          "credentialAttributeId": "3335",
          "value": "mail.example.com",
          "userId": "1508",
          "createdBy": "1508",
          "createdOn": "2020-12-28T22:04:41.366460Z",
          "updatedBy": "1508",
          "updatedOn": "2020-12-28T22:04:41.366464Z",
          "version": "0"
        }
      ]
    }
  6. Add the username and password attributes to the Email credential. Use the PUT method and endpoint URL:<your_control_room_url>/v2/credentialvault/credentials/{credentialId}.
    Request body: Since you have specified the credential ID in the request URL, it is not required to include the credential ID or name in the request body. In this example request body, the username and password attributes are configured with values that accept a different input from each user. Additionally, the password attribute is configured to mask the entered value with asterisks.
    {
        "attributes": [
      	{
          "name": "username",
          "userProvided": true,
          "masked": false
        },
         {
          "name": "password",
          "userProvided": true,
          "masked": true
        }	
      ]
    }
  7. Send the request.
    Response body: The response body returns the credential with details of the three attributes.
    {
        "id": "1630",
        "name": "Email",
        "description": "",
        "ownerId": "1508",
        "attributes": [
            {
                "id": "3335",
                "name": "hostname",
                "description": "",
                "userProvided": false,
                "masked": false,
                "createdBy": "1508",
                "createdOn": "2020-12-28T22:04:41.366448Z",
                "updatedBy": "1508",
                "updatedOn": "2020-12-28T22:04:41.366450Z",
                "version": "0",
                "passwordFlag": false
            },
            {
                "id": "3336",
                "name": "username",
                "description": "",
                "userProvided": true,
                "masked": false,
                "createdBy": "1508",
                "createdOn": "2020-12-28T22:04:41.366450Z",
                "updatedBy": "1508",
                "updatedOn": "2020-12-28T22:04:41.366450Z",
                "version": "0",
                "passwordFlag": false
            },
            {
                "id": "3337",
                "name": "password",
                "description": "",
                "userProvided": true,
                "masked": true,
                "createdBy": "1508",
                "createdOn": "2020-12-28T22:04:41.366450Z",
                "updatedBy": "1508",
                "updatedOn": "2020-12-28T22:04:41.366450Z",
                "version": "0",
                "passwordFlag": false
            }
        ],
        "createdBy": "1508",
        "createdOn": "2020-12-28T22:04:41.366460Z",
        "updatedBy": "1508",
        "updatedOn": "2020-12-28T22:06:35.366464Z",
        "version": "2"
    }

Next steps

If you are following the steps to configure your Credential Vault, do this next: Assign credential to locker API.
Send Feedback