Menu

Expand
Rate this page:

Device Resource

Microvisor Public Beta

Microvisor is in a pre-release phase and the information contained in this document is subject to change. Some features referenced below may not be fully available until Microvisor’s General Availability (GA) release.

A Device instance represents a single Microvisor-empowered IoT device. For clarity, device (no cap) refers to physical hardware. Device (initial cap) refers to a Device API resource.

Device resources are accessed at this endpoint:

https://microvisor.twilio.com/v1/Devices

Make a GET request to the endpoint to receive a list (in JSON) of all Device resources.

Every Device instance can be referenced in the API either by its unique SID or a user-defined unique name:

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

The Device instance representing a real device is used to deploy uploaded code to that device.

Customers may request that device data be deleted. If you wish to do so, please contact our support team. For more information on Twilio’s data retention and deletion policy, please see this support document.

Device properties

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

A 34-character string that uniquely identifies this Device.

unique_name
string Not PII

A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The unique_name value may be used as an alternative to the sid in the URL path to address the resource.

account_sid
sid<AC> Not PII

The unique SID identifier of the Account.

app
object Not PII

Information about the target App and the App reported by this Device. Contains the properties target_sid, date_targeted, update_status (one of up-to-date, pending and error), update_error_code, reported_sid and date_reported.

logging
object Not PII

Object specifying whether application logging is enabled for this Device. Contains the properties enabled and date_expires.

date_created
date_time<iso8601> Not PII

The date that this Device was created, given in ISO 8601 format.

date_updated
date_time<iso8601> Not PII

The date that this Device was last updated, given in ISO 8601 format.

url
url Not PII

The URL of this resource.

links
uri_map Not PII

The absolute URLs of related resources.

Status values

The table below describes the available status values of a Device instance:

Status Description
up-to-date The device has received with the most recent application code deployed to it
scheduled Application code has been marked for deployment but has yet to be installed on the device
error Application code marked for deployment could not be downloaded for some reason

Get a Device

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

A 34-character string that uniquely identifies this Device.

Example 1
Loading Code Sample...
        
        

        Request a single Device resource

        Get all Devices

        get
        https://microvisor.twilio.com/v1/Devices
        Example 1
        Loading Code Sample...
              
              

              Request a list of Device resources

              Update a Device

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

              A 34-character string that uniquely identifies this Device.

              unique_name
              Optional
              post string Not PII

              A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID.

              target_app
              Optional
              post sid_like<KA> Not PII

              The SID or unique name of the App to be targeted to the Device.

              logging_enabled
              Optional
              post boolean Not PII

              A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours.

              Example 1
              Loading Code Sample...
                    
                    

                    Give a Device a memorable name

                    Remember, a Device can be identified either by is SID, or by its unique name, if you have applied one.

                    Example 2
                    Loading Code Sample...
                          
                          

                          Deploy an App to the Device

                          Example 3
                          Loading Code Sample...
                                
                                

                                Enable application code logging

                                Application code logging is enabled by default.

                                Rate this page:

                                Need some help?

                                We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                Loading Code Sample...
                                      
                                      
                                      

                                      Thank you for your feedback!

                                      Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                      Sending your feedback...
                                      🎉 Thank you for your feedback!
                                      Something went wrong. Please try again.

                                      Thanks for your feedback!

                                      thanks-feedback-gif