PHP code example of mplus-software / mplus-api-client-php

1. Go to this page and download the library: Download mplus-software/mplus-api-client-php 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/ */

    

mplus-software / mplus-api-client-php example snippets




apiclient = new Mplusqapiclient();
$mplusqapiclient->setApiServer($your_api_url);
$mplusqapiclient->setApiPort($your_api_port);
$mplusqapiclient->setApiFingerprint($certificate_fingerprint);
$mplusqapiclient->setApiIdent($your_api_ident);
$mplusqapiclient->setApiSecret($your_api_secret);

try {
  $mplusqapiclient->initClient();
} catch (MplusQAPIException $e) {
  exit($e->getMessage());
}
    
try {
  $api_version = $mplusqapiclient->getApiVersion();
  echo sprintf('Current API version: %d.%d.%d', 
    $api_version['majorNumber'], 
    $api_version['minorNumber'], 
    $api_version['revisionNumber']);
} catch (MplusQAPIException $e) {
  exit($e->getMessage());
}