dsj / snelstartapi
A communication bundle for talking with the SnelStart api
Requires
- php: >=5.3.3
- eightpoints/guzzle-bundle: 5.3.0
- symfony/cache: ^3.2
This package is auto-updated.
Last update: 2025-03-29 00:38:57 UTC
README
Requirements | Installation | Usage | Features | Suggestions | Contributing | License
SnelstartApiBundle
This bundle integrates the Snelstart Api into Symfony. Snelstart is a bookkeeping cloud software with the ability to integrate any existing CRM software seamlessly.
This package was created with love by DSJ Productions
SnelstartApiBundle follows semantic versioning. Read more on semver.org.
Requirements
- PHP 5.3 or above
- Symfony 2.5 or above
- Guzzle (included by composer)
- Symfony Cache Component (included by composer)
Installation
To install this bundle, run the command below and you will get the latest version by Packagist.
composer require dsj/snelstartapi
To use the newest (maybe unstable) version please add following into your composer.json (not recommended, api might change):
{
"require": {
"dsj/snelstartapi": "dev-master"
}
}
Usage
Load bundle in AppKernel.php:
new DSJ\SnelstartApiBundle\SnelstartApiBundle()
Configuration in parameters.yml:
parameters:
snelstart_application_key: the application key of your snelstart account link
snelstart_primary_key: the primary key of your snelstart account
snelstart_secondary_key: the secondary key of your snelstart account
...
All of these settings are REQUIRED.
Using services in controller:
/** @var \DSJ\SnelstartApiBundle\Manager\SnelStartManager $oSnelStartManager */
$oSnelStartManager = $this->get('dsj.snelstart');
// Do a raw GET request
$aCustomers = $oSnelStartManager->request('GET', 'relaties');
// Or call via this easy to remember syntax
$aCustomers = $oSnelStartManager->Relaties->getAll();
// Do a raw POST request
$aCustomers = $oSnelStartManager->request('POST', 'relaties', [
'naam' => 'test',
]);
// Or call via this easy to remember syntax
$aCustomers = $oSnelStartManager->Relaties->create([
'naam' => 'test',
]);
Features
- Missing parameters displayed on faulty requests thanks to swagger file integeration
- Easy callable endpoints (
$oSnelStartManager->Relaties->getAll()
,$oSnelStartManager->Relaties->get($id)
) - Token cache with invalidation
- Reqeust retries on failed responses
- Authentication happens automagically, you just supply the needed keys in configuration
Good to know
- Calling endpoints which returns a
null
means the object does not exist or thearray
is empty - Your endpoints will return a
stdClass
object orarray
depending on the type of endpoint you have chosen.
Contributing
👍 If you would like to contribute to the project, please read the CONTRIBUTING.md.
🎉 Thanks to the contributors who participated in this project.
License
This bundle is released under the MIT license