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.
View your Key values by clicking Tools > Key Values in the sidebar, or go to https://revcent.com/user/key-values
You can create a Key Value via the RevCent web app, API or AI Assistant.
Web App
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.
You can edit a Key Value via the RevCent web app, API or AI Assistant.
Web App
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.
A Key Type can be either a String or a Pointer.
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:
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.
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. |
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:
{
"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.