KeyValueStorage
Methods
DelKeyValueItem
Deletes the specified key-value pair from the storage.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
The application ID
application_name:
string
OptionalThe application name
key:
string
Key, up to 200 characters
Returns
result:
number
GetKeyValueItem
Gets the specified key-value pair from the storage.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
The application ID
application_name:
string
OptionalThe application name
key:
string
Key, up to 200 characters
Returns
result:
The key-value item
GetKeyValueItems
Gets all the key-value pairs in which the keys begin with a pattern.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
The application ID
application_name:
string
OptionalThe application name
count:
number
OptionalNumber of items to show per page with a maximum value of 50. Default value is 10
key:
string
Namespace that keys should contain, up to 200 characters
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
Returns
result:
The key-value pairs
GetKeyValueKeys
Gets all the keys of key-value pairs.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
The application ID
application_name:
string
OptionalThe application name
count:
number
OptionalNumber of items to show per page with a maximum value of 50. Default value is 10
key:
string
OptionalNamespace that keys should contain, up to 200 characters
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
Returns
result:
The key-value keys
SetKeyValueItem
Creates or updates a key-value pair. If an existing key is passed, the method returns the existing item and changes the value if needed. The keys should be unique within a Voximplant application.
To call this method, make sure your service account has one of the following roles:
Parameters
application_id:
number
The application ID
application_name:
string
OptionalThe application name
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
key:
string
Key, up to 200 characters. A key can contain a namespace that is written before the ':' symbol, for example, test:1234. Thus, namespace 'test' can be used as a pattern in the GetKeyValueItems and GetKeyValueKeys methods to find the keys with the same namespace
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
value:
string
Value for the specified key, up to 2000 characters
Returns
result:
The key-value item