dsj/snelstartapi

A communication bundle for talking with the SnelStart api

Installs: 353

Dependents: 0

Suggesters: 0

Security: 0

Type:symfony-bundle

0.0.1 2017-05-02 10:37 UTC

This package is auto-updated.

Last update: 2024-02-29 02:59:39 UTC


README

Requirements | Installation | Usage | Features | Suggestions | Contributing | License

SnelstartApiBundle

Total Downloads Monthly Downloads Latest Stable Version License

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

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 the array is empty
  • Your endpoints will return a stdClass object or array 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