Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Application Namespacing

Mike Jones edited this page May 28, 2013 · 1 revision

When a sandboxed vumi-go application is running it has access to various data-stores. When reading and writing from these data-stores you should consider the impact of design choices you make as a result.

Contact Store

Scope

When accessing the contact store via the API you are accessing the contacts for your vumi-go account.

Usage

The contacts store provides get, get_or_create, update, update_extras, update_subscriptions, new and save methods. Due to the wide scope, contacts available across conversation types. This means you can create an populate a contact via a USSD conversation in a javascript sandbox app and then send them follow up SMS's via another conversation type such as Sequential Send.

Extras are useful for storing application specific values against contacts (such as the date the signed up). However due to the account-level scope you should consider prefixing values to ensure the behaviour you expect. Currently when using the extras, remember that when setting extras just use the key name but when reading them back you need to append "extras-". E.g. my_app_signup (for write), extras-my_app_signup (for read).

Example application

See a short example of the code required here

Key-value Store

Scope

When accessing the key-value (kv) store via the API the keys are name-spaced using your vumi-go account key.

Usage

The kv store provides set, get and incr operations. This would allow you to count things like total users across a number of transports within your account.

Example application

See a short example of the code required here

Clone this wiki locally