blanchonvincent / zendesk-remote-object
This library provide a REST client to ZenDesk remote call.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 3 064
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- fourmation/rest-remote-object: 1.0.1
- ocramius/proxy-manager: 0.5.1
- zendframework/zendframework: >=2.2.0
Requires (Dev)
- fabpot/php-cs-fixer: 0.4.*@dev
- phpunit/phpunit: 3.7.*
- satooshi/php-coveralls: ~0.6
This package is not auto-updated.
Last update: 2019-04-27 13:32:56 UTC
README
This library provide a REST client to ZenDesk remote call. This project is based on RestRemoteObject which allow to control a REST API with objects.
Installation
php composer.phar require "blanchonvincent/zendesk-remote-object:0.6.*"
You need PHP 5.4 or higher.
Architecture
This project use Zend\ServiceManager to create entities or services. Each new entities or service calls must use the ServiceManager. Each entity and service pilot a remote rest proxy to call remote API. To know how to do remote call, read the ZenDeskRemoteObject documentation.
Usage example
All examples are in the examples/
folder.
- retrieve current user :
$userService = $serviceManager->get('ZenDesk\Service\UserService'); $user = $userService->me(); var_dump($user->getName()); // current user name
- update the user :
$user->setName('Vincent Blanchon'); $user->save();
- create user :
$user = new ZenDesk\Entity\User(); $user->setName('Vincent Blanchon'); $user->setEmail('email@email.com.au'); $service = $serviceManager->get('ZenDesk\Service\UserService'); $service->persist($user); var_dump($user->getId());
- create ticket :
$ticket = new ZenDesk\Entity\Ticket(); $ticket->setSubject('My first ticket'); $ticket->setDescription('French will win the soccer world cup'); $ticket->setStatus('pending'); $service = $serviceManager->get('ZenDesk\Service\TicketService'); $service->persist($ticket); var_dump($ticket->getId()); // there is now an id
Zend Framework 2 integration
A Module.php
file is provided, you can also use this project like a Zend Framework 2 module.
Features list
Entity :
- User : create, update, delete, get tickets, suspend
- Ticket : create, update, delete, add comments, get tags, close
- TicketField : create, update, delete
- UserField : create, update, delete
- OrganizationField : create, update, delete
- Trigger : create, update, delete
- Automation : create, update, delete
- Macro : create, update, delete
- View : create, update, delete, get tickets
Service :
- User : get, get current, list, search, autocomplete
- Ticket : get, list, list recent, search
- TicketField : get, list
- UserField : get, list
- OrganizationField : get, list
- Tags : list
- Trigger : list, get
- Automation : list, get
- Macro : get, list
- View : get, list, list active
- Search : user, ticket