KeyValueStorage
Methods
SetKeyValueItem
Creates a key-value pair. If an already existing key is passed, the method will return the existing item. The keys should be unique within a Voximplant application.
Parameters
key:
string
Key to create, up to 200 charactrers.
value:
string
Value for the specified key, up to 2000 charactrers.
application_id:
number
The application ID.
application_name:
string
OptionalThe application name.
ttl:
number
OptionalKey expiry time in seconds. The value is in range of 0..7,776,000 (90 days), the default value is 30 days (2,592,000 seconds). The TTL is converted to an expires_at Unix timestamp field as part of the storage object. Note that one of the two parameters (ttl or expires_at) must be set.
expires_at:
number
OptionalExpiration date based on ttl (timestamp without milliseconds). Note that one of the two parameters (ttl or expires_at) must be set.
Returns
result:
The key-value item.
DelKeyValueItem
Deletes the specified key-value pair from the storage.
Parameters
key:
string
Key to delete, up to 200 charactrers.
application_id:
number
The application ID.
application_name:
string
OptionalThe application name.
Returns
result:
number
GetKeyValueItem
Gets the specified key-value pair from the storage.
Parameters
key:
string
Key to get, up to 200 charactrers.
application_id:
number
The application ID.
application_name:
string
OptionalThe application name.
Returns
result:
The key-value item.
GetKeyValueItems
Gets all the key-value pairs in which the keys begin with a pattern.
Parameters
key:
string
Key pattern, up to 200 charactrers.
count:
number
OptionalNumber of items to show per page with a maximum value of 50. Default value is 10.
offset:
number
OptionalNumber of items to skip (e.g. if you set count = 20 and offset = 0 the first time, the next time, offset has to be equal to 20 to skip the items shown earlier). Default value is 0.
application_id:
number
The application ID.
application_name:
string
OptionalThe application name.
Returns
result:
The key-value pairs.
GetKeyValueKeys
Gets all the keys of key-value pairs.
Parameters
key:
string
OptionalKey pattern, up to 200 charactrers.
count:
number
OptionalNumber of items to show per page with a maximum value of 50. Default value is 10.
offset:
number
OptionalNumber of items to skip (e.g. if you set count = 20 and offset = 0 the first time, the next time, offset has to be equal to 20 to skip the items shown earlier). Default value is 0.
application_id:
number
The application ID.
application_name:
string
OptionalThe application name.
Returns
result:
The key-value keys.