Rate this page:

ApplicationStorage

Represents an application storage object to manipulate key-value pairs. Add the following line to your scenario code to use the class:

require(Modules.ApplicationStorage);

Methods

delete

Copy URL
delete(key: 

string

):

Promise<StorageKey>

Deletes the specified key. Note that the returned StorageKey always has zero ttl.

Parameters

  • key:

    string

    Key to delete.

Returns

get

Copy URL
get(key: 

string

):

Promise<StorageKey,null>

Retrieves a value of the specified key.

Parameters

  • key:

    string

    Key to get

Returns

put

Copy URL
put(key: 

string

,
value:

string

,
ttl:

number

):

Promise<StorageKey>

Creates a key-value pair. If an already existing key is passed, the method will update its value.The keys should be unique within a Voximplant application.

Parameters

  • key:

    string

    Key to create/update, up to 200 characters

  • value:

    string

    Value for the specified key, up to 2000 characters

  • ttl:

    number

    Key expiry time in seconds. The value is in range of 0..7,776,000 (90 days). The TTL is converted to an expireAt Unix timestamp field as part of the storage object. Note that the pricing is tiered in three day-based pieces: 0-30, 31-60, 61-90. See the details here

Returns