Skip to content

Latest commit

 

History

History
executable file
·
180 lines (125 loc) · 5 KB

File metadata and controls

executable file
·
180 lines (125 loc) · 5 KB

ArtikCloud.DevicesStatusApi

All URIs are relative to https://api.artik.cloud/v1.1

Method HTTP request Description
getDeviceStatus GET /devices/{deviceId}/status Get Device Status
getDevicesStatus GET /devices/status Get Devices Status
putDeviceStatus PUT /devices/{deviceId}/status Update Device Status

getDeviceStatus

DeviceStatus getDeviceStatus(deviceId, opts)

Get Device Status

Get Device Status

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

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

var apiInstance = new ArtikCloud.DevicesStatusApi()

var deviceId = "deviceId_example"; // {String} Device ID.

var opts = { 
  'includeSnapshot': true, // {Boolean} Include device snapshot into the response
  'includeSnapshotTimestamp': true // {Boolean} Include device snapshot timestamp into the response
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDeviceStatus(deviceId, opts, callback);

Parameters

Name Type Description Notes
deviceId String Device ID.
includeSnapshot Boolean Include device snapshot into the response [optional]
includeSnapshotTimestamp Boolean Include device snapshot timestamp into the response [optional]

Return type

DeviceStatus

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json

getDevicesStatus

DeviceStatusBatch getDevicesStatus(dids, opts)

Get Devices Status

Get Devices Status

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

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

var apiInstance = new ArtikCloud.DevicesStatusApi()

var dids = "dids_example"; // {String} List of device ids (comma-separated) for which the statuses are requested.

var opts = { 
  'includeSnapshot': true, // {Boolean} Include device snapshot into the response
  'includeSnapshotTimestamp': true // {Boolean} Include device snapshot timestamp into the response
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getDevicesStatus(dids, opts, callback);

Parameters

Name Type Description Notes
dids String List of device ids (comma-separated) for which the statuses are requested.
includeSnapshot Boolean Include device snapshot into the response [optional]
includeSnapshotTimestamp Boolean Include device snapshot timestamp into the response [optional]

Return type

DeviceStatusBatch

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json

putDeviceStatus

DeviceStatus putDeviceStatus(deviceId, opts)

Update Device Status

Update Device Status

Example

var ArtikCloud = require('artikcloud-js');
var defaultClient = ArtikCloud.ApiClient.default;

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

var apiInstance = new ArtikCloud.DevicesStatusApi()

var deviceId = "deviceId_example"; // {String} Device ID.

var opts = { 
  'body': new ArtikCloud.DeviceStatusPut() // {DeviceStatusPut} Body
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.putDeviceStatus(deviceId, opts, callback);

Parameters

Name Type Description Notes
deviceId String Device ID.
body DeviceStatusPut Body [optional]

Return type

DeviceStatus

Authorization

artikcloud_oauth

HTTP reuqest headers

  • Content-Type: Not defined
  • Accept: application/json