All URIs are relative to https://api.artik.cloud/v1.1
| Method | HTTP request | Description |
|---|---|---|
| addDevice | POST /devices | Add Device |
| deleteDevice | DELETE /devices/{deviceId} | Delete Device |
| deleteDeviceToken | DELETE /devices/{deviceId}/tokens | Delete Device Token |
| getDevice | GET /devices/{deviceId} | Get Device |
| getDevicePresence | GET /devices/{deviceId}/presence | Get device presence information |
| getDeviceToken | GET /devices/{deviceId}/tokens | Get Device Token |
| updateDevice | PUT /devices/{deviceId} | Update Device |
| updateDeviceToken | PUT /devices/{deviceId}/tokens | Update Device Token |
DeviceEnvelope addDevice(device)
Add Device
Create a device
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.DevicesApi()
var device = new ArtikCloud.Device(); // {Device} Device to be added to the user
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.addDevice(device, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| device | Device | Device to be added to the user |
- Content-Type: application/json
- Accept: application/json
DeviceEnvelope deleteDevice(deviceId)
Delete Device
Deletes a device
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} deviceId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deleteDevice(deviceId, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | deviceId |
- Content-Type: Not defined
- Accept: application/json
DeviceTokenEnvelope deleteDeviceToken(deviceId)
Delete Device Token
Deletes a device's token
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} deviceId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deleteDeviceToken(deviceId, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | deviceId |
- Content-Type: Not defined
- Accept: application/json
DeviceEnvelope getDevice(deviceId)
Get Device
Retrieves a device
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} deviceId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getDevice(deviceId, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | deviceId |
- Content-Type: Not defined
- Accept: application/json
PresenceEnvelope getDevicePresence(deviceId)
Get device presence information
Return the presence status of the given device along with the time it was last seen
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} Device ID.
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getDevicePresence(deviceId, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | Device ID. |
- Content-Type: Not defined
- Accept: application/json
DeviceTokenEnvelope getDeviceToken(deviceId)
Get Device Token
Retrieves a device's token
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} deviceId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getDeviceToken(deviceId, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | deviceId |
- Content-Type: Not defined
- Accept: application/json
DeviceEnvelope updateDevice(deviceId, device)
Update Device
Updates a device
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} deviceId
var device = new ArtikCloud.Device(); // {Device} Device to be updated
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.updateDevice(deviceId, device, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | deviceId | |
| device | Device | Device to be updated |
- Content-Type: application/json
- Accept: application/json
DeviceTokenEnvelope updateDeviceToken(deviceId)
Update Device Token
Updates a device's token
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.DevicesApi()
var deviceId = "deviceId_example"; // {String} deviceId
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.updateDeviceToken(deviceId, callback);| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | deviceId |
- Content-Type: text/plain
- Accept: application/json