PHP code example of cobwebinfo / cobra5-php-sdk

1. Go to this page and download the library: Download cobwebinfo/cobra5-php-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/ */

    

cobwebinfo / cobra5-php-sdk example snippets


$soap = new SoapClient('http://api.cobwebinfo.com/server/soap?wsdl');

use CobwebInfo\Cobra5Sdk\Authentication\SoapApiKeyAuthentication;

$auth = new SoapApiKeyAuthentication('Auth', 'api_key');

use CobwebInfo\Cobra5Sdk\Client\Cobra5SoapClient;

$client = new Cobra5SoapClient($soap, $auth);

use CobwebInfo\Cobra5Sdk\Cobra5;

$cobra5 = new Cobra5($client);

$cobra5->getStores();

$cobra5->getStore(9);

$cobra5->getStoreByName('BOP');

$cobra5->getDocuments();

$cobra5->getDocument(1444);

$cobra5->getLastEditedDocument();

$cobra5->getEditedDocuments('1388534400', '1391126400');

$cobra5->getDocumentsByDataStore(9);

$cobra5->getDocumentsForCategory(1197);

$cobra5->getCategory(1197);

$cobra5->getCategoriesForStore(9);

$cobra5->getDocumentXml(1444);

$cobra5->getDocumentPdf(1444);

$cobra5->getDocumentHtml(1444);

$cobra5->documentSearch('business', 0, 10);

try
{
  $this->getDocument(999999999);
}

catch(SoapFault $e)
{
  // deal with error
}
json
{
  "webinfo/cobra5-php-sdk": "1.1.*"
  }
}