TrackingApi - JavaScript client for tracking_api API for retrieving tracking data and changing settings on LightBug & RemoteThings tracking devices This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.1.0
- Package version: 1.1.0
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install tracking_api --save
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your tracking_api from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('tracking_api')
in javascript files from the directory you ran the last
command above from.
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/tracking_api then install it via:
npm install YOUR_USERNAME/tracking_api --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var TrackingApi = require('tracking_api');
var api = new TrackingApi.DeviceApi()
var id = "id_example"; // {String} Model id
var opts = {
'filter': "filter_example" // {String} Filter defining fields and include - must be a JSON-encoded string ({\"something\":\"value\"})
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deviceFindById(id, opts, callback);
All URIs are relative to https://api.thelightbug.com/api
Class | Method | HTTP request | Description |
---|---|---|---|
TrackingApi.DeviceApi | deviceFindById | GET /devices/{id} | Find a model instance by {{id}} from the data source. |
TrackingApi.DeviceApi | devicePrototypeCreateGatewayReadings | POST /devices/{id}/gatewayReadings | Creates a new instance in gatewayReadings of this model. |
TrackingApi.DeviceApi | devicePrototypeCreateNotificationTriggers | POST /devices/{id}/notificationTriggers | Create alert/notification trigger for device |
TrackingApi.DeviceApi | devicePrototypeDeleteGatewayReadings | DELETE /devices/{id}/gatewayReadings | Deletes all gatewayReadings of this model. |
TrackingApi.DeviceApi | devicePrototypeDeleteNotificationTriggers | DELETE /devices/{id}/notificationTriggers | Remove all alert/notification trigger for device |
TrackingApi.DeviceApi | devicePrototypeDestroyByIdGatewayReadings | DELETE /devices/{id}/gatewayReadings/{fk} | Delete a related item by id for gatewayReadings. |
TrackingApi.DeviceApi | devicePrototypeDestroyByIdNotificationTriggers | DELETE /devices/{id}/notificationTriggers/{fk} | Remove alert/notification trigger by id {fk} for device |
TrackingApi.DeviceApi | devicePrototypeDestroyByIdPoints | DELETE /devices/{id}/points/{fk} | Delete a specific point for a device |
TrackingApi.DeviceApi | devicePrototypeDestroyByIdTransients | DELETE /devices/{id}/transients/{fk} | Delete a related item by id for transients. |
TrackingApi.DeviceApi | devicePrototypeFindByIdGatewayReadings | GET /devices/{id}/gatewayReadings/{fk} | Find a related item by id for gatewayReadings. |
TrackingApi.DeviceApi | devicePrototypeFindByIdNotificationTriggers | GET /devices/{id}/notificationTriggers/{fk} | Find a related item by id for notificationTriggers. |
TrackingApi.DeviceApi | devicePrototypeFindByIdPoints | GET /devices/{id}/points/{fk} | Retrieve a specific point for a device |
TrackingApi.DeviceApi | devicePrototypeFindByIdReadings | GET /devices/{id}/readings/{fk} | Retrieve a specific reading for a device |
TrackingApi.DeviceApi | devicePrototypeFindByIdTransients | GET /devices/{id}/transients/{fk} | Find a related item by id for transients. |
TrackingApi.DeviceApi | devicePrototypeFlightMode | GET /devices/{id}/flightMode | |
TrackingApi.DeviceApi | devicePrototypeGetConfig | GET /devices/{id}/config | Retrieve configuration for a device |
TrackingApi.DeviceApi | devicePrototypeGetGatewayReadings | GET /devices/{id}/gatewayReadings | Queries gatewayReadings of device. |
TrackingApi.DeviceApi | devicePrototypeGetNotificationTriggers | GET /devices/{id}/notificationTriggers | Get alerts for device |
TrackingApi.DeviceApi | devicePrototypeGetPoints | GET /devices/{id}/points | Retrieve points for a device |
TrackingApi.DeviceApi | devicePrototypeGetReadings | GET /devices/{id}/readings | Retrieve readings for a device |
TrackingApi.DeviceApi | devicePrototypeGetSafeZone | GET /devices/{id}/getSafeZone | Get safe-zone for device |
TrackingApi.DeviceApi | devicePrototypeGetTransients | GET /devices/{id}/transients | Queries transients of device. |
TrackingApi.DeviceApi | devicePrototypeSetSafeZone | POST /devices/{id}/setSafeZone | Update safe-zone for device |
TrackingApi.DeviceApi | devicePrototypeUpdateByIdGatewayReadings | PUT /devices/{id}/gatewayReadings/{fk} | Update a related item by id for gatewayReadings. |
TrackingApi.DeviceApi | devicePrototypeUpdateByIdNotificationTriggers | PUT /devices/{id}/notificationTriggers/{fk} | Update an alert/notification trigger by id {fk} for device |
TrackingApi.DeviceApi | devicePrototypeUpdateByIdTransients | PUT /devices/{id}/transients/{fk} | Update a related item by id for transients. |
TrackingApi.DeviceApi | devicePrototypeUpdateConfig | PUT /devices/{id}/config | Update configuration for a device |
TrackingApi.UserApi | userLogin | POST /users/login | Login a user with username/email and password. |
TrackingApi.UserApi | userPrototypeCreateGeofences | POST /users/{id}/geofences | Creates a new instance in geofences of this model. |
TrackingApi.UserApi | userPrototypeDeleteGeofences | DELETE /users/{id}/geofences | Deletes all geofences of this model. |
TrackingApi.UserApi | userPrototypeDestroyByIdGeofences | DELETE /users/{id}/geofences/{fk} | Delete a related item by id for geofences. |
TrackingApi.UserApi | userPrototypeFindByIdGeofences | GET /users/{id}/geofences/{fk} | Find a related item by id for geofences. |
TrackingApi.UserApi | userPrototypeGetDeviceSummary | GET /users/{id}/getDeviceSummary | Retrieve a summary of all devices on this user account. |
TrackingApi.UserApi | userPrototypeGetDevices | GET /users/{id}/devices | Queries devices of user. |
TrackingApi.UserApi | userPrototypeGetDevicesInZone | GET /users/{id}/getDevicesInZone | Retrieve a list of devices in any given zone or group of zones. |
TrackingApi.UserApi | userPrototypeGetGeofences | GET /users/{id}/geofences | Queries geofences of user. |
TrackingApi.UserApi | userPrototypeGetMqttCredentials | GET /users/{id}/getMqttCredentials | |
TrackingApi.UserApi | userPrototypeUpdateByIdGeofences | PUT /users/{id}/geofences/{fk} | Update a related item by id for geofences. |
- TrackingApi.AccessToken
- TrackingApi.Credentials
- TrackingApi.Datapoint
- TrackingApi.Device
- TrackingApi.DeviceConfig
- TrackingApi.DeviceTransient
- TrackingApi.GeoPoint
- TrackingApi.Geofence
- TrackingApi.InlineResponse200
- TrackingApi.Notification
- TrackingApi.NotificationTrigger
- TrackingApi.SensorReading
All endpoints do not require authorization.