Skip to content

Files

IO.Swagger - the C# library for the TrackingAPI

API for retrieving tracking data and changing settings on LightBug & RemoteThings tracking devices

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.1.0
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

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

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

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 IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

Packaging

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 IO.Swagger.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            var apiInstance = new DeviceApi();
            var id = id_example;  // string | Model id
            var filter = filter_example;  // string | Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"}) (optional) 

            try
            {
                // Find a model instance by {{id}} from the data source.
                Device result = apiInstance.DeviceFindById(id, filter);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DeviceApi.DeviceFindById: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

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

Class Method HTTP request Description
DeviceApi DeviceFindById GET /devices/{id} Find a model instance by {{id}} from the data source.
DeviceApi DevicePrototypeCreateGatewayReadings POST /devices/{id}/gatewayReadings Creates a new instance in gatewayReadings of this model.
DeviceApi DevicePrototypeCreateMessages POST /devices/{id}/messages Creates a new instance in messages of this model.
DeviceApi DevicePrototypeCreateNotificationTriggers POST /devices/{id}/notificationTriggers Create alert/notification trigger for device
DeviceApi DevicePrototypeDeleteGatewayReadings DELETE /devices/{id}/gatewayReadings Deletes all gatewayReadings of this model.
DeviceApi DevicePrototypeDeleteMessages DELETE /devices/{id}/messages Deletes all messages of this model.
DeviceApi DevicePrototypeDeleteNotificationTriggers DELETE /devices/{id}/notificationTriggers Remove all alert/notification trigger for device
DeviceApi DevicePrototypeDestroyByIdGatewayReadings DELETE /devices/{id}/gatewayReadings/{fk} Delete a related item by id for gatewayReadings.
DeviceApi DevicePrototypeDestroyByIdNotificationTriggers DELETE /devices/{id}/notificationTriggers/{fk} Remove alert/notification trigger by id {fk} for device
DeviceApi DevicePrototypeDestroyByIdPoints DELETE /devices/{id}/points/{fk} Delete a specific point for a device
DeviceApi DevicePrototypeDestroyByIdTransients DELETE /devices/{id}/transients/{fk} Delete a related item by id for transients.
DeviceApi DevicePrototypeFindByIdGatewayReadings GET /devices/{id}/gatewayReadings/{fk} Find a related item by id for gatewayReadings.
DeviceApi DevicePrototypeFindByIdNotificationTriggers GET /devices/{id}/notificationTriggers/{fk} Find a related item by id for notificationTriggers.
DeviceApi DevicePrototypeFindByIdPoints GET /devices/{id}/points/{fk} Retrieve a specific point for a device
DeviceApi DevicePrototypeFindByIdReadings GET /devices/{id}/readings/{fk} Retrieve a specific reading for a device
DeviceApi DevicePrototypeFindByIdTransients GET /devices/{id}/transients/{fk} Find a related item by id for transients.
DeviceApi DevicePrototypeFlightMode GET /devices/{id}/flightMode
DeviceApi DevicePrototypeGetConfig GET /devices/{id}/config Retrieve configuration for a device
DeviceApi DevicePrototypeGetGatewayReadings GET /devices/{id}/gatewayReadings Queries gatewayReadings of device.
DeviceApi DevicePrototypeGetMessages GET /devices/{id}/messages Queries messages of device.
DeviceApi DevicePrototypeGetNotificationTriggers GET /devices/{id}/notificationTriggers Get alerts for device
DeviceApi DevicePrototypeGetPoints GET /devices/{id}/points Retrieve points for a device
DeviceApi DevicePrototypeGetReadings GET /devices/{id}/readings Retrieve readings for a device
DeviceApi DevicePrototypeGetSafeZone GET /devices/{id}/getSafeZone Get safe-zone for device
DeviceApi DevicePrototypeGetTransients GET /devices/{id}/transients Queries transients of device.
DeviceApi DevicePrototypeNearbyDeviceData GET /devices/{id}/nearbyDeviceData
DeviceApi DevicePrototypeNearbyDevices GET /devices/{id}/nearbyDevices
DeviceApi DevicePrototypeSetMetaItem GET /devices/{id}/setMetaItem
DeviceApi DevicePrototypeSetSafeZone POST /devices/{id}/setSafeZone Update safe-zone for device
DeviceApi DevicePrototypeSetupSqsForwarding GET /devices/{id}/setupSqsForwarding
DeviceApi DevicePrototypeUpdateByIdGatewayReadings PUT /devices/{id}/gatewayReadings/{fk} Update a related item by id for gatewayReadings.
DeviceApi DevicePrototypeUpdateByIdNotificationTriggers PUT /devices/{id}/notificationTriggers/{fk} Update an alert/notification trigger by id {fk} for device
DeviceApi DevicePrototypeUpdateByIdTransients PUT /devices/{id}/transients/{fk} Update a related item by id for transients.
DeviceApi DevicePrototypeUpdateConfig PUT /devices/{id}/config Update configuration for a device
UserApi UserLogin POST /users/login Login a user with username/email and password.
UserApi UserPrototypeCreateGeofences POST /users/{id}/geofences Creates a new instance in geofences of this model.
UserApi UserPrototypeDeleteGeofences DELETE /users/{id}/geofences Deletes all geofences of this model.
UserApi UserPrototypeDestroyByIdGeofences DELETE /users/{id}/geofences/{fk} Delete a related item by id for geofences.
UserApi UserPrototypeFindByIdGeofences GET /users/{id}/geofences/{fk} Find a related item by id for geofences.
UserApi UserPrototypeGetDeviceSummary GET /users/{id}/getDeviceSummary Retrieve a summary of all devices on this user account.
UserApi UserPrototypeGetDevices GET /users/{id}/devices Queries devices of user.
UserApi UserPrototypeGetDevicesInZone GET /users/{id}/getDevicesInZone Retrieve a list of devices in any given zone or group of zones.
UserApi UserPrototypeGetGeofences GET /users/{id}/geofences Queries geofences of user.
UserApi UserPrototypeGetMqttCredentials GET /users/{id}/getMqttCredentials
UserApi UserPrototypeUpdateByIdGeofences PUT /users/{id}/geofences/{fk} Update a related item by id for geofences.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.