Menu

Expand

Config Subresource

You can provide configuration data for specific Microvisor-empowered IoT devices using the Config subresource. 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 device. For example, devices A and B can both have Configs with the key cloud_service_api_key, but each device can have only one Config with that key.

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 subresources are accessed at these endpoints:

https://microvisor.twilio.com/v1/Devices/{sid}/Configs
https://microvisor.twilio.com/v1/Devices/{UniqueName}/Configs

Device Configs are accessible only by the specified device. For Configs that are made available to all devices associated with a given account, please see Account-level 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 Device Secrets, which are, from the API perspective, write- and delete-only.

Configs can’t yet be updated. If you need to change a Config’s value, delete it first, and then create a new Config with the same key.

Device Config properties

Resource Properties in REST API format
device_sid
sid<UV> Not PII

A 34-character string that uniquely identifies the parent Device.

key
string Not PII

The config key; up to 100 characters.

value
string Not PII

The config value; up to 4096 characters.

date_updated
date_time<iso8601> Not PII

url
url Not PII

The absolute URL of the Config.

Create a Device Config

post
https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs
Parameters
Parameters in REST API format
device_sid
Path
post sid_like<UV> Not PII

A 34-character string that uniquely identifies the Device.

key
Required
post string Not PII

The config key; up to 100 characters.

value
Required
post string Not PII

The config value; up to 4096 characters.

Example 1
Loading Code Sample...
        
        

        Create a Device Config

        Retrieve a Device Config’s value

        get
        https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs/{Key}
        Parameters
        Parameters in REST API format
        device_sid
        Path
        get sid_like<UV> Not PII

        A 34-character string that uniquely identifies the Device.

        key
        Path
        get string Not PII

        The config key; up to 100 characters.

        Example 1
        Loading Code Sample...
              
              

              Retrieve a Device Config’s value

              List all of a Device’s Configs

              get
              https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs
              Parameters
              Parameters in REST API format
              device_sid
              Path
              get sid_like<UV> Not PII

              A 34-character string that uniquely identifies the Device.

              Example 1
              Loading Code Sample...
                    
                    

                    List all of a Device’s Configs

                    Delete a Device Config

                    delete
                    https://microvisor.twilio.com/v1/Devices/{DeviceSid}/Configs/{Key}
                    Parameters
                    Parameters in REST API format
                    device_sid
                    Path
                    delete sid_like<UV> Not PII

                    A 34-character string that uniquely identifies the Device.

                    key
                    Path
                    delete string Not PII

                    The config key; up to 100 characters.

                    Example 1
                    Loading Code Sample...
                          
                          

                          Delete a Device Config

                          Loading Code Sample...