custom-phone-provider
Actions trigger includes the following:
api.cache
api.cache.delete(key)
CacheWriteResult
object with type: "success"
if a value was removed from the cache. A failed operation returns type: "error"
. For errors, the returned object will have a code property that indicates the nature of the failure.
Parameter | Description |
---|---|
key | String. The key of the record stored in the cache. |
api.cache.get(key)
key
. Cache records are objects with a value
property holding the cached value as well as an expires_at
property indicating the maximum expiry of the record in milliseconds since the Unix epoch.
Important: This cache is designed for short-lived, ephemeral data. Items may not be available in later transactions even if they are within their supplied their lifetime.
Parameter | Description |
---|---|
key | String. The key of the record stored in the cache. |
api.cache.set(key, value, [options])
ttl
or expires_at
values. If no lifetime is specified, a default of lifetime of 15 minutes will be used. Lifetimes may not exceed the maximum duration listed at Actions Cache Limits.
options.ttl
Optional number. The time-to-live value of this cache entry in milliseconds. While cached values may be evicted earlier, they will never remain beyond the the supplied ttl
.
Note: This value should not be supplied if a value was also provided for expires_at
. If both options are supplied, the earlier expiry of the two will be used.
Parameter | Description |
---|---|
key | String. The key of the record stored in the cache. |
value | String. The value of the record to be stored. |
options | Optional object. Options for adjusting cache behavior. |
options.expires_at | Optional number. The absolute expiry time in milliseconds since the unix epoch. While cached records may be evicted earlier, they will never remain beyond the the supplied Note: This value should not be supplied if a value was also provided for |
api.notification
api.notification.drop(reason)
(fn)
, but won’t be sending it again to the action in the future.
If you need this notification event to be retried, consider calling api.notification.retry
instead.
Parameter | Description |
---|---|
reason | Optional String. This will be part of the log entry, this will help you analyze the error further. Please note that this field is limited to 1024 characters and will be truncated if longer. |
api.notification.retry(reason)
(fn)
, but we will retry it up to 5 times in the next few minutes.
If you consider that this notification event should not be retried, consider calling api.notification.drop
instead.
Parameter | Description |
---|---|
reason | Optional String. This will be part of the log entry, this will help you analyze the error further. Please note that this field is limited to 1024 characters and will be truncated if longer. |