Config resource
You can provide configuration data for multiple Microvisor-empowered IoT devices using the Config resource. Configs are intended as a way to upload data such as API keys, PKI certificates, and other items to the Twilio cloud so they need not be baked into application code. Instead, the application code running on the device retrieves the Config when it needs the information.
Each Config is a key:value pair which your application code can access using Microvisor System Calls.
Keys are text identifiers of up to 100 characters in length. They must be unique for a given account.
Values must also be supplied as text, of up to 4096 characters in length. If you wish to make binary data available to your devices, you will need to encode it as text before creating the Config. For example, you might used base64 encoding. Your application must decode the value back to binary after acquiring it from the Twilio cloud.
Config resources are accessed at this endpoint:
_10https://microvisor.twilio.com/v1/Configs
Config resources are accessible from all devices associated with an account. For Configs that are made available to specific devices, please see Device Configs.
It is possible for anyone with account access to read back the value of any Config. If you have information which, once created, you would not like to be accessible to other account holders, use Secrets, which are, from the API perspective, write- and delete-only.
Property nameTypeRequiredDescriptionChild properties
The config key; up to 100 characters.
date_updatedstring<date-time>Optional
The config value; up to 4096 characters.
The absolute URL of the Config.
POST https://microvisor.twilio.com/v1/Configs
Encoding type:application/x-www-form-urlencoded
Property nameTypeRequiredDescriptionChild properties
The config key; up to 100 characters.
The config value; up to 4096 characters.
{
"Key": "first,",
"Value": "first val"
}
_19// Download the helper library from https://www.twilio.com/docs/node/install
_19const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19// Find your Account SID and Auth Token at twilio.com/console
_19// and set the environment variables. See http://twil.io/secure
_19const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19const authToken = process.env.TWILIO_AUTH_TOKEN;
_19const client = twilio(accountSid, authToken);
_19async function createAccountConfig() {
_19 const accountConfig = await client.microvisor.v1.accountConfigs.create({
_19 console.log(accountConfig.key);
_19createAccountConfig();
_10 "date_updated": "2021-01-01T12:34:56Z",
_10 "url": "https://microvisor.twilio.com/v1/Configs/first"
GET https://microvisor.twilio.com/v1/Configs/{Key}
Property nameTypeRequiredPIIDescription
The config key; up to 100 characters.
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function fetchAccountConfig() {
_18 const accountConfig = await client.microvisor.v1
_18 .accountConfigs("Key_name")
_18 console.log(accountConfig.key);
_10 "date_updated": "2021-01-01T12:34:57Z",
_10 "url": "https://microvisor.twilio.com/v1/Configs/first"
DELETE https://microvisor.twilio.com/v1/Configs/{Key}
Property nameTypeRequiredPIIDescription
The config key; up to 100 characters.
_14// Download the helper library from https://www.twilio.com/docs/node/install
_14const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_14// Find your Account SID and Auth Token at twilio.com/console
_14// and set the environment variables. See http://twil.io/secure
_14const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14const authToken = process.env.TWILIO_AUTH_TOKEN;
_14const client = twilio(accountSid, authToken);
_14async function deleteAccountConfig() {
_14 await client.microvisor.v1.accountConfigs("key_name").remove();
_14deleteAccountConfig();