PHP code example of h4md1 / jcdecaux-cyclocity

1. Go to this page and download the library: Download h4md1/jcdecaux-cyclocity 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/ */

    

h4md1 / jcdecaux-cyclocity example snippets


    
    
    iate with your ApiKey provided when you registred by developer.jcdecaux.com
    $VLSWrapper = new JCDodatawrapper\Vls\Wrapper( '<youApiKey>' );
    
    //using curl to handle the requesting thing
    //you can set your own request method by implementing the HTTPClientInterface
    $HTTPClient = new JCDodatawrapper\Vls\HTTPClientCurl();
    $VLSWrapper->setHTTPClient( $HTTPClient );

    //dumping all contracts (all cities that JCDECAUX rules on)
    var_dump( $VLSWrapper->getContracts() );
    
    //dumping the stations details (both static and dynamic) of a particular contract (city)
    var_dump( $VLSWrapper->getStationsByContract( 'Rouen' ) );
    
    //dumping a station data of a particular contract (city)
    var_dump( $VLSWrapper->getStation('Rouen', 15 ) );