Methods
This page describes the available methods within the HTML Canvas class
HTML Canvas methods
Returns the available Authentication Headers accordingly if the dashboard is public or not.
Embed a url's content in a drawer and displays it.
Changes the currently selected device(s) in either multiple or single-device dynamic dashboards.
Changes the selected time range in a dashboard.
Turn on or off the dashboard's real time update.
Refreshes the dashboard data in all widget.
Navigates to another layer.
Arguments: None
Signature: ubidots.getHeaders()
Return:
{
Authorization: "Bearer receivedJWTToken",
Content-type: "application/json"
}
{
X-Auth-Token: "BBFF-xxyyzz",
Content-type: "application/json"
}
Arguments: options: Object [mandatory] => An object containing the content's url and the drawer's width in px:
Signature:
Return: None
setDashboardDevices
Arguments: deviceIds: string [Mandatory] ⇒ Comma separated string with the Id's of the devices that you want to set.
Signature: ubidots.setDashboardDevices(<deviceIds>)
Return: None
setDashboardDateRange
Arguments: timeframe: Object [Mandatory] => An object containing the start and end timestamps:
Signature: ubidots.setDashboardDateRange(<timeframe>)
Return: None
Arguments: rt: Bool [Mandatory] => A boolean indicating the real time update setting
Signature: ubidots.setRealTime(<rt>)
Return: None
refreshDashboard
Arguments: None
Signature: ubidots.refreshDashboard()
Return: None
Arguments: screenSetting: string(toggle | enable | disabled) [Mandatory] => A string representing the full screen setting.
Signature: ubidots.setFullScreen(<screenSetting>)
Return: None
setDashboardLayer
Arguments:
layer: string [Mandatory] ⇒ layer ID or label.
Use ID as a plain string: "6926000dcb198b4d10067b58"
Use label prefixed with ~: "~Layer-2"
queryParams: Object [Optional] ⇒ An object where each key/value pair will be added as a query param.
Allowed value types: string | number | boolean
Arrays are NOT allowed. If you need multiple values, pass a comma-separated string, e.g. "id1,id2,id3"