Skip to content

Latest commit

 

History

History
234 lines (170 loc) · 7.22 KB

DevicesSharesApi.md

File metadata and controls

234 lines (170 loc) · 7.22 KB

DevicesSharesApi

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

Method HTTP request Description
createShareForDevice POST /devices/{deviceId}/shares Share a device
deleteSharingForDevice DELETE /devices/{deviceId}/shares/{shareId} Delete specific share of the given device id
getAllSharesForDevice GET /devices/{deviceId}/shares List all shares for the given device id
getSharingForDevice GET /devices/{deviceId}/shares/{shareId} Get specific share of the given device id

createShareForDevice

DeviceSharingId createShareForDevice(deviceId, deviceShareInfo)

Share a device

Share a device

Example

// Import classes:
//import cloud.artik.client.ApiClient;
//import cloud.artik.client.ApiException;
//import cloud.artik.client.Configuration;
//import cloud.artik.client.auth.*;
//import cloud.artik.api.DevicesSharesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: artikcloud_oauth
OAuth artikcloud_oauth = (OAuth) defaultClient.getAuthentication("artikcloud_oauth");
artikcloud_oauth.setAccessToken("YOUR ACCESS TOKEN");

DevicesSharesApi apiInstance = new DevicesSharesApi();
String deviceId = "deviceId_example"; // String | Device ID.
DeviceShareInfo deviceShareInfo = new DeviceShareInfo(); // DeviceShareInfo | Device object that needs to be added
try {
    DeviceSharingId result = apiInstance.createShareForDevice(deviceId, deviceShareInfo);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DevicesSharesApi#createShareForDevice");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
deviceId String Device ID.
deviceShareInfo DeviceShareInfo Device object that needs to be added

Return type

DeviceSharingId

Authorization

artikcloud_oauth

HTTP request headers

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

deleteSharingForDevice

DeviceSharingId deleteSharingForDevice(deviceId, shareId)

Delete specific share of the given device id

Delete specific share of the given device id

Example

// Import classes:
//import cloud.artik.client.ApiClient;
//import cloud.artik.client.ApiException;
//import cloud.artik.client.Configuration;
//import cloud.artik.client.auth.*;
//import cloud.artik.api.DevicesSharesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: artikcloud_oauth
OAuth artikcloud_oauth = (OAuth) defaultClient.getAuthentication("artikcloud_oauth");
artikcloud_oauth.setAccessToken("YOUR ACCESS TOKEN");

DevicesSharesApi apiInstance = new DevicesSharesApi();
String deviceId = "deviceId_example"; // String | Device ID.
String shareId = "shareId_example"; // String | Share ID.
try {
    DeviceSharingId result = apiInstance.deleteSharingForDevice(deviceId, shareId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DevicesSharesApi#deleteSharingForDevice");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
deviceId String Device ID.
shareId String Share ID.

Return type

DeviceSharingId

Authorization

artikcloud_oauth

HTTP request headers

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

getAllSharesForDevice

DeviceSharingEnvelope getAllSharesForDevice(deviceId, count, offset)

List all shares for the given device id

List all shares for the given device id

Example

// Import classes:
//import cloud.artik.client.ApiClient;
//import cloud.artik.client.ApiException;
//import cloud.artik.client.Configuration;
//import cloud.artik.client.auth.*;
//import cloud.artik.api.DevicesSharesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: artikcloud_oauth
OAuth artikcloud_oauth = (OAuth) defaultClient.getAuthentication("artikcloud_oauth");
artikcloud_oauth.setAccessToken("YOUR ACCESS TOKEN");

DevicesSharesApi apiInstance = new DevicesSharesApi();
String deviceId = "deviceId_example"; // String | Device ID.
Integer count = 56; // Integer | Desired count of items in the result set.
Integer offset = 56; // Integer | Offset for pagination.
try {
    DeviceSharingEnvelope result = apiInstance.getAllSharesForDevice(deviceId, count, offset);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DevicesSharesApi#getAllSharesForDevice");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
deviceId String Device ID.
count Integer Desired count of items in the result set. [optional]
offset Integer Offset for pagination. [optional]

Return type

DeviceSharingEnvelope

Authorization

artikcloud_oauth

HTTP request headers

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

getSharingForDevice

DeviceSharing getSharingForDevice(deviceId, shareId)

Get specific share of the given device id

Get specific share of the given device id

Example

// Import classes:
//import cloud.artik.client.ApiClient;
//import cloud.artik.client.ApiException;
//import cloud.artik.client.Configuration;
//import cloud.artik.client.auth.*;
//import cloud.artik.api.DevicesSharesApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: artikcloud_oauth
OAuth artikcloud_oauth = (OAuth) defaultClient.getAuthentication("artikcloud_oauth");
artikcloud_oauth.setAccessToken("YOUR ACCESS TOKEN");

DevicesSharesApi apiInstance = new DevicesSharesApi();
String deviceId = "deviceId_example"; // String | Device ID.
String shareId = "shareId_example"; // String | Share ID.
try {
    DeviceSharing result = apiInstance.getSharingForDevice(deviceId, shareId);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling DevicesSharesApi#getSharingForDevice");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
deviceId String Device ID.
shareId String Share ID.

Return type

DeviceSharing

Authorization

artikcloud_oauth

HTTP request headers

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