2017 © Pedro Peláez
 

library crembl

Crembl API wrapper, allows you send regular (or registered) mail through the Crembl web service.

image

torfs-ict/crembl

Crembl API wrapper, allows you send regular (or registered) mail through the Crembl web service.

  • Thursday, January 5, 2017
  • by kristoftorfs
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Description

API wrapper for the Crembl web service., (*1)

Please note that we are in no way affiliated with neither Crembl nor bpost. Issues regarding this API wrapper can be filed at our GitHub page, while issues regarding to the actual API should be filed with Crembl., (*2)

Usage

Before using this API make sure to check out the official documentation. The API only has three methods:, (*3)

  1. Creating a task (i.e. document to be sent): createTask.
  2. Uploading a file for an existing task: uploadFile or uploadFileFromString.
  3. Retrieve information about an existing task: getTaskInfo.

Error handling

Whenever an error occurs, the client will throw an exception of type Crembl\Exception, where you can find the actual error information by calling the getInfo() method., (*4)

Examples

use bpost\Crembl\Client;
use bpost\Crembl\Config\TaskConfig;

$client = new Client('<secret>');

Creating a task

$task = new TaskConfig();
$task
    ->setDocumentTypeRegular()
    ->setAddresseeLine1('Microsoft Belgium')
    ->setAddresseeLine2('Corporate Village - Bayreuth Building')
    ->setAddressCountry('BE')
    ->setAddressZipCode('1935')
    ->setAddressCity('Zaventem')
    ->setAddressStreetName('Leonardo Da Vincilaan')
    ->setAddressStreetNumber('3');
$id = $client->createTask($task);

Returns the id generated by the Crembl API e.g. A12345678910111213141516171819209., (*5)

Uploading a file

$success = $client->uploadFile($id, __DIR__ . '/myletter.pdf');

Returns TRUE in case of success, or throws an error otherwise., (*6)

Retrieve task information

$task = $client->getTaskInfo($id);
var_dump($task);

Returns an object of type Crembl\Task\Info., (*7)

The Versions

05/01 2017

dev-master

9999999-dev https://github.com/torfs-ict/crembl

Crembl API wrapper, allows you send regular (or registered) mail through the Crembl web service.

  Sources   Download

MIT

The Requires

 

by Kristof Torfs

api mail json rest wrapper crembl bpost

05/01 2017

dev-develop

dev-develop https://github.com/torfs-ict/crembl

Crembl API wrapper, allows you send regular (or registered) mail through the Crembl web service.

  Sources   Download

MIT

The Requires

 

by Kristof Torfs

api mail json rest wrapper crembl bpost

05/01 2017

1.0.0

1.0.0.0 https://github.com/torfs-ict/crembl

Crembl API wrapper, allows you send regular (or registered) mail through the Crembl web service.

  Sources   Download

MIT

The Requires

 

by Kristof Torfs

api mail json rest wrapper crembl bpost