As an example, I'm looking to use Zendesk's API to create tickets and other things within my custom modules. They have a Packagist that can be installed via composer:
composer require zendesk/zendesk_api_client_php
Now I'm a bit confused on how to actually call or load this API in my custom module(s).
For example, how would you call the Zendesk API library in a custom observer module:
<?php
namespace MyCompany\MyModule\Observer;
use Magento\Framework\Event\ObserverInterface;
class SalesOrderShipmentSaveAfter implements ObserverInterface
{
public function execute(\Magento\Framework\Event\Observer $observer)
{
// Do something here using Zendesk API
}
}
Is it declared in MyCompany/MyModule
composer.json file?
$value = \Zendesk\Myfile::functionName()
– Prince Patel Mar 15 '18 at 5:25