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
|
A 34-character string that uniquely identifies this Device. |
unique_name
|
A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The |
account_sid
|
The unique SID identifier of the Account. |
app
|
Information about the target App and the App reported by this Device. Contains the properties |
logging
|
Object specifying whether application logging is enabled for this Device. Contains the properties |
date_created
|
The date that this Device was created, given in ISO 8601 format. |
date_updated
|
The date that this Device was last updated, given in ISO 8601 format. |
url
|
The URL of this resource. |
links
|
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
https://microvisor.twilio.com/v1/Devices/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34-character string that uniquely identifies this Device. |
Example 1
Get all Devices
https://microvisor.twilio.com/v1/Devices
Example 1
Update a Device
https://microvisor.twilio.com/v1/Devices/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
A 34-character string that uniquely identifies this Device. |
unique_name
Optional
|
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
|
The SID or unique name of the App to be targeted to the Device. |
logging_enabled
Optional
|
A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. |
restart_app
Optional
|
Set to true to restart the App running on the Device. |
Example 1
Remember, a Device can be identified either by is SID, or by its unique name, if you have applied one.
Example 2
Example 3
Application code logging is enabled by default.
Example 4
Restarting an app using this call will instruct Microvisor to start the loaded application afresh. This can be a useful call to make during remote debugging, particularly if your application is experiencing unexpected behavior right after it starts.