This package is abandoned and no longer maintained. No replacement package was suggested. 2018-12-21 13:09 UTC

This package is auto-updated.

Last update: 2022-10-19 11:45:54 UTC


Scrutinizer Code Quality Latest Stable Version Total Downloads Latest Unstable Version License Code Intelligence Status


This Datamolino Client is currently compatible with version 1.2.3 of the Datamolino API


  • php >=7.1
  • ext-json


composer require cwd/datamolino-client



$datamolino = new DatamolinoClient();

// Get a Token via password authentication
$token = $datamolino->getClient()->authenticatePassword($clientID, $clientSecret, $username, $password);

// Store the token for later use
// you can refresh your token any time by using
$token = $datamolino->getClient()->refreshToken($clientID, $clientSecret, $token->getRefreshToken());

// If you have stored the token elsewhere just build the object:
$token = (new Token())->setAccessToken($accessToken)

// Set the token in the Client

User Endpoint

// me   
$user = $datamolino->user()->me();

Agenda Endpoint

// get all agendas
$agendas = $datamolino->agenda()->getAll();

// get agenda by id
$agenda = $datamolino->agenda()->get(4050);

// update
$agenda->setName('My Agenda Name')
// create    
$agenda = new Agenda();
$agenda->setName('My Other Agenda')
       ->setAddress((new Address())
$agenda = $datamolino->agenda()->create($agenda, $lacyLoad = true);
// delete    

Document Endpoint

// Find documents
$documents = $datamolino->document()->find(4050, [], new \DateTime('2018-10-10 21:59:21'));

// Get document by id
$document = $datamolino->document()->get(268145);

// Upload multiple documents via finder
$finder = (new Finder())->in('../testdata')->date('since 1 hour ago');
$documents = $datamolino->document()->createMultiple($finder, 4050, Document::DOCTYPE_PURCHASE, false, true);
// Or path
$documents = $datamolino->document()->createMultiple('../testdata', 4050, Document::DOCTYPE_PURCHASE, false, true);
// or supply an array with SPLFileInfo Objects
$files = [
    new \SplFileInfo('path/to/file.pdf'),
    new \SplFileInfo('path/to/other/file.pdf'),
$documents = $datamolino->document()->createMultiple($files, 4050, Document::DOCTYPE_PURCHASE, false, true);

// send repair request for a document
$datamolino->document()->repair(268138, 'API test ignore');

// Delete document

Symfony Integration


Enable the bundle in bundles.php:

return [
 // ...
 Cwd\Datamolino\CwdDatamolino::class => ['all' => true],

Create config/packages/cwd_datamolino.yaml:

  client_id: your_client_id
  client_secret: you_client_secret
  datamolino_host: or
  username: your_username
  password: your_password


$datamolino = $this->get(Cwd\Datamolino\DatamolinoClient::class);

// Get a Token via password authentication
$token = $datamolino->getClient()->authenticate();