mtymek / mt-zendesk-api
ZF2 module wrapper for Zendesk API
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 2 530
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 1
Requires
- php: ^5.4 || ^7.0
- zendesk/zendesk_api_client_php: ^1.0
- zendframework/zend-servicemanager: ^2.6 || ^3.0.3
Requires (Dev)
README
Introduction
This module allows easy access of Zendesk API from within Zend Framework 2 application.
Installation
Installation is supported via Composer:
- Add
"mtymek/mt-zendesk-api":"dev-master"
to yourcomposer.json
file and runphp composer.phar update
. - Add
MtZendeskApi
to yourconfig/application.config.php
file under the modules key.
Configuration
- Copy
config/zendesk.local.php.dist
file into your main application'sconfig/autoload' directory, rename it to
zendesk.local.php` - Replace placeholder values with subdomain, username and API token read from Zendesk settings page
Example:
return [ 'zendesk' => [ 'subdomain' => 'mycompany', 'username' => 'support@mycompany.com', 'token' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX', ], ];
Usage
Once configured, MtZendeskApi will expose Zendesk API client using ServiceManager. Example usage (from controller):
$client = $this->getServiceLocator()->get('Zendesk\API\Client'); $newTicket = $client->tickets()->create( [ 'subject' => 'Question to Support Team', 'tags' => ['tag1', 'tag2'], 'requester' => [ 'email' => 'johndoe@domain.com', ], 'comment' => [ 'body' => "Ticket body" ], 'priority' => 'normal' ] );