GithubHelp home page GithubHelp logo

samsara-php's Introduction

SwaggerClient-php

Introduction The Samsara REST API lets you interact with the Samsara Cloud from anything that can send an HTTP request. With the Samsara API you can build powerful applications and custom solutions with sensor data. Samsara has endpoints available to track and analyze sensors, vehicles, and entire fleets. If you’re familiar with what you can build with a REST API, the following API reference guide will be your go-to resource. API access to the Samsara cloud is available to all Samsara administrators. If you’d like to try the API, contact us. The API is currently in beta and may be subject to frequent changes. # Connecting to the API There are two ways to connect to the API. If you prefer to use the API in Javascript or Python, we supply SDKs which you can download here: Javascript SDK, Python SDK. If you’d rather use another language to interact with the Samsara API, the endpoints and examples are in the reference guide below.

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Build package: io.swagger.codegen.languages.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com//.git"
    }
  ],
  "require": {
    "/": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

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

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$apiInstance = new Swagger\Client\Api\AssetsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client()
);
$access_token = "access_token_example"; // string | Samsara API access token.
$group_param = new \Swagger\Client\Model\GroupParam5(); // \Swagger\Client\Model\GroupParam5 | Group ID to query.

try {
    $result = $apiInstance->getAllAssets($access_token, $group_param);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AssetsApi->getAllAssets: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.samsara.com/v1

Class Method HTTP request Description
AssetsApi getAllAssets GET /fleet/assets /v1/fleet/assets
AssetsApi getAssetLocation GET /fleet/assets/{asset_id}/locations /fleet/assets/{assetId:[0-9]+}/locations
AssetsApi getAssetReefer GET /fleet/assets/{asset_id}/reefer /fleet/assets/{assetId:[0-9]+}/reefer
DefaultApi addFleetAddress POST /fleet/add_address /fleet/add_address
DefaultApi createDispatchRoute POST /fleet/dispatch/routes /fleet/dispatch/routes
DefaultApi createDriver POST /fleet/drivers/create /fleet/drivers/create
DefaultApi createDriverDispatchRoute POST /fleet/drivers/{driver_id}/dispatch/routes /fleet/drivers/{driver_id:[0-9]+}/dispatch/routes
DefaultApi createVehicleDispatchRoute POST /fleet/vehicles/{vehicle_id}/dispatch/routes /fleet/vehicles/{vehicle_id:[0-9]+}/dispatch/routes
DefaultApi deactivateDriver DELETE /fleet/drivers/{driver_id} /fleet/drivers/{driver_id:[0-9]+}
DefaultApi deleteDispatchRouteById DELETE /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}/
DefaultApi fetchAllDispatchRoutes GET /fleet/dispatch/routes /fleet/dispatch/routes
DefaultApi getAllAssets GET /fleet/assets /v1/fleet/assets
DefaultApi getAllDeactivatedDrivers GET /fleet/drivers/inactive /fleet/drivers/inactive
DefaultApi getAssetLocation GET /fleet/assets/{asset_id}/locations /fleet/assets/{assetId:[0-9]+}/locations
DefaultApi getAssetReefer GET /fleet/assets/{asset_id}/reefer /fleet/assets/{assetId:[0-9]+}/reefer
DefaultApi getDeactivatedDriverById GET /fleet/drivers/inactive/{driver_id} /fleet/drivers/inactive/{driver_id:[0-9]+}
DefaultApi getDispatchRouteById GET /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}
DefaultApi getDispatchRouteHistory GET /fleet/dispatch/routes/{route_id}/history /fleet/dispatch/routes/{route_id:[0-9]+}/history
DefaultApi getDispatchRoutesByDriverId GET /fleet/drivers/{driver_id}/dispatch/routes /fleet/drivers/{driver_id:[0-9]+}/dispatch/routes
DefaultApi getDispatchRoutesByVehicleId GET /fleet/vehicles/{vehicle_id}/dispatch/routes /fleet/vehicles/{vehicle_id:[0-9]+}/dispatch/routes
DefaultApi getDriverById GET /fleet/drivers/{driver_id} /fleet/drivers/{driver_id:[0-9]+}
DefaultApi getDvirs GET /fleet/maintenance/dvirs /fleet/maintenance/dvirs
DefaultApi getFleet POST /fleet/list /fleet/list
DefaultApi getFleetDrivers POST /fleet/drivers /fleet/drivers
DefaultApi getFleetDriversHosDailyLogs POST /fleet/drivers/{driver_id}/hos_daily_logs /fleet/drivers/{driver_id:[0-9]+}/hos_daily_logs
DefaultApi getFleetDriversSummary POST /fleet/drivers/summary /fleet/drivers/summary
DefaultApi getFleetHosAuthenticationLogs POST /fleet/hos_authentication_logs /fleet/hos_authentication_logs
DefaultApi getFleetHosLogs POST /fleet/hos_logs /fleet/hos_logs
DefaultApi getFleetHosLogsSummary POST /fleet/hos_logs_summary /fleet/hos_logs_summary
DefaultApi getFleetLocations POST /fleet/locations /fleet/locations
DefaultApi getFleetMaintenanceList POST /fleet/maintenance/list /fleet/maintenance/list
DefaultApi getFleetTrips POST /fleet/trips /fleet/trips
DefaultApi getMachines POST /machines/list /machines/list
DefaultApi getMachinesHistory POST /machines/history /machines/history
DefaultApi getSensors POST /sensors/list /sensors/list
DefaultApi getSensorsHistory POST /sensors/history /sensors/history
DefaultApi getSensorsHumidity POST /sensors/humidity /sensors/humidity
DefaultApi getSensorsTemperature POST /sensors/temperature /sensors/temperature
DefaultApi reactivateDriverById PUT /fleet/drivers/inactive/{driver_id} /fleet/drivers/inactive/{driver_id:[0-9]+}
DefaultApi updateDispatchRouteById PUT /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}/
DefaultApi updateVehicles POST /fleet/set_data /fleet/set_data
DriversApi createDriver POST /fleet/drivers/create /fleet/drivers/create
DriversApi deactivateDriver DELETE /fleet/drivers/{driver_id} /fleet/drivers/{driver_id:[0-9]+}
DriversApi getAllDeactivatedDrivers GET /fleet/drivers/inactive /fleet/drivers/inactive
DriversApi getDeactivatedDriverById GET /fleet/drivers/inactive/{driver_id} /fleet/drivers/inactive/{driver_id:[0-9]+}
DriversApi getDriverById GET /fleet/drivers/{driver_id} /fleet/drivers/{driver_id:[0-9]+}
DriversApi reactivateDriverById PUT /fleet/drivers/inactive/{driver_id} /fleet/drivers/inactive/{driver_id:[0-9]+}
FleetApi addFleetAddress POST /fleet/add_address /fleet/add_address
FleetApi createDispatchRoute POST /fleet/dispatch/routes /fleet/dispatch/routes
FleetApi createDriver POST /fleet/drivers/create /fleet/drivers/create
FleetApi createDriverDispatchRoute POST /fleet/drivers/{driver_id}/dispatch/routes /fleet/drivers/{driver_id:[0-9]+}/dispatch/routes
FleetApi createVehicleDispatchRoute POST /fleet/vehicles/{vehicle_id}/dispatch/routes /fleet/vehicles/{vehicle_id:[0-9]+}/dispatch/routes
FleetApi deactivateDriver DELETE /fleet/drivers/{driver_id} /fleet/drivers/{driver_id:[0-9]+}
FleetApi deleteDispatchRouteById DELETE /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}/
FleetApi fetchAllDispatchRoutes GET /fleet/dispatch/routes /fleet/dispatch/routes
FleetApi getAllAssets GET /fleet/assets /v1/fleet/assets
FleetApi getAllDeactivatedDrivers GET /fleet/drivers/inactive /fleet/drivers/inactive
FleetApi getAssetLocation GET /fleet/assets/{asset_id}/locations /fleet/assets/{assetId:[0-9]+}/locations
FleetApi getAssetReefer GET /fleet/assets/{asset_id}/reefer /fleet/assets/{assetId:[0-9]+}/reefer
FleetApi getDeactivatedDriverById GET /fleet/drivers/inactive/{driver_id} /fleet/drivers/inactive/{driver_id:[0-9]+}
FleetApi getDispatchRouteById GET /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}
FleetApi getDispatchRouteHistory GET /fleet/dispatch/routes/{route_id}/history /fleet/dispatch/routes/{route_id:[0-9]+}/history
FleetApi getDispatchRoutesByDriverId GET /fleet/drivers/{driver_id}/dispatch/routes /fleet/drivers/{driver_id:[0-9]+}/dispatch/routes
FleetApi getDispatchRoutesByVehicleId GET /fleet/vehicles/{vehicle_id}/dispatch/routes /fleet/vehicles/{vehicle_id:[0-9]+}/dispatch/routes
FleetApi getDriverById GET /fleet/drivers/{driver_id} /fleet/drivers/{driver_id:[0-9]+}
FleetApi getDvirs GET /fleet/maintenance/dvirs /fleet/maintenance/dvirs
FleetApi getFleet POST /fleet/list /fleet/list
FleetApi getFleetDrivers POST /fleet/drivers /fleet/drivers
FleetApi getFleetDriversHosDailyLogs POST /fleet/drivers/{driver_id}/hos_daily_logs /fleet/drivers/{driver_id:[0-9]+}/hos_daily_logs
FleetApi getFleetDriversSummary POST /fleet/drivers/summary /fleet/drivers/summary
FleetApi getFleetHosAuthenticationLogs POST /fleet/hos_authentication_logs /fleet/hos_authentication_logs
FleetApi getFleetHosLogs POST /fleet/hos_logs /fleet/hos_logs
FleetApi getFleetHosLogsSummary POST /fleet/hos_logs_summary /fleet/hos_logs_summary
FleetApi getFleetLocations POST /fleet/locations /fleet/locations
FleetApi getFleetMaintenanceList POST /fleet/maintenance/list /fleet/maintenance/list
FleetApi getFleetTrips POST /fleet/trips /fleet/trips
FleetApi reactivateDriverById PUT /fleet/drivers/inactive/{driver_id} /fleet/drivers/inactive/{driver_id:[0-9]+}
FleetApi updateDispatchRouteById PUT /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}/
FleetApi updateVehicles POST /fleet/set_data /fleet/set_data
MachinesApi getMachines POST /machines/list /machines/list
MachinesApi getMachinesHistory POST /machines/history /machines/history
RoutesApi createDispatchRoute POST /fleet/dispatch/routes /fleet/dispatch/routes
RoutesApi createDriverDispatchRoute POST /fleet/drivers/{driver_id}/dispatch/routes /fleet/drivers/{driver_id:[0-9]+}/dispatch/routes
RoutesApi createVehicleDispatchRoute POST /fleet/vehicles/{vehicle_id}/dispatch/routes /fleet/vehicles/{vehicle_id:[0-9]+}/dispatch/routes
RoutesApi deleteDispatchRouteById DELETE /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}/
RoutesApi fetchAllDispatchRoutes GET /fleet/dispatch/routes /fleet/dispatch/routes
RoutesApi getDispatchRouteById GET /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}
RoutesApi getDispatchRouteHistory GET /fleet/dispatch/routes/{route_id}/history /fleet/dispatch/routes/{route_id:[0-9]+}/history
RoutesApi getDispatchRoutesByDriverId GET /fleet/drivers/{driver_id}/dispatch/routes /fleet/drivers/{driver_id:[0-9]+}/dispatch/routes
RoutesApi getDispatchRoutesByVehicleId GET /fleet/vehicles/{vehicle_id}/dispatch/routes /fleet/vehicles/{vehicle_id:[0-9]+}/dispatch/routes
RoutesApi updateDispatchRouteById PUT /fleet/dispatch/routes/{route_id} /fleet/dispatch/routes/{route_id:[0-9]+}/
SensorsApi getSensors POST /sensors/list /sensors/list
SensorsApi getSensorsHistory POST /sensors/history /sensors/history
SensorsApi getSensorsHumidity POST /sensors/humidity /sensors/humidity
SensorsApi getSensorsTemperature POST /sensors/temperature /sensors/temperature

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

samsara-php's People

Contributors

davidcmoody avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.