API for device, collection, output and firmware management
This C# SDK is automatically generated by the OpenAPI Generator project:
- API version: 5.0.3 pitch-dark-elza
- SDK version: 5.0.3
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen For more information, please visit https://lab5e.com
- RestSharp - 106.13.0 or later
- Json.NET - 13.0.2 or later
- JsonSubTypes - 1.8.0 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742. NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See RestSharp#1406.
Run the following command to generate the DLL
- [Mac/Linux]
/bin/sh build.sh
- [Windows]
build.bat
Then include the DLL (under the bin
folder) in the C# project, and use the namespaces:
using Com.Lab5e.Span.Api;
using Com.Lab5e.Span.Client;
using Com.Lab5e.Span.Model;
A .nuspec
is included with the project. You can follow the Nuget quickstart to create and publish packages.
This .nuspec
uses placeholders from the .csproj
, so build the .csproj
directly:
nuget pack -Build -OutputDirectory out Com.Lab5e.Span.csproj
Then, publish to a local feed or other host and consume the new package via Nuget as usual.
To use the API client with a HTTP proxy, setup a System.Net.WebProxy
Configuration c = new Configuration();
System.Net.WebProxy webProxy = new System.Net.WebProxy("http://myProxyUrl:80/");
webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
c.Proxy = webProxy;
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 Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://api.lab5e.com";
// Configure API key authorization: APIToken
config.ApiKey.Add("X-API-Token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.ApiKeyPrefix.Add("X-API-Token", "Bearer");
var apiInstance = new BlobsApi(config);
var collectionId = "collectionId_example"; // string |
var blobId = "blobId_example"; // string |
try
{
// Remove a blob stored on a collection
Object result = apiInstance.DeleteBlob(collectionId, blobId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling BlobsApi.DeleteBlob: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
All URIs are relative to https://api.lab5e.com
Class | Method | HTTP request | Description |
---|---|---|---|
BlobsApi | DeleteBlob | DELETE /span/collections/{collectionId}/blobs/{blobId} | Remove a blob stored on a collection |
BlobsApi | ListBlobs | GET /span/collections/{collectionId}/blobs | List the blobs for a collection |
CertificatesApi | CreateCertificate | POST /span/collections/{collectionId}/certificates/create | Create certificate |
CertificatesApi | RetrieveCertificateChain | GET /span/collections/{collectionId}/certificates | Get certificate chain |
CertificatesApi | SignCertificate | POST /span/collections/{collectionId}/certificates/sign | Sign certificate |
CertificatesApi | VerifyCertificate | POST /span/collections/{collectionId}/certificates/verify | Verify certificate |
CollectionsApi | CreateCollection | POST /span/collections | Create collection |
CollectionsApi | DeleteCollection | DELETE /span/collections/{collectionId} | Delete collection |
CollectionsApi | ListCollectionData | GET /span/collections/{collectionId}/data | Retrieve data from devices |
CollectionsApi | ListCollections | GET /span/collections | List collections |
CollectionsApi | RetrieveCollection | GET /span/collections/{collectionId} | Retrieve collection |
CollectionsApi | RetrieveCollectionStats | GET /span/collections/{collectionId}/stats | Retrieve collection statistics |
CollectionsApi | UpdateCollection | PATCH /span/collections/{collectionId} | Update collection |
DevicesApi | AddDownstreamMessage | POST /span/collections/{collectionId}/devices/{deviceId}/outbox | Add message to oubox |
DevicesApi | CreateDevice | POST /span/collections/{collectionId}/devices | Create device |
DevicesApi | DeleteDevice | DELETE /span/collections/{collectionId}/devices/{deviceId} | Remove device. |
DevicesApi | DeleteDownstreamMessage | DELETE /span/collections/{collectionId}/devices/{deviceId}/outbox/{messageId} | Delete outgoing message |
DevicesApi | DeviceCertificate | GET /span/collections/{collectionId}/devices/{deviceId}/certs | Get issued certificate(s) for device |
DevicesApi | ListDeviceData | GET /span/collections/{collectionId}/devices/{deviceId}/data | Retrieve data from device |
DevicesApi | ListDevices | GET /span/collections/{collectionId}/devices | List devices in collection. |
DevicesApi | ListDownstreamMessages | GET /span/collections/{collectionId}/devices/{deviceId}/outbox | List the messages in the outbox |
DevicesApi | ListUpstreamMessages | GET /span/collections/{collectionId}/devices/{deviceId}/inbox | List incoming messages |
DevicesApi | RetrieveDevice | GET /span/collections/{collectionId}/devices/{deviceId} | Retrieve device |
DevicesApi | RetrieveDeviceStats | GET /span/collections/{collectionId}/devices/{deviceId}/stats | Retrieve device statistics |
DevicesApi | UpdateDevice | PATCH /span/collections/{existingCollectionId}/devices/{deviceId} | Update device |
FotaApi | ClearFirmwareError | DELETE /span/collections/{collectionId}/devices/{deviceId}/fwerror | Clear FOTA error |
FotaApi | CreateFirmware | POST /span/collections/{collectionId}/firmware | Create firmware |
FotaApi | DeleteFirmware | DELETE /span/collections/{collectionId}/firmware/{imageId} | Delete firmware |
FotaApi | FirmwareUsage | GET /span/collections/{collectionId}/firmware/{imageId}/usage | Firmware usage |
FotaApi | ListFirmware | GET /span/collections/{collectionId}/firmware | List firmware |
FotaApi | RetrieveFirmware | GET /span/collections/{collectionId}/firmware/{imageId} | Retrieve firmware |
FotaApi | RetrieveFirmwareStats | GET /span/collections/{collectionId}/firmware/{imageId}/stats | Retrieve firmware statistics |
FotaApi | UpdateFirmware | PATCH /span/collections/{existingCollectionId}/firmware/{imageId} | Update firmware |
GatewaysApi | CreateGateway | POST /span/collections/{collectionId}/gateways | Create gateway |
GatewaysApi | DeleteGateway | DELETE /span/collections/{collectionId}/gateways/{gatewayId} | Delete gateway |
GatewaysApi | GatewayCertificates | GET /span/collections/{collectionId}/gateways/{gatewayId}/certs | Get issued certificate(s) for gateway |
GatewaysApi | ListGateways | GET /span/collections/{collectionId}/gateways | List gateways |
GatewaysApi | RetrieveGateway | GET /span/collections/{collectionId}/gateways/{gatewayId} | Retrieve gateway |
GatewaysApi | RetrieveGatewayStats | GET /span/collections/{collectionId}/gateways/{gatewayId}/stats | Retrieve gateway statistics |
GatewaysApi | UpdateGateway | PATCH /span/collections/{existingCollectionId}/gateways/{gatewayId} | Update gateway |
OutputsApi | CreateOutput | POST /span/collections/{collectionId}/outputs | Create output |
OutputsApi | DeleteOutput | DELETE /span/collections/{collectionId}/outputs/{outputId} | Delete output |
OutputsApi | ListOutputs | GET /span/collections/{collectionId}/outputs | List outputs |
OutputsApi | Logs | GET /span/collections/{collectionId}/outputs/{outputId}/logs | Output logs |
OutputsApi | RetrieveOutput | GET /span/collections/{collectionId}/outputs/{outputId} | Retrieve output |
OutputsApi | RetrieveOutputStats | GET /span/collections/{collectionId}/outputs/{outputId}/stats | Retrieve output statistics |
OutputsApi | Status | GET /span/collections/{collectionId}/outputs/{outputId}/status | Output status |
OutputsApi | UpdateOutput | PATCH /span/collections/{existingCollectionId}/outputs/{outputId} | Update output |
SpanApi | GetSystemInfo | GET /span/system | System information |
- Model.ActivityEvent
- Model.AddDownstreamMessageBody
- Model.Any
- Model.Blob
- Model.BlobStats
- Model.CellularIoTConfig
- Model.CellularIoTMetadata
- Model.CertificateChainResponse
- Model.CertificateInfo
- Model.ClearFirmwareErrorResponse
- Model.CoAPMetadata
- Model.Collection
- Model.CollectionFirmware
- Model.CollectionStats
- Model.CreateCertificateBody
- Model.CreateCertificateResponse
- Model.CreateCollectionRequest
- Model.CreateDeviceBody
- Model.CreateFirmwareBody
- Model.CreateGatewayBody
- Model.CreateOutputBody
- Model.DeleteDownstreamMessageResponse
- Model.Device
- Model.DeviceCertificateResponse
- Model.DeviceConfig
- Model.DeviceMetadata
- Model.DeviceStats
- Model.Firmware
- Model.FirmwareManagement
- Model.FirmwareMetadata
- Model.FirmwareStats
- Model.FirmwareUsageResponse
- Model.Gateway
- Model.GatewayCIoTConfig
- Model.GatewayCertificateResponse
- Model.GatewayConfig
- Model.GatewayCustomConfig
- Model.GatewayDeviceConfig
- Model.GatewayDeviceMetadata
- Model.GatewayInetConfig
- Model.GatewayMetadata
- Model.GatewayStats
- Model.GatewayStatus
- Model.GatewayType
- Model.InetMetadata
- Model.ListBlobResponse
- Model.ListCollectionResponse
- Model.ListDataResponse
- Model.ListDevicesResponse
- Model.ListDownstreamMessagesResponse
- Model.ListFirmwareResponse
- Model.ListGatewayResponse
- Model.ListOutputResponse
- Model.ListUpstreamMessagesResponse
- Model.MQTTMetadata
- Model.MessageDownstream
- Model.MessageState
- Model.MessageTransport
- Model.MessageUpstream
- Model.Output
- Model.OutputConfig
- Model.OutputDataMessage
- Model.OutputLogEntry
- Model.OutputLogResponse
- Model.OutputMessageType
- Model.OutputStats
- Model.OutputStatusResponse
- Model.OutputType
- Model.RetrieveBlobResponse
- Model.RpcStatus
- Model.SignCertificateBody
- Model.SignCertificateResponse
- Model.SystemInfoResponse
- Model.UDPMetadata
- Model.UpdateCollectionBody
- Model.UpdateDeviceBody
- Model.UpdateFirmwareBody
- Model.UpdateGatewayBody
- Model.UpdateOutputBody
- Model.VerifyCertificateBody
- Model.VerifyCertificateResponse
- Type: API key
- API key parameter name: X-API-Token
- Location: HTTP header