bboxlab/mosel

SDK for BT open APIs

dev-main 2022-07-13 09:58 UTC

This package is not auto-updated.

Last update: 2024-05-01 17:24:04 UTC


README

This package is still under construction (july 13th 2022).

Open Api are described in the Bouygues Telecom Developer Portal: https://developer.bouyguestelecom.fr

Install

composer require bboxlab/mosel

List of API and tools in Open API SDK

  • authenticator for app credentials Oauth flow
  • check email address
  • check iban
  • check portability

How to use?

First, install the package on your php application with composer.

Then, create a Sdk Mosel Object with a credentials and a mosel configuration.

$configuration = new Configuration();
[...]
$sdk = new Sdk('clientId', 'secretId', $configuration);

You can use a preexisting configuration, here for the default bt env configuration.

$sdk = new Sdk('clientId', 'secretId', new ConfigurationCreator()->createApConfig());

When sdk is set correctly, you can use it to fetch secured open api

$emailInput = new EmailInput();
$emailInput->setEmailAddress('example@email.com');
$response = $sdk->checkEmail($emailInput);

A Mosel Response object is returned with the app credentials token created as an object and the response given by Bt Api as an array.

How to test Mosel package

You can use phpunit to launch the tests:

 ./vendor/bin/phpunit tests/