Key Values

Overview and details on Key Values in RevCent.

Key Values

A Key Value in RevCent allows you to set account-wide values accessible via a unique key. This is useful as it allows you to implement shortcodes within various features and tools, as well as API calls, that will propagate as the key value. You can also access and update Key Values using AI Assistants and Functions.

Why Use A Key Value?

  • Set or update a value per unique key for access across your RevCent account.
  • Use key values as shortcodes within Email Templates.
  • Use key values as shortcodes within AI Assistant messages.
  • Access and update key values within Functions.
  • Create, edit and list key values via the Web, API and AI Assistants.
  • A key value can be a pointer, which serves as an alias for other RevCent entities such as Payment Profiles.

View Key Values

View your Key values by clicking Tools > Key Values in the sidebar, or go to https://revcent.com/user/key-values

Create Key Value

You can create a Key Value via the RevCent web app, API or AI Assistant.

Web App

  1. Click Create New Key Value when viewing all Key Values or go to https://revcent.com/user/new-key-value
  2. Enter a unique key. Cannot be modified once created. The key can contain alphabetical characters or underscores only, with a minimum length of 2 and a maximum length of 100. Cannot start or end with an underscore.
  3. Enter the description for the key.
  4. Once created, you will be forwarded to the Edit Key Value page where you can set the string value or pointer.

API

Create a key value via the API operation Create A Key Value.

AI Assistant

Enable the system action Create Key Value within an AI Assistant via web settings or within a thread node.

Edit Key Value

You can edit a Key Value via the RevCent web app, API or AI Assistant.

Web App

  1. Click the pencil icon when viewing all Key Values for the specific key you wish to modify.
  2. Modify the description for the key. Optional.
  3. Select the Key Type, either String or Pointer.
  4. If key type is pointer, select the Pointer Type and target.
  5. Click Save Changes.

API

Edit a key value via the API operation Edit A Key Value.

AI Assistant

Enable the system action Edit Key Value within an AI Assistant via web settings or within a thread node.

RevCent Function

Update the value with a RevCent Function using the UpdateKeyValue function within the global[‘revcent’] object. Note: you can only update a Key Value with key type of string. Pointer key types cannot be updated within a function.

Key Type

A Key Type can be either a String or a Pointer.

  • String: A raw string up to 5MB in size.
  • Pointer: The pointer is a way to point the Key Value to a specific entity in your RevCent account. When selecting the Key Type > Pointer within the web app, you will then be prompted to select the Pointer Type.

Pointer Type

The Pointer Type determines what type of entity the Key Value points to. The pointer type and the keys’ value must match an entity. When selecting the specific pointer type within the web app, a list of entities within your RevCent account will appear, allowing you to select the pointer target.

Available Pointer Types:

  • Payment Profile: The Key Value can point to a Payment Profile that exists in your RevCent account. When pointer type is Payment Profile, the keys’ value must match an ID of a Payment Profile in your account. This is done automatically in the web app when choosing the corresponding Payment Profile as the pointer target.

Key Value Availability

Only certain tools/features can take advantage of key values. View the Key Value availability table below to see what tools and features are currently enabled for key value use. We will continue to expand the availability of Key Values in more tools and features throughout RevCent.

Availability Table

The following tools/features have Key Values accessible via shortcodes or objects. Notice the access examples, specifically the shortcode method syntax, either double curly brace or bracket.

Tool/Feature Method Key Types Access Example Description
Email Template Shortcode String, Pointer {{key_values.my_key}} Use a key value using a double curly brace shortcode within an email template. A String key type will output the raw string. A Pointer key type will output the raw pointer value, i.e. the ID of the pointer target.
AI Assistant Shortcode String, Pointer [key_values.my_key] Use a key value using a bracket shortcode within a message, either Web Chat or an Autonomous assistant node step message/branch message. A String key type will output the raw string. A Pointer key type will output the raw pointer value, i.e. the ID of the target.
API Call Shortcode Pointer [key_values.my_key] Use a Pointer within an API call using a bracket shortcode in the place of the corresponding pointer type property value. Read more about API Call Pointers.
Function Object String, Pointer global['revcent'].GetKeyValue(my_key, callback) Access one or more Key Values within your function code, via the global['revcent'].GetKeyValue(my_key, callback) function. Read more.

API Call Pointers

String key types are not supported, only Pointer key types are supported within API calls at this time to avoid misconfiguration and payment errors. The pointer must correspond to the pointer type, i.e. if pointer type is Payment Profile then you can use the shortcode in the payment_profile property value of an API call.

How It Works

RevCent will search for shortcodes according to pointer type in an API call, and if there are any, it will replace the [key_values.my_key] with the actual pointer value of my_key.

Example

If you created a Key Value with a Payment Profile pointer, you can place the bracket shortcode in the payment_profile property of an API call:

json
{
  "payment_profile": "[key_values.my_key]"
}

This would result in the [key_values.my_key] shortcode being replaced with the pointer target payment profile ID.