Rate this page:

KeyValueStorage

Methods

DelKeyValueItem

Copy URL

Deletes the specified key-value pair from the storage.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
DelKeyValueItem example

DelKeyValueItem example

DelKeyValueItem example.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

  • key:

    string

    Key, up to 200 characters

Returns

  • result:

    number

GetKeyValueItem

Copy URL

Gets the specified key-value pair from the storage.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
GetKeyValueItem example

GetKeyValueItem example

GetKeyValueItem example.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

  • key:

    string

    Key, up to 200 characters

Returns

GetKeyValueItems

Copy URL

Gets all the key-value pairs in which the keys begin with a pattern.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
GetKeyValueItems example

GetKeyValueItems example

GetKeyValueItems example.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

  • count:

    number

    Optional

    Number 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

    Optional

    Number 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

GetKeyValueKeys

Copy URL

Gets all the keys of key-value pairs.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
GetKeyValueKeys example

GetKeyValueKeys example

GetKeyValueKeys example.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

  • count:

    number

    Optional

    Number of items to show per page with a maximum value of 50. Default value is 10

  • key:

    string

    Optional

    Namespace that keys should contain, up to 200 characters

  • offset:

    number

    Optional

    Number 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

SetKeyValueItem

Copy URL

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.

Available for roles

To call this method, make sure your service account has one of the following roles:

See Available Roles
Owner
Admin
Developer
SetKeyValueItem example

SetKeyValueItem example

SetKeyValueItem example.

Parameters

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

  • expires_at:

    number

    Optional

    Expiration 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

    Optional

    Key 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