garygitton/psa-connected-car-sdk-php

dev-master 2018-08-21 15:36 UTC

This package is auto-updated.

Last update: 2024-11-23 08:24:23 UTC


README

This is the first release of our connected car API. With this API you can access more than 89 signals in a car. This API is available on Peugeot, Citroën and DS cars.

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

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/garygitton/psa-connected-car-sdk-php.git"
    }
  ],
  "require": {
    "garygitton/psa-connected-car-sdk-php": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/psa-connected-car-sdk-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');

// Configure API key authorization: Client ID
$config = Psa\ConnectedCar\Configuration::getDefaultConfiguration()->setApiKey('client_id', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Psa\ConnectedCar\Configuration::getDefaultConfiguration()->setApiKeyPrefix('client_id', 'Bearer');

$apiInstance = new Psa\ConnectedCar\Api\DefaultApi(
    // 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(),
    $config
);
$locale = ""; // string | Locale. For example : fr_FR for french
$brand = ""; // string | Brand of the vehicle : C for Citroën or DS, P for Peugeot

try {
    $result = $apiInstance->fetchAlertReferential($locale, $brand);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->fetchAlertReferential: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://localhost/dev/connectedcar/v1

Documentation For Models

Documentation For Authorization

Client ID

  • Type: API key
  • API key parameter name: client_id
  • Location: URL query string

Author

connectedcar@mpsa.com