Skip to content

Latest commit

 

History

History
1295 lines (1058 loc) · 47.3 KB

DevicesApi.md

File metadata and controls

1295 lines (1058 loc) · 47.3 KB

Com.Lab5e.Span.Api.DevicesApi

All URIs are relative to https://api.lab5e.com

Method HTTP request Description
AddDownstreamMessage POST /span/collections/{collectionId}/devices/{deviceId}/outbox Add message to oubox
CreateDevice POST /span/collections/{collectionId}/devices Create device
DeleteDevice DELETE /span/collections/{collectionId}/devices/{deviceId} Remove device.
DeleteDownstreamMessage DELETE /span/collections/{collectionId}/devices/{deviceId}/outbox/{messageId} Delete outgoing message
DeviceCertificate GET /span/collections/{collectionId}/devices/{deviceId}/certs Get issued certificate(s) for device
ListDeviceData GET /span/collections/{collectionId}/devices/{deviceId}/data Retrieve data from device
ListDevices GET /span/collections/{collectionId}/devices List devices in collection.
ListDownstreamMessages GET /span/collections/{collectionId}/devices/{deviceId}/outbox List the messages in the outbox
ListUpstreamMessages GET /span/collections/{collectionId}/devices/{deviceId}/inbox List incoming messages
RetrieveDevice GET /span/collections/{collectionId}/devices/{deviceId} Retrieve device
RetrieveDeviceStats GET /span/collections/{collectionId}/devices/{deviceId}/stats Retrieve device statistics
UpdateDevice PATCH /span/collections/{existingCollectionId}/devices/{deviceId} Update device

AddDownstreamMessage

MessageDownstream AddDownstreamMessage (string collectionId, string deviceId, AddDownstreamMessageBody body)

Add message to oubox

Add a new message in the outgoing queue to the device. If there is other messages in the outbox these messages will be sent first.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class AddDownstreamMessageExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 
            var body = new AddDownstreamMessageBody(); // AddDownstreamMessageBody | 

            try
            {
                // Add message to oubox
                MessageDownstream result = apiInstance.AddDownstreamMessage(collectionId, deviceId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.AddDownstreamMessage: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the AddDownstreamMessageWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Add message to oubox
    ApiResponse<MessageDownstream> response = apiInstance.AddDownstreamMessageWithHttpInfo(collectionId, deviceId, body);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.AddDownstreamMessageWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string
deviceId string
body AddDownstreamMessageBody

Return type

MessageDownstream

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateDevice

Device CreateDevice (string collectionId, CreateDeviceBody body)

Create device

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class CreateDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | This is the containing collection
            var body = new CreateDeviceBody(); // CreateDeviceBody | 

            try
            {
                // Create device
                Device result = apiInstance.CreateDevice(collectionId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.CreateDevice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateDeviceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create device
    ApiResponse<Device> response = apiInstance.CreateDeviceWithHttpInfo(collectionId, body);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.CreateDeviceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string This is the containing collection
body CreateDeviceBody

Return type

Device

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteDevice

Device DeleteDevice (string collectionId, string deviceId)

Remove device.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class DeleteDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | This is the containing collection
            var deviceId = "deviceId_example";  // string | The device ID is assigned by the backend.

            try
            {
                // Remove device.
                Device result = apiInstance.DeleteDevice(collectionId, deviceId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.DeleteDevice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteDeviceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Remove device.
    ApiResponse<Device> response = apiInstance.DeleteDeviceWithHttpInfo(collectionId, deviceId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.DeleteDeviceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string This is the containing collection
deviceId string The device ID is assigned by the backend.

Return type

Device

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteDownstreamMessage

DeleteDownstreamMessageResponse DeleteDownstreamMessage (string collectionId, string deviceId, string messageId)

Delete outgoing message

Delete an outgoing (ie downstream) message from the outbox.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class DeleteDownstreamMessageExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 
            var messageId = "messageId_example";  // string | 

            try
            {
                // Delete outgoing message
                DeleteDownstreamMessageResponse result = apiInstance.DeleteDownstreamMessage(collectionId, deviceId, messageId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.DeleteDownstreamMessage: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteDownstreamMessageWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete outgoing message
    ApiResponse<DeleteDownstreamMessageResponse> response = apiInstance.DeleteDownstreamMessageWithHttpInfo(collectionId, deviceId, messageId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.DeleteDownstreamMessageWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string
deviceId string
messageId string

Return type

DeleteDownstreamMessageResponse

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeviceCertificate

DeviceCertificateResponse DeviceCertificate (string collectionId, string deviceId)

Get issued certificate(s) for device

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class DeviceCertificateExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 

            try
            {
                // Get issued certificate(s) for device
                DeviceCertificateResponse result = apiInstance.DeviceCertificate(collectionId, deviceId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.DeviceCertificate: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeviceCertificateWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get issued certificate(s) for device
    ApiResponse<DeviceCertificateResponse> response = apiInstance.DeviceCertificateWithHttpInfo(collectionId, deviceId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.DeviceCertificateWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string
deviceId string

Return type

DeviceCertificateResponse

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListDeviceData

ListDataResponse ListDeviceData (string collectionId, string deviceId, int? limit = null, string? start = null, string? end = null, string? offset = null)

Retrieve data from device

List the data received from the device. Use the query parameters to control what data you retrieve. The maximum number of data points is 100.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class ListDeviceDataExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | The collection ID. This is included in the request path.
            var deviceId = "deviceId_example";  // string | The device ID. This is included in the request path.
            var limit = 56;  // int? | Limit the number of payloads to return. The default is 512. (optional) 
            var start = "start_example";  // string? | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. (optional) 
            var end = "end_example";  // string? | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. (optional) 
            var offset = "offset_example";  // string? | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. (optional) 

            try
            {
                // Retrieve data from device
                ListDataResponse result = apiInstance.ListDeviceData(collectionId, deviceId, limit, start, end, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.ListDeviceData: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListDeviceDataWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Retrieve data from device
    ApiResponse<ListDataResponse> response = apiInstance.ListDeviceDataWithHttpInfo(collectionId, deviceId, limit, start, end, offset);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.ListDeviceDataWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string The collection ID. This is included in the request path.
deviceId string The device ID. This is included in the request path.
limit int? Limit the number of payloads to return. The default is 512. [optional]
start string? Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. [optional]
end string? End of time range. The default is the current time stamp. Value is in milliseconds since epoch. [optional]
offset string? The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. [optional]

Return type

ListDataResponse

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListDevices

ListDevicesResponse ListDevices (string collectionId)

List devices in collection.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class ListDevicesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | 

            try
            {
                // List devices in collection.
                ListDevicesResponse result = apiInstance.ListDevices(collectionId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.ListDevices: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListDevicesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List devices in collection.
    ApiResponse<ListDevicesResponse> response = apiInstance.ListDevicesWithHttpInfo(collectionId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.ListDevicesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string

Return type

ListDevicesResponse

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListDownstreamMessages

ListDownstreamMessagesResponse ListDownstreamMessages (string collectionId, string deviceId, int? limit = null, string? start = null, string? end = null, string? offset = null)

List the messages in the outbox

List messages that should be sent to the device when it connects to the service. The messages are sent to the device when it connects to the service and either sends a message (via UDP or CoAP) or requests a message via CoAP GET request.option

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class ListDownstreamMessagesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 
            var limit = 56;  // int? |  (optional) 
            var start = "start_example";  // string? | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. (optional) 
            var end = "end_example";  // string? | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. (optional) 
            var offset = "offset_example";  // string? | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. (optional) 

            try
            {
                // List the messages in the outbox
                ListDownstreamMessagesResponse result = apiInstance.ListDownstreamMessages(collectionId, deviceId, limit, start, end, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.ListDownstreamMessages: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListDownstreamMessagesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List the messages in the outbox
    ApiResponse<ListDownstreamMessagesResponse> response = apiInstance.ListDownstreamMessagesWithHttpInfo(collectionId, deviceId, limit, start, end, offset);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.ListDownstreamMessagesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string
deviceId string
limit int? [optional]
start string? Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. [optional]
end string? End of time range. The default is the current time stamp. Value is in milliseconds since epoch. [optional]
offset string? The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. [optional]

Return type

ListDownstreamMessagesResponse

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListUpstreamMessages

ListUpstreamMessagesResponse ListUpstreamMessages (string collectionId, string deviceId, int? limit = null, string? start = null, string? end = null, string? offset = null)

List incoming messages

Retrieve a list of incoming (ie upstream) messages, ie messages sent from the device to the service. These messages are buffered in the service until they expire. Use the query parameters to limit the number of messages to return. If no limit is specified the default limit of 250 is used.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class ListUpstreamMessagesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 
            var limit = 56;  // int? |  (optional) 
            var start = "start_example";  // string? | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. (optional) 
            var end = "end_example";  // string? | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. (optional) 
            var offset = "offset_example";  // string? | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. (optional) 

            try
            {
                // List incoming messages
                ListUpstreamMessagesResponse result = apiInstance.ListUpstreamMessages(collectionId, deviceId, limit, start, end, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.ListUpstreamMessages: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ListUpstreamMessagesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List incoming messages
    ApiResponse<ListUpstreamMessagesResponse> response = apiInstance.ListUpstreamMessagesWithHttpInfo(collectionId, deviceId, limit, start, end, offset);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.ListUpstreamMessagesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string
deviceId string
limit int? [optional]
start string? Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. [optional]
end string? End of time range. The default is the current time stamp. Value is in milliseconds since epoch. [optional]
offset string? The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. [optional]

Return type

ListUpstreamMessagesResponse

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveDevice

Device RetrieveDevice (string collectionId, string deviceId)

Retrieve device

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class RetrieveDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | This is the containing collection
            var deviceId = "deviceId_example";  // string | The device identifier

            try
            {
                // Retrieve device
                Device result = apiInstance.RetrieveDevice(collectionId, deviceId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.RetrieveDevice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetrieveDeviceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Retrieve device
    ApiResponse<Device> response = apiInstance.RetrieveDeviceWithHttpInfo(collectionId, deviceId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.RetrieveDeviceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string This is the containing collection
deviceId string The device identifier

Return type

Device

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RetrieveDeviceStats

DeviceStats RetrieveDeviceStats (string collectionId, string deviceId)

Retrieve device statistics

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class RetrieveDeviceStatsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var collectionId = "collectionId_example";  // string | This is the containing collection
            var deviceId = "deviceId_example";  // string | The device identifier

            try
            {
                // Retrieve device statistics
                DeviceStats result = apiInstance.RetrieveDeviceStats(collectionId, deviceId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.RetrieveDeviceStats: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the RetrieveDeviceStatsWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Retrieve device statistics
    ApiResponse<DeviceStats> response = apiInstance.RetrieveDeviceStatsWithHttpInfo(collectionId, deviceId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.RetrieveDeviceStatsWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
collectionId string This is the containing collection
deviceId string The device identifier

Return type

DeviceStats

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateDevice

Device UpdateDevice (string existingCollectionId, string deviceId, UpdateDeviceBody body)

Update device

The device can be moved from one collection to another by setting the collection ID field to the new collection. You must have administrative access to both collections. A note on gateway configurations: Empty gateway configuration blocks are deleted. If the configuration block contains a gateway ID it will be updated with the new values. All values must be submitted in the request. If a device is moved out of the collection and it references a gateway in the configuration the operation will fail. Devices that are moved from one collection to another and references gateway configurations must be updated before they are moved.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;

namespace Example
{
    public class UpdateDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://api.lab5e.com";
            // Configure API key authorization: APIToken
            config.AddApiKey("X-API-Token", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("X-API-Token", "Bearer");

            var apiInstance = new DevicesApi(config);
            var existingCollectionId = "existingCollectionId_example";  // string | 
            var deviceId = "deviceId_example";  // string | 
            var body = new UpdateDeviceBody(); // UpdateDeviceBody | 

            try
            {
                // Update device
                Device result = apiInstance.UpdateDevice(existingCollectionId, deviceId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DevicesApi.UpdateDevice: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the UpdateDeviceWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Update device
    ApiResponse<Device> response = apiInstance.UpdateDeviceWithHttpInfo(existingCollectionId, deviceId, body);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling DevicesApi.UpdateDeviceWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
existingCollectionId string
deviceId string
body UpdateDeviceBody

Return type

Device

Authorization

APIToken

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 A successful response. -
201 It's created. -
400 The request has an error. -
401 You can't touch this -
404 Couldn't find the resource. -
409 There's a resource conflict here. -
500 I'm sorry. We are broken -
0 An unexpected error response. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]