A small key-value store your API can use to persist its own JSON documents on the nandbox server, so a bot can keep state without running its own database.
Each document is identified by three things together:
Part | Meaning |
app_id | The app the document belongs to. |
doc_type | A category you choose β for example "cart", "profile", "settings". |
doc_id | The identifier of a single document within that type. |
The document body itself is
doc, a string β typically your own JSON, serialized.π‘ Storing a document with anapp_id+doc_type+doc_idthat already exists overwrites it. There is no separate create and update.
Correlating requests and responses
These four methods use
ref, not reference, as the correlation id. Whatever you send as ref is echoed back in the matching response.Methods
Method | Purpose | Response |
extensionSetDoc | Create or overwrite a document | extensionSetDocResponse |
extensionGetDoc | Retrieve one document | extensionGetDocResponse |
extensionListDoc | List all documents of a type | extensionListDocResponse |
extensionDeleteDoc | Delete one document | extensionDeleteDocResponse |
All four responses arrive on the same SDK callback:
SDK | Callback |
Java | onExtensionDocResponse(ExtensionDocResponse response) |
JavaScript | onExtensionDocResponse(response) |
Python | on_extension_doc_response(self, response) |
The SDKs set a
extensionSetDocextensionGetDocextensionListDocextensionDeleteDoctype of insert, get, list or delete on the response object so you can tell which operation it answers.