Rate this page:

KeyValueStorage

Methods

SetKeyValueItem

Copy URL

Creates or updates a key-value pair. If an existing key is passed, the method will return the existing item and will change the value if needed. The keys should be unique within a Voximplant application.

SetKeyValueItem example

SetKeyValueItem example

SetKeyValueItem example.

Parameters

  • key:

    string

    Key, up to 200 charactrers

  • value:

    string

    Value for the specified key, up to 2000 charactrers

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

  • 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

  • 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

Returns

DelKeyValueItem

Copy URL

Deletes the specified key-value pair from the storage.

DelKeyValueItem example

DelKeyValueItem example

DelKeyValueItem example.

Parameters

  • key:

    string

    Key, up to 200 charactrers

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

Returns

  • result:

    number

GetKeyValueItem

Copy URL

Gets the specified key-value pair from the storage.

GetKeyValueItem example

GetKeyValueItem example

GetKeyValueItem example.

Parameters

  • key:

    string

    Key, up to 200 charactrers

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

Returns

GetKeyValueItems

Copy URL

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

GetKeyValueItems example

GetKeyValueItems example

GetKeyValueItems example.

Parameters

  • key:

    string

    Key pattern, up to 200 charactrers

  • count:

    number

    Optional

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

  • 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

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

Returns

GetKeyValueKeys

Copy URL

Gets all the keys of key-value pairs.

GetKeyValueKeys example

GetKeyValueKeys example

GetKeyValueKeys example.

Parameters

  • key:

    string

    Optional

    Key pattern, up to 200 charactrers

  • count:

    number

    Optional

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

  • 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

  • application_id:

    number

    The application ID

  • application_name:

    string

    Optional

    The application name

Returns