Skip to content

lightbug-io/thelightbug-api-v1-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thelightbug.com Tracking-client-php

Note: This repository is from circa 2020/21, and may be out of date. Please refer to https://docs.lightbug.io for the most up-to-date information.

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

  • API version: 1.1.0

Requirements

PHP 5.6 and later

Installation & Usage

Composer

clone locally and run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/tracking-api-php/vendor/autoload.php');

Getting Started

See examples/getting-started.php

To register for HTTP push, see register_push.php and push_receiver.php

  • push_receiver.php needs to be uploaded to a publicly accessible URL
  • edit PUSH_ENDPOINT in register_push to match the URL, and enter login details for the account
  • run php register_push.php once to register your endpoint for push notifications

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 devicePrototypeCreateNotificationTriggers POST /devices/{id}/notificationTriggers Create alert/notification trigger for device
DeviceApi devicePrototypeDeleteNotificationTriggers DELETE /devices/{id}/notificationTriggers Remove all alert/notification trigger for device
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 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 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 devicePrototypeSetSafeZone POST /devices/{id}/setSafeZone Update safe-zone for device
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

Enter username and password in the examples. Login helper function is included in Helpers::login. See usage in gettings tarted

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages