Download the PHP package cruide/starline-openapi-laravel without Composer

On this page you can find all versions of the php package cruide/starline-openapi-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package starline-openapi-laravel

Starline OpenApi for Laravel

Разработчик: Alexander Tischenko.

A compact Laravel client for the StarLine OpenAPI — vehicle state, remote commands, events, GPS tracks. Built on top of starline-openapi-php, using Guzzle for HTTP and Laravel Cache for token storage.

Installation

Add credentials to .env:

App ID / Secret Key are issued at https://my.starline.ru/developer.

Usage

Or via dependency injection:

How authentication works (SLID)

Step Request Payload Result
1 GET id.starline.ru/apiV3/application/getCode appId, secret = md5(appSecret) app code
2 GET id.starline.ru/apiV3/application/getToken appId, secret = md5(appSecret + code) app token
3 POST id.starline.ru/apiV3/user/login login, pass = sha1(password), header token: appToken user_token
4 POST developer.starline.ru/json/v2/auth.slid JSON: {"slid_token": "..."} slnet cookie + user_id

All further requests carry Cookie: slnet=.... App/SLID tokens and slnet are cached; on a 401 the session is flushed and the chain runs once again automatically. md5/sha1 hashing is mandated by the StarLine protocol.

API reference

Facade / Client

Method Description
user(): UserApi User-related methods
devices(): DeviceApi Device-related methods
authenticate(bool $force = false): void Run the SLID chain
setUserId(int $id): void Override auto-detected user_id
get($path, $query): array Raw authenticated GET
post($path, $json): array Raw authenticated POST
request($method, $path, $query, $json): array Generic authenticated request

UserApi (via Starline::user())

Method Returns Description
id() int Current user ID
info() UserInfo Profile + devices
devices() Device[] All user devices

DeviceApi (via Starline::devices())

Method Returns Description
state($id) DeviceState Live device state
arm($id) array Arm security
disarm($id) array Disarm security
startEngine($id) array Remote engine start
stopEngine($id) array Stop engine
setParam($id, $params) array Arbitrary command
events($id, $start, $end) array Event history
ways($id, $begin, $end) array GPS track
eventTypes() array All event types
eventType($id) array Single event type description
details($id) array Detailed device info
position($id) array Last known position (deprecated)
list() Device[] Alias for user()->devices()

Models

Model Key getters
Device id(), type(), alias(), imei(), isOnline(), raw()
DeviceState isArmed(), isEngineRunning(), interiorTemperature(), engineTemperature(), batteryVoltage(), gsmBalance(), latitude(), longitude(), mileage(), updatedAt(), raw()
UserInfo id(), name(), email(), devices(), sharedDevices(), raw()

All model getters return null for missing fields (safe across firmware versions).

Error handling

Exception Meaning
Cruide\StarlineApi\Exceptions\StarlineAuthException Bad credentials or expired tokens
Cruide\StarlineApi\Exceptions\StarlineApiException API error / HTTP >= 400 (getRaw())
Cruide\StarlineApi\Exceptions\StarlineAuthCaptchaException Captcha or SMS required
Cruide\StarlineApi\Exceptions\StarlineException Base class for all errors

Testing

License

MIT


All versions of starline-openapi-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
cruide/starline-openapi-php Version @dev
guzzlehttp/guzzle Version ^7.8
illuminate/cache Version ^12.0
illuminate/support Version ^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cruide/starline-openapi-laravel contains the following files

Loading the files please wait ...