PHP code example of ridesafety / sdk

1. Go to this page and download the library: Download ridesafety/sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ridesafety / sdk example snippets




use RideSafety\RideSafetyClient;

$client = new RideSafetyClient(
    apiKey: 'YOUR_API_KEY',
    baseUrl: 'https://ridesafety.app'
);

$recalls = $client->getRecalls(['vin' => '1HGBH41JXMN109186']);

$diagnostics = $client->runDiagnostics([
    'vin' => '1HGBH41JXMN109186',
    'symptoms' => 'Rough idle and engine misfire',
    'dtc_codes' => ['P0300'],
]);

$safety = $client->getSafetyRatings('Honda', 'Civic', 2020);

$client = new RideSafetyClient(apiKey: 'KEY', authMode: 'x-api-key');
bash
cd sdk/php
composer install
php smoke_test.php