Skip to content

Mul-tiMedia/snelstart-php

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snelstart B2B API

PHP client library to use the Snelstart B2B API. Build Status

Note that this library is not created, or maintained, by Snelstart.

Installation

Installation is easy as 1, 2, 3 thanks to Composer.

composer require iwd-nl/snelstart-php

Usage

Create an account at [https://b2bapi-developer.snelstart.nl/] and subscribe to 'Verkenning'. Obtain the Primary and Secondary key from your Profile and generate a key on the web interface of Snelstart under 'Maatwerk'. You are going to need these credentials for the next chapter.

Authentication

Now that you have obtained the credentials you can start by connection the library to the API.

$primaryKey = "<primary>";
$secondaryKey = "<secondary>";
$clientKey = "<maatwerksleutel>";

$bearerToken = new \SnelstartPHP\Secure\BearerToken\ClientKeyBearerToken($clientKey);
$accessTokenConnection = new \SnelstartPHP\Secure\AccessTokenConnection($bearerToken);
$accessToken = $accessTokenConnection->getToken();

$connection = new \SnelstartPHP\Secure\AuthenticatedConnection(
    new \SnelstartPHP\Secure\ApiSubscriptionKey($primaryKey, $secondaryKey),
    $accessToken
);

_Please note that there is also a class named SnelstartPHP\Secure\CachedAccessTokenConnection for once you are done with developing. This will automatically take care of renewing expired access tokens. _

Check if you are really authenticated

We implemented the EchoConnector to test to see if you are authenticated.

Fetch data

For an example see var/doc/example/inkoopboeking_find_all.php

Add data

For an example see var/doc/example/inkoopboeking_add.php

Supported resources

Not all resources are currently implemented. Feel free to create a pull request.

Links

Authors

About

PHP 7.1+ Library for the Snelstart API https://b2bapi-developer.snelstart.nl/

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%