PHP code example of mobi-market / cdiscount-sdkphpapi

1. Go to this page and download the library: Download mobi-market/cdiscount-sdkphpapi 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/ */

    

mobi-market / cdiscount-sdkphpapi example snippets


$client = new \Sdk\ApiClient\CDSApiClient();
$token = $client->init();
if ($token == null || !$client->isTokenValid()) {
	echo "Souci lors de la génération du token";
	die;
}
$offerPoint = $client->getOfferPoint();
$offerListResponse = $offerPoint->getOfferList(null); /** Parse here $offerListResponse **/
$sellerPoint = $client->getSellerPoint();
$sellerResponse = $sellerPoint->getSellerInformation(); /** Parse here $sellerResponse **/