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 |
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.
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | ||
deviceId | string | ||
body | AddDownstreamMessageBody |
- Content-Type: application/json
- Accept: application/json
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]
Device CreateDevice (string collectionId, CreateDeviceBody body)
Create device
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | This is the containing collection | |
body | CreateDeviceBody |
- Content-Type: application/json
- Accept: application/json
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]
Device DeleteDevice (string collectionId, string deviceId)
Remove device.
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | This is the containing collection | |
deviceId | string | The device ID is assigned by the backend. |
- Content-Type: Not defined
- Accept: application/json
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]
DeleteDownstreamMessageResponse DeleteDownstreamMessage (string collectionId, string deviceId, string messageId)
Delete outgoing message
Delete an outgoing (ie downstream) message from the outbox.
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | ||
deviceId | string | ||
messageId | string |
DeleteDownstreamMessageResponse
- Content-Type: Not defined
- Accept: application/json
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]
DeviceCertificateResponse DeviceCertificate (string collectionId, string deviceId)
Get issued certificate(s) for device
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | ||
deviceId | string |
- Content-Type: Not defined
- Accept: application/json
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]
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.
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);
}
}
}
}
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);
}
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] |
- Content-Type: Not defined
- Accept: application/json
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]
ListDevicesResponse ListDevices (string collectionId)
List devices in collection.
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string |
- Content-Type: Not defined
- Accept: application/json
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]
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
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);
}
}
}
}
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);
}
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] |
ListDownstreamMessagesResponse
- Content-Type: Not defined
- Accept: application/json
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]
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.
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);
}
}
}
}
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);
}
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] |
- Content-Type: Not defined
- Accept: application/json
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]
Device RetrieveDevice (string collectionId, string deviceId)
Retrieve device
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | This is the containing collection | |
deviceId | string | The device identifier |
- Content-Type: Not defined
- Accept: application/json
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]
DeviceStats RetrieveDeviceStats (string collectionId, string deviceId)
Retrieve device statistics
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | string | This is the containing collection | |
deviceId | string | The device identifier |
- Content-Type: Not defined
- Accept: application/json
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]
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.
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);
}
}
}
}
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);
}
Name | Type | Description | Notes |
---|---|---|---|
existingCollectionId | string | ||
deviceId | string | ||
body | UpdateDeviceBody |
- Content-Type: application/json
- Accept: application/json
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]