PHP code example of imanaging-document / api-communication-bundle

1. Go to this page and download the library: Download imanaging-document/api-communication-bundle 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/ */

    

imanaging-document / api-communication-bundle example snippets


class MyBeautifulService
{
  private ...
  private $apiZeusCommunication;
  private ...
  
  /**
   * ...
   * @param ApiZeusCommunication $apiZeusCommunication
   * ...
   */
  public function __construct(..., ApiZeusCommunication $apiZeusCommunication, ...){
    ...
    $this->apiZeusCommunication = $apiZeusCommunication;
    ...
  }
  ...
}

$url = '/my-beautiful-get-url';
$response = $this->apiZeusCommunication->sendGetRequest($url);

if ($response->getHttpCode() === 200) {
  // SOME LOGIC
}

$postData = array(
  '...' => '...',
  'my_post_key' => $myPostValue,
  '...' => '...',
);

$url = '/my-beautiful-post-url';
$response = $this->apiZeusCommunicationService->sendPostRequest($url, $postData);

if ($response->getHttpCode() === 201) {
  // SOME LOGIC
}