This package is still in development, please do not use it in production
Digitaleo PHP SDK
, (*1)
This library aims to give to developers a nice SDK to work with Digitaleo's APIs., (*2)
How to use it
In your project directory :, (*3)
Run, (*4)
composer require digitaleo/php-sdk
, (*5)
And use it like this :, (*6)
<?php
require './vendor/autoload.php';
$credentials = new \Digitaleo\SDK\Api\Credentials(
'your-client-id',
'your-client-secret',
'your-username',
'your-password'
);
$adapter = new \Digitaleo\SDK\Api\Authentication\OAuth2Adapter($credentials);
$client = new \Digitaleo\SDK\Api\Client($adapter);
# How to post a contact
$response = $client->post('https://contacts.messengeo.net/rest/contacts', [
'contacts' => [
['civility' => 'M', 'firstName' => 'Michel', 'lastName' => 'Patrick', 'phone' => '0605040302'],
],
]);
# How to retrieve your campaigns
$response = $client->get('https://api.messengeo.net/rest/campaigns');
Roadmap
- [x] Basic HTTP Client with oAuth
- [ ] Add tests
- [ ] Add doc
- [ ] Find a way to avoid passing the complete URL as a resource
- [ ] Update HTTP Client to give a nice "Active Record" like interface