mremi / dolist
A PHP5 library to interact with the API of Dolist CRM
Installs: 1 106
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.3
- psr/log: ~1.0
This package is auto-updated.
Last update: 2024-10-26 23:27:53 UTC
README
This library allows you to interact with the API of Dolist CRM.
Basic Docs
Installation
Only 1 step:
Download Dolist using composer
Add Dolist in your composer.json:
{ "require": { "mremi/dolist": "dev-master" } }
Now tell composer to download the library by running the command:
$ php composer.phar update mremi/dolist
Composer will install the library to your project's vendor/mremi
directory.
Add/update a contact
<?php use Mremi\Dolist\Authentication\AuthenticationManager; use Mremi\Dolist\Authentication\AuthenticationRequest; use Mremi\Dolist\Contact\ContactManager; use Mremi\Dolist\Contact\FieldManager; $contactSoapClient = new \SoapClient('http://api.dolist.net/v2/ContactManagementService.svc?wsdl', array( 'soap_version' => SOAP_1_1, 'trace' => true, 'connection_timeout' => 2, // ... )); $authSoapClient = new \SoapClient('http://api.dolist.net/v2/AuthenticationService.svc?wsdl', array( 'soap_version' => SOAP_1_1, 'trace' => true, 'connection_timeout' => 2, // ... )); $authRequest = new AuthenticationRequest('YOUR_ACCOUNT_IDENTIFIER', 'YOUR_AUTHENTICATION_KEY'); $authManager = new AuthenticationManager($authSoapClient, $authRequest, 3); $contactManager = new ContactManager($contactSoapClient, $authManager, 3); $fieldManager = new FieldManager; $contact = $contactManager->create(); $contact->setEmail('test@example.com'); $contact->addField($fieldManager->create('firstname', 'Firstname')); $contact->addField($fieldManager->create('lastname', 'Lastname')); $ticket = $contactManager->save($contact); $saved = $contactManager->getStatusByTicket($ticket); if ($saved->isOk()) { // contact has been saved... } else { // something is wrong... echo sprintf('Returned code: %s, description: %s', $saved->getReturnCode(), $saved->getDescription()); }
Retrieve contacts
<?php use Mremi\Dolist\Contact\GetContactRequest; $request = new GetContactRequest; $request->setOffset(50); // ... $contacts = $contactManager->getContacts($request); // ...
Contribution
Any question or feedback? Open an issue and I will try to reply quickly.
A feature is missing here? Feel free to create a pull request to solve it!
I hope this has been useful and has helped you. If so, share it and recommend it! :)