Arduino IoT Cloud API

DashboardsV2

dashboardsV2Create

create dashboards_v2

Create a new dashboard


/v2/dashboards

Usage and SDK Samples

curl -X POST "https://api2.arduino.cc/iot/v2/dashboards"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var dashboardv2 = ; // {Dashboardv2} 
api.dashboardsV2Create(dashboardv2).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
dashboardv2 =  # Dashboardv2 | 

try: 
    # create dashboards_v2
    api_response = api_instance.dashboards_v2_create(dashboardv2)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2Create: %s\n" % e)

Scopes

Parameters

Body parameters
Name Description
dashboardv2 *

DashboardV2Payload describes a dashboard

Responses


dashboardsV2Delete

delete dashboards_v2

Delete a dashboard


/v2/dashboards/{id}

Usage and SDK Samples

curl -X DELETE "https://api2.arduino.cc/iot/v2/dashboards/{id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
api.dashboardsV2Delete(id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)

try: 
    # delete dashboards_v2
    api_instance.dashboards_v2_delete(id)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2Delete: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required

Responses


dashboardsV2DeleteShare

deleteShare dashboards_v2

Delete a user the dashboard has been shared with


/v2/dashboards/{id}/shares/{user_id}

Usage and SDK Samples

curl -X DELETE "https://api2.arduino.cc/iot/v2/dashboards/{id}/shares/{user_id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
var userId = userId_example; // {String} The id of the user
api.dashboardsV2DeleteShare(id, userId).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)
userId = userId_example # String | The id of the user (default to null)

try: 
    # deleteShare dashboards_v2
    api_instance.dashboards_v2_delete_share(id, userId)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2DeleteShare: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required
user_id*
String
The id of the user
Required

Responses



dashboardsV2List

list dashboards_v2

Returns the list of dashboards


/v2/dashboards

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/dashboards?name=&user_id="
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var opts = {
  'name': name_example, // {String} The name of the dashboard
  'userId': userId_example // {String} The user_id of the dashboard's owner
};
api.dashboardsV2List(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
name = name_example # String | The name of the dashboard (optional) (default to null)
userId = userId_example # String | The user_id of the dashboard's owner (optional) (default to null)

try: 
    # list dashboards_v2
    api_response = api_instance.dashboards_v2_list(name=name, userId=userId)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2List: %s\n" % e)

Scopes

Parameters

Query parameters
Name Description
name
String
The name of the dashboard
user_id
String
The user_id of the dashboard's owner

Responses


dashboardsV2ListShares

listShares dashboards_v2

List of users the dashboard has been shared with


/v2/dashboards/{id}/shares

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/dashboards/{id}/shares"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
api.dashboardsV2ListShares(id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)

try: 
    # listShares dashboards_v2
    api_response = api_instance.dashboards_v2_list_shares(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2ListShares: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required

Responses


dashboardsV2RequestAccess

requestAccess dashboards_v2

Request access to a dashboard


/v2/dashboards/{id}/share_request

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/dashboards/{id}/share_request"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
var sharerequest = ; // {Sharerequest} 
api.dashboardsV2RequestAccess(id, sharerequest).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)
sharerequest =  # Sharerequest | 

try: 
    # requestAccess dashboards_v2
    api_instance.dashboards_v2_request_access(id, sharerequest)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2RequestAccess: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required
Body parameters
Name Description
sharerequest *

Responses


dashboardsV2Share

share dashboards_v2

Share a dashboard


/v2/dashboards/{id}/shares

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/dashboards/{id}/shares"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
var dashboardshare = ; // {Dashboardshare} 
api.dashboardsV2Share(id, dashboardshare).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)
dashboardshare =  # Dashboardshare | 

try: 
    # share dashboards_v2
    api_instance.dashboards_v2_share(id, dashboardshare)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2Share: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required
Body parameters
Name Description
dashboardshare *

Responses


dashboardsV2Show

show dashboards_v2

Show a dashboard


/v2/dashboards/{id}

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/dashboards/{id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
api.dashboardsV2Show(id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)

try: 
    # show dashboards_v2
    api_response = api_instance.dashboards_v2_show(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2Show: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required

Responses


dashboardsV2Update

update dashboards_v2

Updates an existing dashboard


/v2/dashboards/{id}

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/dashboards/{id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');

var api = new ArduinoIotClient.DashboardsV2Api()
var id = id_example; // {String} The id of the dashboard
var dashboardv2 = ; // {Dashboardv2} 
api.dashboardsV2Update(id, dashboardv2).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = openapi_client.DashboardsV2Api()
id = id_example # String | The id of the dashboard (default to null)
dashboardv2 =  # Dashboardv2 | 

try: 
    # update dashboards_v2
    api_response = api_instance.dashboards_v2_update(id, dashboardv2)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DashboardsV2Api->dashboardsV2Update: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the dashboard
Required
Body parameters
Name Description
dashboardv2 *

DashboardV2Payload describes a dashboard

Responses


DevicesV2

devicesV2Create

create devices_v2

Creates a new device associated to the user.


/v2/devices

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/devices"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var createDevicesV2Payload = ; // {CreateDevicesV2Payload} 
api.devicesV2Create(createDevicesV2Payload).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
createDevicesV2Payload =  # CreateDevicesV2Payload | 

try: 
    # create devices_v2
    api_response = api_instance.devices_v2_create(createDevicesV2Payload)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2Create: %s\n" % e)

Scopes

Parameters

Body parameters
Name Description
createDevicesV2Payload *

DeviceV2 describes a device.

Responses


devicesV2Delete

delete devices_v2

Removes a device associated to the user


/v2/devices/{id}

Usage and SDK Samples

curl -X DELETE "https://api2.arduino.cc/iot/v2/devices/{id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
api.devicesV2Delete(id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)

try: 
    # delete devices_v2
    api_instance.devices_v2_delete(id)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2Delete: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required

Responses


devicesV2GetEvents

getEvents devices_v2

GET device events


/v2/devices/{id}/events

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices/{id}/events?limit=&start="
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
var opts = {
  'limit': 56, // {Integer} The number of events to select
  'start': start_example // {String} The time at which to start selecting events
};
api.devicesV2GetEvents(id, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)
limit = 56 # Integer | The number of events to select (optional) (default to null)
start = start_example # String | The time at which to start selecting events (optional) (default to null)

try: 
    # getEvents devices_v2
    api_response = api_instance.devices_v2_get_events(id, limit=limit, start=start)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2GetEvents: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
Query parameters
Name Description
limit
Integer
The number of events to select
start
String
The time at which to start selecting events

Responses


devicesV2GetProperties

getProperties devices_v2

GET device properties


/v2/devices/{id}/properties

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices/{id}/properties?show_deleted="
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
var opts = {
  'showDeleted': true // {Boolean} If true, shows the soft deleted properties
};
api.devicesV2GetProperties(id, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)
showDeleted = true # Boolean | If true, shows the soft deleted properties (optional) (default to false)

try: 
    # getProperties devices_v2
    api_response = api_instance.devices_v2_get_properties(id, showDeleted=showDeleted)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2GetProperties: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
Query parameters
Name Description
show_deleted
Boolean
If true, shows the soft deleted properties

Responses


devicesV2List

list devices_v2

Returns the list of devices associated to the user


/v2/devices

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices?across_user_ids=&serial=&tags="
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var opts = {
  'acrossUserIds': true, // {Boolean} If true, returns all the devices
  'serial': serial_example, // {String} Filter by device serial number
  'tags':  // {array[String]} Filter by tags
};
api.devicesV2List(opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
acrossUserIds = true # Boolean | If true, returns all the devices (optional) (default to false)
serial = serial_example # String | Filter by device serial number (optional) (default to null)
tags =  # array[String] | Filter by tags (optional) (default to null)

try: 
    # list devices_v2
    api_response = api_instance.devices_v2_list(acrossUserIds=acrossUserIds, serial=serial, tags=tags)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2List: %s\n" % e)

Scopes

Parameters

Query parameters
Name Description
across_user_ids
Boolean
If true, returns all the devices
serial
String
Filter by device serial number
tags
array[String]
Filter by tags

Responses


devicesV2Show

show devices_v2

Returns the device requested by the user


/v2/devices/{id}

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices/{id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
api.devicesV2Show(id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)

try: 
    # show devices_v2
    api_response = api_instance.devices_v2_show(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2Show: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required

Responses


devicesV2Timeseries

timeseries devices_v2

GET device properties values in a range of time


/v2/devices/{id}/properties/{pid}

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices/{id}/properties/{pid}?limit=&start="
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
var pid = pid_example; // {String} The id of the property
var opts = {
  'limit': 56, // {Integer} The number of properties to select
  'start': start_example // {String} The time at which to start selecting properties
};
api.devicesV2Timeseries(id, pid, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)
pid = pid_example # String | The id of the property (default to null)
limit = 56 # Integer | The number of properties to select (optional) (default to null)
start = start_example # String | The time at which to start selecting properties (optional) (default to null)

try: 
    # timeseries devices_v2
    api_response = api_instance.devices_v2_timeseries(id, pid, limit=limit, start=start)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2Timeseries: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
pid*
String
The id of the property
Required
Query parameters
Name Description
limit
Integer
The number of properties to select
start
String
The time at which to start selecting properties

Responses


devicesV2Update

update devices_v2

Updates a device associated to the user


/v2/devices/{id}

Usage and SDK Samples

curl -X POST "https://api2.arduino.cc/iot/v2/devices/{id}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
var devicev2 = ; // {Devicev2} 
api.devicesV2Update(id, devicev2).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)
devicev2 =  # Devicev2 | 

try: 
    # update devices_v2
    api_response = api_instance.devices_v2_update(id, devicev2)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2Update: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
Body parameters
Name Description
devicev2 *

DeviceV2 describes a device.

Responses


devicesV2UpdateProperties

updateProperties devices_v2

Update device properties last values


/v2/devices/{id}/properties

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/devices/{id}/properties"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2Api()
var id = id_example; // {String} The id of the device
var propertiesValues = ; // {PropertiesValues} 
api.devicesV2UpdateProperties(id, propertiesValues).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2Api()
id = id_example # String | The id of the device (default to null)
propertiesValues =  # PropertiesValues | 

try: 
    # updateProperties devices_v2
    api_instance.devices_v2_update_properties(id, propertiesValues)
except ApiException as e:
    print("Exception when calling DevicesV2Api->devicesV2UpdateProperties: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
Body parameters
Name Description
propertiesValues *

Responses


DevicesV2Certs

devicesV2CertsCreate

create devices_v2_certs

Creates a new cert associated to a device. The csr is signed and saved in database. The CommonName will be replaced with the device id.


/v2/devices/{id}/certs

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/devices/{id}/certs"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2CertsApi()
var id = id_example; // {String} The id of the device
var createDevicesV2CertsPayload = ; // {CreateDevicesV2CertsPayload} 
api.devicesV2CertsCreate(id, createDevicesV2CertsPayload).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2CertsApi()
id = id_example # String | The id of the device (default to null)
createDevicesV2CertsPayload =  # CreateDevicesV2CertsPayload | 

try: 
    # create devices_v2_certs
    api_response = api_instance.devices_v2_certs_create(id, createDevicesV2CertsPayload)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2CertsApi->devicesV2CertsCreate: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
Body parameters
Name Description
createDevicesV2CertsPayload *

Responses


devicesV2CertsDelete

delete devices_v2_certs

Removes a cert associated to a device


/v2/devices/{id}/certs/{cid}

Usage and SDK Samples

curl -X DELETE "https://api2.arduino.cc/iot/v2/devices/{id}/certs/{cid}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2CertsApi()
var cid = cid_example; // {String} The id of the cert
var id = id_example; // {String} The id of the device
api.devicesV2CertsDelete(cid, id).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2CertsApi()
cid = cid_example # String | The id of the cert (default to null)
id = id_example # String | The id of the device (default to null)

try: 
    # delete devices_v2_certs
    api_instance.devices_v2_certs_delete(cid, id)
except ApiException as e:
    print("Exception when calling DevicesV2CertsApi->devicesV2CertsDelete: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
cid*
String
The id of the cert
Required
id*
String
The id of the device
Required

Responses


devicesV2CertsList

list devices_v2_certs

Returns the list of certs associated to the device


/v2/devices/{id}/certs

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices/{id}/certs"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2CertsApi()
var id = id_example; // {String} The id of the device
api.devicesV2CertsList(id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2CertsApi()
id = id_example # String | The id of the device (default to null)

try: 
    # list devices_v2_certs
    api_response = api_instance.devices_v2_certs_list(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2CertsApi->devicesV2CertsList: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required

Responses


devicesV2CertsShow

show devices_v2_certs

Returns the cert requested by the user


/v2/devices/{id}/certs/{cid}

Usage and SDK Samples

curl -X GET "https://api2.arduino.cc/iot/v2/devices/{id}/certs/{cid}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2CertsApi()
var cid = cid_example; // {String} The id of the cert
var id = id_example; // {String} The id of the device
api.devicesV2CertsShow(cid, id).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2CertsApi()
cid = cid_example # String | The id of the cert (default to null)
id = id_example # String | The id of the device (default to null)

try: 
    # show devices_v2_certs
    api_response = api_instance.devices_v2_certs_show(cid, id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2CertsApi->devicesV2CertsShow: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
cid*
String
The id of the cert
Required
id*
String
The id of the device
Required

Responses


devicesV2CertsUpdate

update devices_v2_certs

Updates a cert associated to a device. The csr is signed and saved in database. The CommonName will be replaced with the device id.


/v2/devices/{id}/certs/{cid}

Usage and SDK Samples

curl -X POST "https://api2.arduino.cc/iot/v2/devices/{id}/certs/{cid}"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2CertsApi()
var cid = cid_example; // {String} The id of the cert
var id = id_example; // {String} The id of the device
var devicev2Cert = ; // {Devicev2Cert} 
api.devicesV2CertsUpdate(cid, id, devicev2Cert).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2CertsApi()
cid = cid_example # String | The id of the cert (default to null)
id = id_example # String | The id of the device (default to null)
devicev2Cert =  # Devicev2Cert | 

try: 
    # update devices_v2_certs
    api_response = api_instance.devices_v2_certs_update(cid, id, devicev2Cert)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DevicesV2CertsApi->devicesV2CertsUpdate: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
cid*
String
The id of the cert
Required
id*
String
The id of the device
Required
Body parameters
Name Description
devicev2Cert *

Responses


DevicesV2Ota

devicesV2OtaSend

send devices_v2_ota

Send a binary url to a device


/v2/devices/{id}/ota

Usage and SDK Samples

curl -X PUT "https://api2.arduino.cc/iot/v2/devices/{id}/ota"
var ArduinoIotClient = require('@arduino/arduino-iot-client');
var defaultClient = ArduinoIotClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN"

var api = new ArduinoIotClient.DevicesV2OtaApi()
var id = id_example; // {String} The id of the device
var devicev2Otabinaryurl = ; // {Devicev2Otabinaryurl} 
api.devicesV2OtaSend(id, devicev2Otabinaryurl).then(function() {
  console.log('API called successfully.');
}, function(error) {
  console.error(error);
});

from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = openapi_client.DevicesV2OtaApi()
id = id_example # String | The id of the device (default to null)
devicev2Otabinaryurl =  # Devicev2Otabinaryurl | 

try: 
    # send devices_v2_ota
    api_instance.devices_v2_ota_send(id, devicev2Otabinaryurl)
except ApiException as e:
    print("Exception when calling DevicesV2OtaApi->devicesV2OtaSend: %s\n" % e)

Scopes

Parameters

Path parameters
Name Description
id*
String
The id of the device
Required
Body parameters
Name Description
devicev2Otabinaryurl *

Responses